library/roles/ELK/elasticHQ: Add a working systemd unit. Add the tasks to install the systemd unit.
This commit is contained in:
parent
3a93132a84
commit
8956395965
|
@ -9,4 +9,4 @@ elastic_hq_python_pkgs:
|
||||||
- python3
|
- python3
|
||||||
- python3-pip
|
- python3-pip
|
||||||
|
|
||||||
elastic_hq_start_cmd: './manage.py runserver'
|
elastic_hq_start_cmd: '/usr/bin/python3 {{ elastic_hq_home }}/application.py'
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
- name: systemd reload
|
||||||
|
command: systemctl daemon-reload
|
||||||
|
|
|
@ -16,8 +16,20 @@
|
||||||
- name: Get the elasticHQ distribution
|
- name: Get the elasticHQ distribution
|
||||||
git: repo={{ elastic_hq_repo_url }} dest={{ elastic_hq_home }}
|
git: repo={{ elastic_hq_repo_url }} dest={{ elastic_hq_home }}
|
||||||
|
|
||||||
# - name: Get the elasticHQ dependencies
|
- name: Get the elasticHQ dependencies
|
||||||
# pip: chdir={{ elastic_hq_home }} executable=pip3 requirements=requirements.tx
|
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' ]
|
tags: [ 'elasticsearch', 'elastic_hq' ]
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,5 @@ User={{ elastic_hq_user }}
|
||||||
Group={{ elastic_hq_user }}
|
Group={{ elastic_hq_user }}
|
||||||
|
|
||||||
ExecStart={{ elastic_hq_start_cmd }}
|
ExecStart={{ elastic_hq_start_cmd }}
|
||||||
|
ExecStop=
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue