Only symlink systemd file for systemd systems
This commit is contained in:
parent
23e336833a
commit
d451d27723
6 changed files with 24 additions and 56 deletions
|
|
@ -86,29 +86,30 @@
|
|||
content: ''
|
||||
when: ansible_os_family == 'RedHat'
|
||||
|
||||
- name: Check if default systemd file exists
|
||||
stat:
|
||||
path: "{{ sysd_script }}"
|
||||
register: sysd_stat_result
|
||||
- name: Symlink default systemd service to first instance of elasticsearch
|
||||
when: use_system_d
|
||||
block:
|
||||
- name: Check if default systemd file exists
|
||||
stat:
|
||||
path: "{{ sysd_script }}"
|
||||
register: sysd_stat_result
|
||||
|
||||
- name: Remove if it is a normal file
|
||||
file:
|
||||
path: "{{ sysd_script }}"
|
||||
state: absent
|
||||
when: not sysd_stat_result.stat.islnk
|
||||
- name: Remove if it is a normal file
|
||||
file:
|
||||
path: "{{ sysd_script }}"
|
||||
state: absent
|
||||
when: not sysd_stat_result.stat.islnk
|
||||
|
||||
- name: Create a symbolic link to the default systemd location to the first instance running on this host
|
||||
become: yes
|
||||
file:
|
||||
state: link
|
||||
src: "{{ instance_sysd_script }}"
|
||||
path: "{{ sysd_script }}"
|
||||
when:
|
||||
- use_system_d
|
||||
- not sysd_stat_result.stat.islnk
|
||||
notify:
|
||||
- reload systemd configuration
|
||||
- restart elasticsearch
|
||||
- name: Create a symbolic link to the default systemd location to the first instance running on this host
|
||||
become: yes
|
||||
file:
|
||||
state: link
|
||||
src: "{{ instance_sysd_script }}"
|
||||
path: "{{ sysd_script }}"
|
||||
when: not sysd_stat_result.stat.islnk
|
||||
notify:
|
||||
- reload systemd configuration
|
||||
- restart elasticsearch
|
||||
|
||||
- name: Delete Default Configuration File
|
||||
become: yes
|
||||
|
|
|
|||
|
|
@ -125,10 +125,6 @@ shared_examples 'config::init' do |vars|
|
|||
end
|
||||
end
|
||||
|
||||
describe file('/usr/lib/systemd/system/elasticsearch.service') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/elasticsearch.yml') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
|
|
|||
|
|
@ -212,10 +212,6 @@ shared_examples 'multi::init' do |vars|
|
|||
end
|
||||
end
|
||||
|
||||
describe file('/usr/lib/systemd/system/elasticsearch.service') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/elasticsearch.yml') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
|
@ -223,18 +219,5 @@ shared_examples 'multi::init' do |vars|
|
|||
describe file('/etc/elasticsearch/logging.yml') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
|
||||
#Test server spec file has been created and modified - currently not possible as not copied for debian 8
|
||||
#describe file('/usr/lib/systemd/system/master_elasticsearch.service') do
|
||||
# it { should be_file }
|
||||
# it { should contain 'LimitMEMLOCK=infinity' }
|
||||
#end
|
||||
|
||||
#describe file('/usr/lib/systemd/system/node1_elasticsearch.service') do
|
||||
# it { should be_file }
|
||||
# it { should_not contain 'LimitMEMLOCK=infinity' }
|
||||
#end
|
||||
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -100,10 +100,6 @@ shared_examples 'package::init' do |vars|
|
|||
end
|
||||
end
|
||||
|
||||
describe file('/usr/lib/systemd/system/elasticsearch.service') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/elasticsearch.yml') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
|
|
|||
|
|
@ -68,10 +68,6 @@ shared_examples 'xpack::init' do |vars|
|
|||
end
|
||||
end
|
||||
|
||||
describe file('/usr/lib/systemd/system/elasticsearch.service') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/elasticsearch.yml') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
|
|
|||
|
|
@ -69,10 +69,6 @@ shared_examples 'xpack_standard::init' do |vars|
|
|||
end
|
||||
end
|
||||
|
||||
describe file('/usr/lib/systemd/system/elasticsearch.service') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
||||
describe file('/etc/elasticsearch/elasticsearch.yml') do
|
||||
it { should_not exist }
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue