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: notify:
- restart login - 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 - name: create /var/log/login.log
file: file:
@ -72,10 +71,5 @@
systemd: systemd:
daemon_reload: yes daemon_reload: yes
name: login 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