systemd unit for elasticsearch-head
This commit is contained in:
parent
9af98e7ebe
commit
2a95325dc6
|
@ -6,7 +6,7 @@
|
||||||
home: "{{ elasticsearch_plugin_head_home }}"
|
home: "{{ elasticsearch_plugin_head_home }}"
|
||||||
createhome: yes
|
createhome: yes
|
||||||
system: yes
|
system: yes
|
||||||
shell: /bin/false
|
shell: /bin/bash
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: Head repository is checked-out
|
- name: Head repository is checked-out
|
||||||
|
@ -53,3 +53,21 @@
|
||||||
- restart elasticsearch
|
- restart elasticsearch
|
||||||
tags:
|
tags:
|
||||||
- elasticsearch
|
- elasticsearch
|
||||||
|
|
||||||
|
- name: Install systemd unit
|
||||||
|
template:
|
||||||
|
src: elasticsearch-head.service.j2
|
||||||
|
dest: /etc/systemd/system/elasticsearch-head.service
|
||||||
|
tags:
|
||||||
|
- elasticsearch
|
||||||
|
- systemd
|
||||||
|
|
||||||
|
- name: Enable systemd unit
|
||||||
|
systemd:
|
||||||
|
name: elasticsearch-head
|
||||||
|
daemon_reload: yes
|
||||||
|
enabled: yes
|
||||||
|
state: started
|
||||||
|
tags:
|
||||||
|
- elasticsearch
|
||||||
|
- systemd
|
||||||
|
|
14
elasticsearch/templates/elasticsearch-head.service.j2
Normal file
14
elasticsearch/templates/elasticsearch-head.service.j2
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=/usr/bin/npm run start
|
||||||
|
User={{ elasticsearch_plugin_head_owner }}
|
||||||
|
Group={{ elasticsearch_plugin_head_group }}
|
||||||
|
StandardOutput=syslog
|
||||||
|
StandardError=syslog
|
||||||
|
SyslogIdentifier=elasticsearch-head
|
||||||
|
Restart=always
|
||||||
|
WorkingDirectory={{ elasticsearch_plugin_head_clone_dir }}
|
||||||
|
Environment=NODE_ENV=production
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
Loading…
Reference in a new issue