library/roles/ELK/elasticHQ: Add a working systemd unit. Add the tasks to install the systemd unit.

This commit is contained in:
Andrea Dell'Amico 2018-02-17 12:34:19 +01:00
parent 3a93132a84
commit 8956395965
4 changed files with 20 additions and 3 deletions

View File

@ -9,4 +9,4 @@ elastic_hq_python_pkgs:
- python3
- python3-pip
elastic_hq_start_cmd: './manage.py runserver'
elastic_hq_start_cmd: '/usr/bin/python3 {{ elastic_hq_home }}/application.py'

View File

@ -0,0 +1,4 @@
---
- name: systemd reload
command: systemctl daemon-reload

View File

@ -16,8 +16,20 @@
- name: Get the elasticHQ distribution
git: repo={{ elastic_hq_repo_url }} dest={{ elastic_hq_home }}
# - name: Get the elasticHQ dependencies
# pip: chdir={{ elastic_hq_home }} executable=pip3 requirements=requirements.tx
- name: Get the elasticHQ dependencies
pip: chdir={{ elastic_hq_home }} executable=pip3 requirements=requirements.txt
- name: Install the elasticHQ systemd startup unit
template: src=elastichq.systemd.j2 dest=/etc/systemd/system/elastichq.service mode=0644 owner=root group=root
when: ansible_service_mgr == 'systemd'
register: elastichq_systemd_unit
- name: systemd reload
command: systemctl daemon-reload
when: elastichq_systemd_unit is changed
- name: Ensure that elasticHQ is started and enabled
service: name=elastichq state=started enabled=yes
tags: [ 'elasticsearch', 'elastic_hq' ]

View File

@ -14,4 +14,5 @@ User={{ elastic_hq_user }}
Group={{ elastic_hq_user }}
ExecStart={{ elastic_hq_start_cmd }}
ExecStop=