systemd unit for elasticsearch-head
This commit is contained in:
parent
9af98e7ebe
commit
2a95325dc6
|
@ -6,7 +6,7 @@
|
|||
home: "{{ elasticsearch_plugin_head_home }}"
|
||||
createhome: yes
|
||||
system: yes
|
||||
shell: /bin/false
|
||||
shell: /bin/bash
|
||||
|
||||
- block:
|
||||
- name: Head repository is checked-out
|
||||
|
@ -53,3 +53,21 @@
|
|||
- restart elasticsearch
|
||||
tags:
|
||||
- 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
|
||||
|
|
|
@ -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 New Issue