Add possibility to install `apt` plugin dependencies

This commit is contained in:
Jeremy Gardais 2018-03-02 15:15:11 +01:00
parent a921a724e0
commit 7112f38723
5 changed files with 41 additions and 2 deletions

View File

@ -3,12 +3,13 @@
## 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.
## v1.1 ## v1.1
## Enhancements ## Enhancements
* Add possibility to install `mq` dependancies. * Add possibility to install `mq` plugin dependencies.
* Add possibility to install `libs` dependancies. * Add possibility to install `libs` plugin dependencies.
* Add whitelist settings for `libs` plugin. * Add whitelist settings for `libs` plugin.
## v1.0.1 ## v1.0.1

View File

@ -27,6 +27,10 @@ Manage Xymon (client) installation and configuration.
* **xymon_cli_service_enabled**: Set `xymon-client` service available at startup [default: `true`]. * **xymon_cli_service_enabled**: Set `xymon-client` service available at startup [default: `true`].
* **xymon_srv_list**: The list of Xymon servers (you must give an hostname, IP,… reachable from any clients) [defaults: `monitoring.{{ ansible_domain }}`]. * **xymon_srv_list**: The list of Xymon servers (you must give an hostname, IP,… reachable from any clients) [defaults: `monitoring.{{ ansible_domain }}`].
* **xymon_plug_manage**: If this role should manage plugins configuration [default: `true`]. * **xymon_plug_manage**: If this role should manage plugins configuration [default: `true`].
* **xymon_plug_apt_state**: The state of plugin `apt` [default: `true`].
* **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_mq_state**: The state of plugin `mq` [default: `true`]. * **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_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`]. * **xymon_plug_mq_path**: Configuration file for the `mq` plugin [default: `/etc/xymon/clientlaunch.d/mq.cfg`].
@ -65,6 +69,7 @@ This role will:
## Plugins ## Plugins
Some plugins and options can be managed with this role: Some plugins and options can be managed with this role:
* apt: Check state of packages and repositories.
* libs: Check for running processes with upgraded libraries. * libs: Check for running processes with upgraded libraries.
* mq: Check mail queue. * mq: Check mail queue.

View File

@ -23,6 +23,14 @@ xymon_srv_list: "monitoring.{{ ansible_domain }}"
# plugins {{{ # plugins {{{
xymon_plug_manage: true xymon_plug_manage: true
## apt {{{
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'
## }}}
## mq {{{ ## mq {{{
xymon_plug_mq_state: true xymon_plug_mq_state: true
xymon_plug_mq_package: [ 'libtimedate-perl' ] xymon_plug_mq_package: [ 'libtimedate-perl' ]

View File

@ -45,6 +45,25 @@
# }}} # }}}
# plugins {{{ # plugins {{{
- name: PLUGIN apt packages
package:
name: '{{ item }}'
state: '{{ "present" if xymon_plug_apt_state else "absent" }}'
with_items:
- '{{ xymon_plug_apt_package }}'
when: xymon_plug_manage
notify: restart xymon-client service
- name: PLUGIN apt
template:
src: '{{ xymon_plug_apt_tpl }}'
dest: '{{ xymon_plug_apt_path }}'
owner: root
group: root
mode: 0644
when: xymon_plug_manage
notify: restart xymon-client service
- name: PLUGIN mq packages - name: PLUGIN mq packages
package: package:
name: '{{ item }}' name: '{{ item }}'

View File

@ -0,0 +1,6 @@
[apt]
{{ '#DISABLED' if xymon_plug_apt_state else 'DISABLED' }}
ENVFILE /etc/xymon/xymonclient.cfg
CMD $XYMONCLIENTHOME/ext/apt
LOGFILE /var/log/xymon/xymonclient.log
INTERVAL 5m