Ensure to apply the config only if wanted

This commit is contained in:
Jeremy Gardais 2018-05-16 14:45:18 +02:00
parent 7112f38723
commit 9b7c3b9003
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
2 changed files with 20 additions and 10 deletions

View File

@ -4,6 +4,7 @@
## Enhancements ## Enhancements
* Ensure to not override groups of 'xymon' user. * Ensure to not override groups of 'xymon' user.
* Add possibility to install `apt` plugin dependencies. * Add possibility to install `apt` plugin dependencies.
* Ensure to apply the config only if wanted.
## v1.1 ## v1.1

View File

@ -15,7 +15,7 @@
state: '{{ xymon_cli_pkg_state }}' state: '{{ xymon_cli_pkg_state }}'
with_items: with_items:
- '{{ xymon_cli_pkg_list }}' - '{{ xymon_cli_pkg_list }}'
when: xymon_cli_manage when: xymon_cli_manage|bool
- name: CONFIG xymon-client service - name: CONFIG xymon-client service
template: template:
@ -25,7 +25,7 @@
group: root group: root
mode: 0644 mode: 0644
backup: true backup: true
when: xymon_cli_manage when: xymon_cli_manage|bool
notify: restart xymon-client service notify: restart xymon-client service
- name: CONFIG xymon user's groups - name: CONFIG xymon user's groups
@ -33,6 +33,7 @@
name: xymon name: xymon
groups: '{{ xymon_user_groups }}' groups: '{{ xymon_user_groups }}'
append: True append: True
when: xymon_cli_manage|bool
notify: restart xymon-client service notify: restart xymon-client service
## service ## service
@ -41,7 +42,8 @@
name: '{{ xymon_cli_service_name }}' name: '{{ xymon_cli_service_name }}'
state: started state: started
enabled: '{{ xymon_cli_service_enabled }}' enabled: '{{ xymon_cli_service_enabled }}'
when: xymon_cli_service_manage when: (xymon_cli_manage|bool and
xymon_cli_service_manage|bool)
# }}} # }}}
# plugins {{{ # plugins {{{
@ -51,7 +53,8 @@
state: '{{ "present" if xymon_plug_apt_state else "absent" }}' state: '{{ "present" if xymon_plug_apt_state else "absent" }}'
with_items: with_items:
- '{{ xymon_plug_apt_package }}' - '{{ xymon_plug_apt_package }}'
when: xymon_plug_manage when: (xymon_cli_manage|bool and
xymon_plug_manage|bool)
notify: restart xymon-client service notify: restart xymon-client service
- name: PLUGIN apt - name: PLUGIN apt
@ -61,7 +64,8 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
when: xymon_plug_manage when: (xymon_cli_manage|bool and
xymon_plug_manage|bool)
notify: restart xymon-client service notify: restart xymon-client service
- name: PLUGIN mq packages - name: PLUGIN mq packages
@ -70,7 +74,8 @@
state: '{{ "present" if xymon_plug_mq_state else "absent" }}' state: '{{ "present" if xymon_plug_mq_state else "absent" }}'
with_items: with_items:
- '{{ xymon_plug_mq_package }}' - '{{ xymon_plug_mq_package }}'
when: xymon_plug_manage when: (xymon_cli_manage|bool and
xymon_plug_manage|bool)
notify: restart xymon-client service notify: restart xymon-client service
- name: PLUGIN mq - name: PLUGIN mq
@ -80,7 +85,8 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
when: xymon_plug_manage when: (xymon_cli_manage|bool and
xymon_plug_manage|bool)
notify: restart xymon-client service notify: restart xymon-client service
- name: PLUGIN libs packages - name: PLUGIN libs packages
@ -89,7 +95,8 @@
state: '{{ "present" if xymon_plug_libs_state else "absent" }}' state: '{{ "present" if xymon_plug_libs_state else "absent" }}'
with_items: with_items:
- '{{ xymon_plug_libs_package }}' - '{{ xymon_plug_libs_package }}'
when: xymon_plug_manage when: (xymon_cli_manage|bool and
xymon_plug_manage|bool)
notify: restart xymon-client service notify: restart xymon-client service
- name: PLUGIN libs - name: PLUGIN libs
@ -99,7 +106,8 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
when: xymon_plug_manage when: (xymon_cli_manage|bool and
xymon_plug_manage|bool)
notify: restart xymon-client service notify: restart xymon-client service
- name: PLUGIN libs whitelist - name: PLUGIN libs whitelist
@ -109,7 +117,8 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
when: xymon_plug_manage when: (xymon_cli_manage|bool and
xymon_plug_manage|bool)
notify: restart xymon-client service notify: restart xymon-client service
# }}} # }}}