[ansible] added service role
This commit is contained in:
5
ansible/roles/service/tasks/main.yml
Normal file
5
ansible/roles/service/tasks/main.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
- name: install tankz systemd unit file
|
||||
template: src=template/tankz.j2 dest=/etc/systemd/system/tankz.service
|
||||
|
||||
- name: start tankz
|
||||
systemd: state=started name=tankz daemon_reload=yes
|
||||
16
ansible/roles/service/template/tankz.j2
Normal file
16
ansible/roles/service/template/tankz.j2
Normal file
@@ -0,0 +1,16 @@
|
||||
[Unit]
|
||||
Description=Tank'z game server
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
PIDFile=/var/run/tankz.pid
|
||||
WorkingDirectory=/home/holop/repo/tankz/current/target
|
||||
User=www-data
|
||||
Group=www-data
|
||||
ExecStart=/usr/bin/neko /home/holop/repo/tankz/current/target/tankz.n
|
||||
TimeoutSec=300
|
||||
Restart=always
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
3
ansible/roles/service/vars/main.yml
Normal file
3
ansible/roles/service/vars/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
ansible_become: yes
|
||||
ansible_user: barin
|
||||
ansible_become_pass: 1234!QAZ
|
||||
3
ansible/setup.yml
Normal file
3
ansible/setup.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
- hosts: all
|
||||
roles:
|
||||
- service
|
||||
Reference in New Issue
Block a user