wstunnel/deploy/server.yml
Erèbe 4d2f9f6a0e Add deploy script
Former-commit-id: d64e8a40ac9c622f1dd1aaebb744da2f7230207f
Former-commit-id: 7b266eef62ed54141789b01c155d407ed0ba87c4 [formerly 7b2eda2cb4e3e6279bed8f03b5f35c77afd94a3f [formerly 7b2eda2cb4e3e6279bed8f03b5f35c77afd94a3f [formerly 7b2eda2cb4e3e6279bed8f03b5f35c77afd94a3f [formerly 08b74a015fac636104626a090397079e59fa1de4]]]]
Former-commit-id: d00851b46c56e3e8beb8e8e1835521369ee14f4c
Former-commit-id: 716c5a760e7dc77ee204c2dab4e5f8d80a42bab3
Former-commit-id: 5fcc8ab51a743a11f5cab51b0be53d8626bdee2c
Former-commit-id: 5b74c97b7345dc6660dc0af35a4e461471b4e348 [formerly 3f8e5216cd9fc3e7d1acb2f057d4e049daf277d4]
Former-commit-id: 3e38e32a85d9675e5b436846ea04f0fbc2ff6fe4
2016-08-26 22:40:35 +02:00

60 lines
1.5 KiB
YAML
Executable file

- hosts: server
remote_user: root
vars:
# Username
user: wstunnel
listen_port: 9999
tasks:
- name: Create user {{ user }}
user: name={{ user }}
comment="{{ user }} user"
shell=/bin/false
createhome=no
- name: Install wstunnel app
copy: src=config/wstunnel
dest=/usr/local/bin/
owner=wstunnel
group=wstunnel
mode=u+rwx
################################
# NGINX
################################
- name: Add nginx config
template: src=config/wstunnel.nginx
dest=/etc/nginx/sites-available/
notify: reload nginx
- name: Symlink nginx config
file: src=/etc/nginx/sites-available/wstunnel.nginx
dest=/etc/nginx/sites-enabled/default
state=link
- name: Nginx started
service: name=nginx state=started enabled=true
################################
# SYSTEMD
################################
- name: Copy systemd service
template: src=config/wstunnel.service
dest=/usr/lib/systemd/system/
notify: reload wstunnel
- name: reload systemd
command: systemctl daemon-reload
- name: wstunnel started
service: name=wstunnel state=started enabled=true
handlers:
- name: reload nginx
service: name=nginx state=reloaded enabled=true
- name: reload wstunnel
service: name=wstunnel state=restarted enabled=true