Systemd changes

This commit is contained in:
Dale McDiarmid 2015-12-21 13:27:45 +00:00
parent 4bea3e713b
commit dc91b70081
2 changed files with 14 additions and 3 deletions

1
.gitignore vendored
View file

@ -6,3 +6,4 @@
Converging
TODO
.idea/
elasticsearch.iml

View file

@ -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
@ -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