forked from ISTI-ansible-roles/ansible-roles
library/roles/ELK/elasticHQ: playbook that installs elasticHQ. It's a standalone app now.
This commit is contained in:
parent
de8bd78c8d
commit
3a93132a84
|
@ -0,0 +1,12 @@
|
||||||
|
---
|
||||||
|
elastic_hq_repo_url: https://github.com/ElasticHQ/elasticsearch-HQ.git
|
||||||
|
elastic_hq_user: elastichq
|
||||||
|
elastic_hq_home: /srv/elastichq
|
||||||
|
elastic_hq_http_port: 5000
|
||||||
|
elastic_hq_use_nginx_proxy: True
|
||||||
|
|
||||||
|
elastic_hq_python_pkgs:
|
||||||
|
- python3
|
||||||
|
- python3-pip
|
||||||
|
|
||||||
|
elastic_hq_start_cmd: './manage.py runserver'
|
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- { role: '../../library/roles/nginx', when: elastic_hq_use_nginx_proxy }
|
|
@ -0,0 +1,23 @@
|
||||||
|
---
|
||||||
|
- block:
|
||||||
|
- name: Install git
|
||||||
|
apt: pkg=git update_cache=yes cache_valid_time=1800
|
||||||
|
|
||||||
|
- name: Install the minimal python 3 env
|
||||||
|
apt: pkg={{ item }} update_cache=yes cache_valid_time=1800
|
||||||
|
with_items: '{{ elastic_hq_python_pkgs }}'
|
||||||
|
|
||||||
|
- name: Create a user to run the elasticHQ service
|
||||||
|
user: name={{ elastic_hq_user }} home={{ elastic_hq_home }} createhome=no shell=/usr/sbin/nologin system=yes
|
||||||
|
|
||||||
|
- name: Create the user home directory
|
||||||
|
file: dest={{ elastic_hq_home }} state=directory owner={{ elastic_hq_user }} group={{ elastic_hq_user }}
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
tags: [ 'elasticsearch', 'elastic_hq' ]
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
[Unit]
|
||||||
|
Description=ElasticHQ - Monitoring and Management Web Application for ElasticSearch instances and clusters.
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
WorkingDirectory={{ elastic_hq_home }}
|
||||||
|
StandardOutput=syslog
|
||||||
|
StandardError=syslog
|
||||||
|
Restart=on-failure
|
||||||
|
RemainAfterExit=yes
|
||||||
|
|
||||||
|
User={{ elastic_hq_user }}
|
||||||
|
Group={{ elastic_hq_user }}
|
||||||
|
|
||||||
|
ExecStart={{ elastic_hq_start_cmd }}
|
||||||
|
|
Loading…
Reference in New Issue