Merge pull request #46 from gingerwizard/master
Systemd consistent with Puppet
This commit is contained in:
commit
652217e379
2 changed files with 14 additions and 3 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -6,3 +6,4 @@
|
||||||
Converging
|
Converging
|
||||||
TODO
|
TODO
|
||||||
.idea/
|
.idea/
|
||||||
|
elasticsearch.iml
|
||||||
|
|
@ -2,10 +2,18 @@
|
||||||
|
|
||||||
# Configure Elasticsearch Node
|
# 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}}
|
- stat: path={{sysd_script}}
|
||||||
register: systemd_service
|
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}}
|
- set_fact: instance_sysd_script={{sysd_script | dirname }}/{{es_instance_name}}_{{sysd_script | basename}}
|
||||||
when: use_system_d
|
when: use_system_d
|
||||||
|
|
@ -53,11 +61,13 @@
|
||||||
- name: Copy Debian Init File for Instance
|
- name: Copy Debian Init File for Instance
|
||||||
template: src=init/debian/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes
|
template: src=init/debian/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes
|
||||||
when: ansible_os_family == 'Debian'
|
when: ansible_os_family == 'Debian'
|
||||||
|
notify: restart elasticsearch
|
||||||
|
|
||||||
#Copy the instance specific init file
|
#Copy the instance specific init file
|
||||||
- name: Copy Redhat Init File for Instance
|
- name: Copy Redhat Init File for Instance
|
||||||
template: src=init/redhat/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes
|
template: src=init/redhat/elasticsearch.j2 dest={{instance_init_script}} mode=0755 force=yes
|
||||||
when: ansible_os_family == 'RedHat'
|
when: ansible_os_family == 'RedHat'
|
||||||
|
notify: restart elasticsearch
|
||||||
|
|
||||||
#Copy the systemd specific file if systemd is installed
|
#Copy the systemd specific file if systemd is installed
|
||||||
- name: Copy Systemd File for Instance
|
- name: Copy Systemd File for Instance
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue