mirror of
https://github.com/aljazceru/ansible-elasticsearch.git
synced 2025-12-18 17:44:20 +01:00
Merge pull request #46 from gingerwizard/master
Systemd consistent with Puppet
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -6,3 +6,4 @@
|
||||
Converging
|
||||
TODO
|
||||
.idea/
|
||||
elasticsearch.iml
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user