Skip to content

Commit

Permalink
Merge pull request elastic#222 from gingerwizard/master
Browse files Browse the repository at this point in the history
Fix issues with systemd
  • Loading branch information
Dale McDiarmid committed Jan 4, 2017
2 parents 0105003 + cc60a4e commit 9d7b6aa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
5 changes: 4 additions & 1 deletion 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 (config_updated is defined and config_updated.changed) or (xpack_state.changed) or (debian_elasticsearch_install_from_repo.changed or redhat_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 (config_updated is defined and config_updated.changed) or (xpack_state.changed) or (debian_elasticsearch_install_from_repo.changed or redhat_elasticsearch_install_from_repo.changed or elasticsearch_install_from_package.changed))

- name: load-native-realms
include: ./handlers/shield/elasticsearch-shield-native.yml
Expand Down
6 changes: 4 additions & 2 deletions tasks/elasticsearch-config.yml
Expand Up @@ -43,7 +43,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 @@ -64,7 +66,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
2 changes: 1 addition & 1 deletion tasks/elasticsearch-plugins.yml
Expand Up @@ -3,7 +3,7 @@
# es_plugins_reinstall will be set to true if elasticsearch_install_from_repo.changed or elasticsearch_install_from_package.changed
# i.e. we have changed ES version(or we have clean installation of ES), or if no plugins listed. Otherwise it is false and requires explicitly setting.
- set_fact: es_plugins_reinstall=true
when: (((debian_elasticsearch_install_from_repo is defined and debian_elasticsearch_install_from_repo.changed) or (redhat_elasticsearch_install_from_repo is defined and debian_elasticsearch_install_from_repo.changed)) or (elasticsearch_install_from_package is defined and elasticsearch_install_from_package.changed)) or es_plugins is not defined or es_plugins is none
when: (((debian_elasticsearch_install_from_repo is defined and debian_elasticsearch_install_from_repo.changed) or (redhat_elasticsearch_install_from_repo is defined and redhat_elasticsearch_install_from_repo.changed)) or (elasticsearch_install_from_package is defined and elasticsearch_install_from_package.changed)) or es_plugins is not defined or es_plugins is none

- set_fact: list_command="list"

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 9d7b6aa

Please sign in to comment.