improve warehost-api role

This commit is contained in:
Martin Geno 2016-11-25 00:03:20 +01:00
parent ef3b9a5af3
commit ff28b2215f
5 changed files with 18 additions and 18 deletions

View File

@ -8,5 +8,5 @@
- name: reload caddy - name: reload caddy
service: name=caddy state=reloaded service: name=caddy state=reloaded
- name: restart warehost - name: restart warehost-api
service: name=warehost state=restarted service: name=warehost-api state=restarted

View File

@ -1,3 +1,4 @@
--- ---
dependencies: dependencies:
- warehost-meta
- warehost-db - warehost-db

View File

@ -1,28 +1,19 @@
--- ---
- name: Create users
user: name=warehost createhome=no
- name: Download Warehost (TODO current copy) - name: Download Warehost (TODO current copy)
copy: src=warehost dest=/usr/local/bin/warehost owner=root group=root mode=0755 copy: src=warehost dest=/usr/local/bin/warehost-api owner=root group=root mode=0755
- name: Create config folder
file: path=/etc/warehost state=directory owner=warehost mode=0700
- name: Create log folder
file: path=/var/log/warehost state=directory owner=warehost mode=0700
- name: Configurate warehost - name: Configurate warehost
template: src=config.yml dest=/etc/warehost/api.conf owner=warehost mode=0600 template: src=config.yml dest=/etc/warehost/api.conf owner=warehost mode=0600
notify: restart warehost notify: restart warehost-api
- name: Install service - name: Install service
template: src=warehost.unit dest=/lib/systemd/system/warehost.service owner=root mode=644 template: src=warehost-api.unit dest=/lib/systemd/system/warehost-api.service owner=root mode=644
notify: notify:
- reload daemon-reload - reload daemon-reload
- restart warehost - restart warehost-api
- name: Enable warehost - name: Enable warehost
service: name=warehost state=started enabled=yes service: name=warehost-api state=started enabled=yes
- name: Configurate per nginx - name: Configurate per nginx

View File

@ -1,5 +1,5 @@
[Unit] [Unit]
Description=Warehost v2 Description=Warehost api v2
After=syslog.target After=syslog.target
After=network.target After=network.target
After=postgresql.service After=postgresql.service
@ -14,7 +14,7 @@ After=postgresql.service
Type=simple Type=simple
User=warehost User=warehost
Group=nobody Group=nobody
ExecStart=/usr/local/bin/warehost -c /etc/warehost/api.conf ExecStart=/usr/local/bin/warehost-api -c /etc/warehost/api.conf
Restart=always Restart=always
[Install] [Install]

View File

@ -0,0 +1,8 @@
---
- name: Create users
user: name=warehost createhome=no
- name: Create config folder
file: path=/etc/warehost state=directory owner=warehost mode=0700
- name: Create log folder
file: path=/var/log/warehost state=directory owner=warehost mode=0700