Skip to content

Commit

Permalink
Merge pull request elastic#46 from gingerwizard/master
Browse files Browse the repository at this point in the history
Systemd consistent with Puppet
  • Loading branch information
gingerwizard committed Dec 21, 2015
2 parents 11b92f7 + d203e02 commit 652217e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
.bundle
Converging
TODO
.idea/
.idea/
elasticsearch.iml
14 changes: 12 additions & 2 deletions tasks/elasticsearch-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,18 @@

# Configure Elasticsearch Node

#This relies on elasticsearch installing a serviced script to determine whether one should be copied.
#Use systemd for the following distributions:
#
#Ubuntu 15 and up
#Debian 8 and up
#Centos 7 and up
#Relies on elasticsearch distribution installing a serviced script to determine whether one should be copied.


- stat: path={{sysd_script}}
register: systemd_service
- set_fact: use_system_d={{systemd_service.stat.exists and (not ansible_distribution == 'Debian' or ansible_distribution_version | version_compare('8', '<'))}}

- set_fact: use_system_d={{systemd_service.stat.exists and ((ansible_distribution == 'Debian' and ansible_distribution_version | version_compare('8', '>=')) or (ansible_distribution == 'CentOS' and ansible_distribution_version | version_compare('7', '>=')) or (ansible_distribution == 'Ubuntu' and ansible_distribution_version | version_compare('15', '>='))) }}

- set_fact: instance_sysd_script={{sysd_script | dirname }}/{{es_instance_name}}_{{sysd_script | basename}}
when: use_system_d
Expand Down Expand Up @@ -53,11 +61,13 @@
- name: Copy Debian Init File for Instance
template: src=init/debian/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes
when: ansible_os_family == 'Debian'
notify: restart elasticsearch

#Copy the instance specific init file
- name: Copy Redhat Init File for Instance
template: src=init/redhat/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes
when: ansible_os_family == 'RedHat'
notify: restart elasticsearch

#Copy the systemd specific file if systemd is installed
- name: Copy Systemd File for Instance
Expand Down

0 comments on commit 652217e

Please sign in to comment.