Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---
- - hosts: all
- remote_user: root
- tasks:
- - name: Update packages
- pacman:
- update_cache: yes
- upgrade: yes
- - name: Install several packages
- pacman:
- name: "{{ item }}"
- state: latest
- with_items:
- - sudo
- - git
- - nodejs
- - npm
- - mongodb
- - nginx
- - xorg-server
- - xorg-xinit
- - xterm
- - nodm
- - i3
- - dmenu
- - ttf-dejavu
- - name: Activate sudo for group 'wheel'
- lineinfile:
- dest: /etc/sudoers
- line: '%wheel ALL=(ALL) ALL'
- - name: Add the user 'fetsy'
- user:
- name: fetsy
- password: $6$hGO2R6SH1cl9Ku$.kZD05.RaE/KysSj.HY.myya4N9UbKV1KpWVtA55iC1Bl1oWRwKiuLEWqlehvBhEH8g7YJSyj2UX0MkBomraH0
- groups: wheel
- append: yes
- - hosts: all
- remote_user: root
- become: yes
- become_user: fetsy
- tasks:
- - name: Download FeTSy Hammertag
- git:
- repo: https://github.com/normanjaeckel/FeTSy-Hammertag
- dest: "{{ fetsy_dir }}"
- update: yes
- - name: Install NodeJS modules for FeTSy Hammertag
- npm:
- path: "{{ fetsy_dir }}"
- #- name: Re-Run FeTSy Hammertag gulp tasks with production flag
- # command: "node_modules/.bin/gulp --production"
- # args:
- # chdir: "{{ fetsy_dir }}"
- - name: Setup user specific Xorg config
- template:
- dest: /home/fetsy/.xinitrc
- src: xinitrc
- mode: 0750
- - name: Setup i3 configuration
- template:
- dest: /home/fetsy/.config/i3/config
- src: i3_config
- - hosts: all
- remote_user: root
- tasks:
- - name: Setup NginX configuration
- template:
- dest: /etc/nginx/nginx.conf
- src: nginx.conf
- - name: Setup FeTSy Hammertag systemd unit
- blockinfile:
- dest: /etc/systemd/system/fetsy-hammertag.service
- create: yes
- block: |
- [Unit]
- Description=FeTSy Hammertag server app (ExpressJS app)
- Requires=mongodb.service nginx.service
- [Service]
- Type=simple
- ExecStart=/usr/bin/node dist/server/server.js
- WorkingDirectory={{ fetsy_dir }}
- Restart=always
- RestartSec=5
- User=fetsy
- Group=fetsy
- Environment=NODE_ENV=production DEBUG='' FETSY_PORT={{ fetsy_port }}
- [Install]
- WantedBy=multi-user.target
- - name: Setup nodm configuration
- blockinfile:
- dest: /etc/nodm.conf
- block: |
- NODM_USER=fetsy
- NODM_XSESSION=/home/fetsy/.xinitrc
- - name: Setup pam.d configuration for nodm
- blockinfile:
- dest: /etc/pam.d/nodm
- create: yes
- block: |
- #%PAM-1.0
- auth include system-login
- account include system-login
- password include system-login
- session include system-login
- - name: Enable systemd units
- systemd:
- name: "{{ item }}"
- enabled: yes
- with_items:
- - fetsy-hammertag.service
- - nodm.service
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement