[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
|
||||
@@ -2,7 +2,7 @@ role :app, %w{localhost}
|
||||
role :web, %w{localhost}
|
||||
role :db, %w{localhost}
|
||||
|
||||
set :user, ENV['USER']
|
||||
#set :user, ENV['USER']
|
||||
user = fetch(:user)
|
||||
|
||||
server 'localhost', ssh_options: { port: 22, user: user, forward_agent: true }
|
||||
@@ -30,7 +30,7 @@ class JsConnection<O:Message, I:Message> extends BaseConnection<O, I> {
|
||||
}
|
||||
|
||||
private function buildSocket(host:String, port:Int):WebSocket {
|
||||
return untyped __js__("new WebSocket('ws://'+host+':'+port);");
|
||||
return untyped __js__('new WebSocket("ws://${host}:${port}");');
|
||||
}
|
||||
|
||||
override public function connect():Promise<IConnection<O, I>> {
|
||||
|
||||
Reference in New Issue
Block a user