Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
Fix issues with systemd service
Browse files Browse the repository at this point in the history
  • Loading branch information
veger committed Nov 3, 2016
1 parent 56837b0 commit dd7623f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
7 changes: 5 additions & 2 deletions handlers/main.yml
@@ -1,7 +1,10 @@
- name: reload systemd configuration
command: systemctl daemon-reload

# Restart service and ensure it is enabled
- name: restart elasticsearch
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
include: ./handlers/shield/elasticsearch-shield-native.yml
Expand All @@ -14,4 +17,4 @@

- name: load-templates
include: ./handlers/elasticsearch-templates.yml
when: es_templates
when: es_templates
6 changes: 4 additions & 2 deletions tasks/elasticsearch-config.yml
Expand Up @@ -42,7 +42,9 @@
- name: Copy Systemd File for Instance
template: src=systemd/elasticsearch.j2 dest={{instance_sysd_script}} mode=0644 force=yes
when: use_system_d
notify: restart elasticsearch
notify:
- reload systemd configuration
- restart elasticsearch

#Copy the logging.yml
- name: Copy Logging.yml File for Instance
Expand All @@ -63,7 +65,7 @@
when: ansible_os_family == 'RedHat'

- 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
file: dest=/etc/elasticsearch/elasticsearch.yml state=absent
Expand Down
6 changes: 0 additions & 6 deletions tasks/elasticsearch-service.yml

This file was deleted.

3 changes: 0 additions & 3 deletions tasks/main.yml
Expand Up @@ -31,9 +31,6 @@
- include: xpack/elasticsearch-xpack.yml
tags:
- xpack
- include: elasticsearch-service.yml
tags:
- service
- include: elasticsearch-templates.yml
when: es_templates
tags:
Expand Down

0 comments on commit dd7623f

Please sign in to comment.