Apply configuration according the desired state
This commit is contained in:
parent
23172f64e9
commit
2cbad0b42b
|
@ -12,7 +12,6 @@
|
||||||
with_flattened:
|
with_flattened:
|
||||||
- '{{ netdata__base_packages }}'
|
- '{{ netdata__base_packages }}'
|
||||||
|
|
||||||
|
|
||||||
# Server Manage /etc configuration files [[[1
|
# Server Manage /etc configuration files [[[1
|
||||||
- name: Ensure Netdata directory structure exists
|
- name: Ensure Netdata directory structure exists
|
||||||
file:
|
file:
|
||||||
|
@ -22,7 +21,7 @@
|
||||||
group: 'netdata'
|
group: 'netdata'
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
with_filetree: '{{ netdata__etc_src }}'
|
with_filetree: '{{ netdata__etc_src }}'
|
||||||
when: item.state == 'directory'
|
when: (item.state == 'directory') and (netdata__deploy_state == "present")
|
||||||
notify: ['Restart Netdata service']
|
notify: ['Restart Netdata service']
|
||||||
|
|
||||||
- name: Generate Netdata configuration files
|
- name: Generate Netdata configuration files
|
||||||
|
@ -33,7 +32,7 @@
|
||||||
group: 'netdata'
|
group: 'netdata'
|
||||||
mode: '{{ item.mode }}'
|
mode: '{{ item.mode }}'
|
||||||
with_filetree: '{{ netdata__etc_src }}'
|
with_filetree: '{{ netdata__etc_src }}'
|
||||||
when: item.state == 'file'
|
when: (item.state == 'file') and (netdata__deploy_state == "present")
|
||||||
notify: ['Restart Netdata service']
|
notify: ['Restart Netdata service']
|
||||||
|
|
||||||
- name: Generate Netdata configuration symlinks
|
- name: Generate Netdata configuration symlinks
|
||||||
|
@ -43,5 +42,5 @@
|
||||||
state: 'link'
|
state: 'link'
|
||||||
force: true
|
force: true
|
||||||
with_filetree: '{{ netdata__etc_src }}'
|
with_filetree: '{{ netdata__etc_src }}'
|
||||||
when: item.state == 'link'
|
when: (item.state == 'link') and (netdata__deploy_state == "present")
|
||||||
notify: ['Restart Netdata service']
|
notify: ['Restart Netdata service']
|
||||||
|
|
Loading…
Reference in New Issue