From 3741af19bcf09f8649ab164c2c5d7eda66a4d596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gardais=20J=C3=A9r=C3=A9my?= Date: Mon, 4 Sep 2017 16:15:42 +0200 Subject: [PATCH] Add the possibility to manage 'xymon' user's groups. --- CHANGELOG.md | 5 +++++ README.md | 2 ++ defaults/main.yml | 1 + tasks/main.yml | 8 +++++++- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de86f1c..c7d1331 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ +## v1.x + +### Features +* Add the possibility to manage 'xymon' user's groups. + ## v1.0 ### Features diff --git a/README.md b/README.md index a25b49b..3ab6dc2 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ Manage Xymon (client) installation and configuration. * **xymon_cli_default_conf_path** : Configuration file for `xymon-client` [default : `/etc/default/xymon-client`]. * **xymon_cli_default_conf_tpl** : Template used to generate the previous config file [default : `etc/default/xymon-client.j2`]. * **xymon_cli_hostname** : Allow to override default value of CLIENTHOSTNAME var [default : `{{ ansible_fqdn }}`]. +* **xymon_user_groups** : List of 'xymon' user's groups [default : `xymon`]. * **xymon_cli_service_manage** : If `xymon-client` service should be managed with this role [default : `true`]. * **xymon_cli_service_name** : `xymon-client` service name [default : `xymon-client`]. * **xymon_cli_service_enabled** : Set `xymon-client` service available at startup [default : `true`]. @@ -46,6 +47,7 @@ Please see default value by Operating System file in [vars][vars directory] dire This role will : * Install needed packages to provide `xymon-client`. * Manage `xymon-client` configuration and service. +* Add 'xymon' user to new groups. ## Development diff --git a/defaults/main.yml b/defaults/main.yml index 51d6bd6..1909ea8 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -10,6 +10,7 @@ xymon_cli_pkg_state: 'installed' xymon_cli_default_conf_path: '/etc/default/xymon-client' xymon_cli_default_conf_tpl: 'etc/default/xymon-client.j2' xymon_cli_hostname: "{{ ansible_fqdn }}" +xymon_user_groups: 'xymon' ## service xymon_cli_service_manage: true diff --git a/tasks/main.yml b/tasks/main.yml index f268d23..ea0dcdd 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -17,7 +17,7 @@ - '{{ xymon_cli_pkg_list }}' when: xymon_cli_manage -- name: CONFIG xymon-client +- name: CONFIG xymon-client service template: src: '{{ xymon_cli_default_conf_tpl }}' dest: '{{ xymon_cli_default_conf_path }}' @@ -28,6 +28,12 @@ when: xymon_cli_manage notify: restart xymon-client service +- name: CONFIG xymon user's groups + user: + name: xymon + groups: '{{ xymon_user_groups }}' + notify: restart xymon-client service + ## service - name: SERVICE manage '{{ xymon_cli_service_name }}' service: