Browse Source

add systemd unit to login api server

python3
Edoardo Putti 7 years ago
parent
commit
fcbed30139
2 changed files with 19 additions and 12 deletions
  1. +6
    -12
      roles/login/tasks/main.yaml
  2. +13
    -0
      roles/login/templates/login.service

+ 6
- 12
roles/login/tasks/main.yaml View File

@ -47,11 +47,10 @@
notify:
- restart login
- name: add login init script
template: src=login.j2 dest=/etc/init.d/login mode=755
register: add_login_startup_script
notify:
- restart login
- name: add systemd service for api server
template:
src: login.service
dest: /etc/systemd/system/login.service
- name: create /var/log/login.log
file:
@ -72,10 +71,5 @@
systemd:
daemon_reload: yes
name: login
when: add_login_startup_script.changed
- include_role:
name: service
vars:
service_name: login
service_packages: null
state: started
enabled: yes

+ 13
- 0
roles/login/templates/login.service View File

@ -0,0 +1,13 @@
[Unit]
Description=Login Web Service
After=network.target
[Service]
Type=simple
User=login
Group=login
WorkingDirectory=/srv/login
ExecStart=/srv/login/server.py
[Install]
WantedBy=multi-user.target

Loading…
Cancel
Save