From 6403124985aea35eca743f144326e8f66a364694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Wed, 12 Sep 2018 10:25:31 +0200 Subject: [PATCH] Possibility to allow some pkgs not from repos For apt probe. --- CHANGELOG.md | 1 + README.md | 4 ++++ defaults/main.yml | 9 +++++++++ tasks/main.yml | 11 +++++++++++ templates/etc/xymon/apt_no_repo_accept.j2 | 4 ++++ 5 files changed, 29 insertions(+) create mode 100644 templates/etc/xymon/apt_no_repo_accept.j2 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fe37f5..13d830d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ### Enhancements * Add IPMI probe. +* Add possibility to allow some packages not installed from repos for apt probe. ### Fix * Deprecation warning about "installed" for state. diff --git a/README.md b/README.md index 3ab1ea3..d0dd26d 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,10 @@ Manage Xymon (client) installation and configuration. * **xymon_plug_apt_package** : The packages to install to provide `apt` plugin [default : `[ 'libtimedate-perl' ]`]. * **xymon_plug_apt_path** : Configuration file for the `apt` plugin [default : `/etc/xymon/clientlaunch.d/apt.cfg`]. * **xymon_plug_apt_tpl** : Template used to generate the previous config file [default : `etc/xymon/clientlaunch.d/apt.cfg.j2`]. +* **xymon_plug_apt_default_whitelist: Default list of allowed packages not installed from repositories [default : `[]`]. +* **xymon_plug_apt_whitelist: All hosts list of allowed packages not installed from repositories [default : `[]`]. +* **xymon_plug_apt_group_whitelist: Group list of allowed packages not installed from repositories [default : `[]`]. +* **xymon_plug_apt_host_whitelist: Host list of allowed packages not installed from repositories [default : `[]`]. * **xymon_plug_mq_state** : The state of plugin `mq` [default : `true`]. * **xymon_plug_mq_package** : The packages to install to provide `mq` plugin [default : `[ 'libtimedate-perl' ]`]. * **xymon_plug_mq_path** : Configuration file for the `mq` plugin [default : `/etc/xymon/clientlaunch.d/mq.cfg`]. diff --git a/defaults/main.yml b/defaults/main.yml index 6e6b40b..9f49b54 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -53,6 +53,15 @@ xymon_plug_apt_state: true xymon_plug_apt_package: ['dctrl-tools'] xymon_plug_apt_path: '/etc/xymon/clientlaunch.d/apt.cfg' xymon_plug_apt_tpl: 'etc/xymon/clientlaunch.d/apt.cfg.j2' +xymon_plug_apt_default_whitelist: [] +xymon_plug_apt_whitelist: [] +xymon_plug_apt_group_whitelist: [] +xymon_plug_apt_host_whitelist: [] +xymon_plug_apt_combined_whitelist: '{{ xymon_plug_apt_default_whitelist + + xymon_plug_apt_whitelist + + xymon_plug_apt_group_whitelist + + xymon_plug_apt_host_whitelist }}' + ## ]]] ## Plugin mq [[[ xymon_plug_mq_state: true diff --git a/tasks/main.yml b/tasks/main.yml index 0bf8515..52eba29 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -70,6 +70,17 @@ xymon_plug_manage|bool) notify: restart xymon-client service +- name: PLUGIN apt no_repo_accept whitelist + template: + src: 'etc/xymon/apt_no_repo_accept.j2' + dest: '/etc/xymon/apt_no_repo_accept' + owner: root + group: root + mode: 0644 + when: (xymon_cli_manage|bool and + xymon_plug_manage|bool) + notify: restart xymon-client service + # Manage mq plugin [[[1 - name: PLUGIN mq packages package: diff --git a/templates/etc/xymon/apt_no_repo_accept.j2 b/templates/etc/xymon/apt_no_repo_accept.j2 new file mode 100644 index 0000000..6386dee --- /dev/null +++ b/templates/etc/xymon/apt_no_repo_accept.j2 @@ -0,0 +1,4 @@ +# {{ ansible_managed }} +{% for package in xymon_plug_apt_combined_whitelist %} +{{ package }} +{% endfor %}