Fix issues with systemd service
This commit is contained in:
parent
56837b0627
commit
dd7623fffe
4 changed files with 9 additions and 13 deletions
|
|
@ -1,7 +1,10 @@
|
||||||
|
- name: reload systemd configuration
|
||||||
|
command: systemctl daemon-reload
|
||||||
|
|
||||||
|
# Restart service and ensure it is enabled
|
||||||
- name: restart elasticsearch
|
- name: restart elasticsearch
|
||||||
service: name={{instance_init_script | basename}} state=restarted enabled=yes
|
service: name={{instance_init_script | basename}} state=restarted enabled=yes
|
||||||
when: es_restart_on_change and es_start_service and not elasticsearch_started.changed and ((plugin_installed is defined and plugin_installed.changed) or (xpack_state.changed) or (elasticsearch_install_from_repo.changed or elasticsearch_install_from_package.changed))
|
when: es_restart_on_change and es_start_service and ((plugin_installed is defined and plugin_installed.changed) or (xpack_state.changed) or (elasticsearch_install_from_repo.changed or elasticsearch_install_from_package.changed))
|
||||||
|
|
||||||
- name: load-native-realms
|
- name: load-native-realms
|
||||||
include: ./handlers/shield/elasticsearch-shield-native.yml
|
include: ./handlers/shield/elasticsearch-shield-native.yml
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,9 @@
|
||||||
- name: Copy Systemd File for Instance
|
- name: Copy Systemd File for Instance
|
||||||
template: src=systemd/elasticsearch.j2 dest={{instance_sysd_script}} mode=0644 force=yes
|
template: src=systemd/elasticsearch.j2 dest={{instance_sysd_script}} mode=0644 force=yes
|
||||||
when: use_system_d
|
when: use_system_d
|
||||||
notify: restart elasticsearch
|
notify:
|
||||||
|
- reload systemd configuration
|
||||||
|
- restart elasticsearch
|
||||||
|
|
||||||
#Copy the logging.yml
|
#Copy the logging.yml
|
||||||
- name: Copy Logging.yml File for Instance
|
- name: Copy Logging.yml File for Instance
|
||||||
|
|
@ -63,7 +65,7 @@
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_os_family == 'RedHat'
|
||||||
|
|
||||||
- name: Delete Default Sysconfig File
|
- name: Delete Default Sysconfig File
|
||||||
file: dest=/usr/lib/systemd/system/elasticsearch.service state=absent
|
file: dest="{{ sysd_script }}" state=absent
|
||||||
|
|
||||||
- name: Delete Default Configuration File
|
- name: Delete Default Configuration File
|
||||||
file: dest=/etc/elasticsearch/elasticsearch.yml state=absent
|
file: dest=/etc/elasticsearch/elasticsearch.yml state=absent
|
||||||
|
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
# Make sure the service is started, and restart if necessary
|
|
||||||
- name: Start elasticsearch service
|
|
||||||
service: name={{instance_init_script | basename}} state=started enabled=yes
|
|
||||||
when: es_start_service
|
|
||||||
register: elasticsearch_started
|
|
||||||
|
|
||||||
|
|
@ -31,9 +31,6 @@
|
||||||
- include: xpack/elasticsearch-xpack.yml
|
- include: xpack/elasticsearch-xpack.yml
|
||||||
tags:
|
tags:
|
||||||
- xpack
|
- xpack
|
||||||
- include: elasticsearch-service.yml
|
|
||||||
tags:
|
|
||||||
- service
|
|
||||||
- include: elasticsearch-templates.yml
|
- include: elasticsearch-templates.yml
|
||||||
when: es_templates
|
when: es_templates
|
||||||
tags:
|
tags:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue