From 71c95412032a2cf8a8c7e2f903074e5cf2e268d2 Mon Sep 17 00:00:00 2001 From: Guillaume Raffy Date: Fri, 23 May 2025 11:35:43 +0200 Subject: [PATCH] Added support for the urls with authentication by adding personal access token variables. This feature is available for the resources `plug_sge_script`, `plug_smartoverall_script` and `plug_smart_script` Work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=4078] --- CHANGELOG.md | 6 ++++++ README.md | 3 +++ defaults/main.yml | 3 +++ tasks/main.yml | 9 +++++++++ 4 files changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 774d310..d4cc84c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## v2.3.1 + +### Enhancements +* Added support for the urls with authentication by adding personal access token variables. This feature is available for the resources `plug_sge_script`, `plug_smartoverall_script` and `plug_smart_script`. work related to [https://bugzilla.ipr.univ-rennes.fr/show_bug.cgi?id=4078] + + ## v2.3.0 ### Enhancements diff --git a/README.md b/README.md index 66b28b7..f34a25a 100644 --- a/README.md +++ b/README.md @@ -163,6 +163,7 @@ SGE jobs and host. * **xymon_cli__plug_sge_script_path** : Path to the `sge` script [default : `'/usr/lib/xymon/client/ext/sge'`]. * **xymon_cli__plug_sge_script_tpl** : Template used to generate the previous script [default : `'usr/lib/xymon/client/ext/sge.j2'`]. * **xymon_cli__plug_sge_script_url** : Use a remote file to get the previous script instead of a template [default : `''`]. +* **xymon_cli__plug_sge_script_pat** : personal access token to use with xymon_cli__plug_sge_script_url [default : `''`]. * **xymon_cli__plug_sge_path** : Configuration file for the `sge` plugin [default : `'/etc/xymon/clientlaunch.d/sge.cfg'`]. * **xymon_cli__plug_sge_tpl** : Template used to generate the previous config file [default : `'etc/xymon/clientlaunch.d/sge.cfg.j2'`]. * **xymon_cli__plug_sge_interval** : Time between each run of the `sge` plugin [default : `'10m'`] @@ -180,6 +181,7 @@ For more features, see the next Smart plugin. * **xymon_cli__plug_smartoverall_script_path** : Path to the `smartoverall` script [default : `'/usr/lib/xymon/client/ext/smartoverall'`]. * **xymon_cli__plug_smartoverall_script_tpl** : Template used to generate the previous script [default : `'usr/lib/xymon/client/ext/smartoverall.j2'`]. * **xymon_cli__plug_smartoverall_script_url** : Use a remote file to get the previous script instead of a template [default : `''`]. +* **xymon_cli__plug_smartoverall_script_pat** : personal access token to use with xymon_cli__plug_smartoverall_script_url [default : `''`]. * **xymon_cli__plug_smartoverall_path** : Configuration file for the `smartoverall` plugin [default : `'/etc/xymon/clientlaunch.d/smartoverall.cfg'`]. * **xymon_cli__plug_smartoverall_tpl** : Template used to generate the previous config file [default : `'etc/xymon/clientlaunch.d/smartoverall.cfg.j2'`]. * **xymon_cli__plug_smartoverall_interval** : Time between each run of the `smartoverall` plugin [default : `'10m'`] @@ -195,6 +197,7 @@ one's recommended by the vendor and check a recent (<24h) test was done. * **xymon_cli__plug_smart_script_path** : Path to the `smart` script [default : `'/usr/lib/xymon/client/ext/smart'`]. * **xymon_cli__plug_smart_script_tpl** : Template used to generate the previous script [default : `'usr/lib/xymon/client/ext/smart.j2'`]. * **xymon_cli__plug_smart_script_url** : Use a remote file to get the previous script instead of a template [default : `''`]. +* **xymon_cli__plug_smart_script_pat** : personal access token to use with xymon_cli__plug_smart_script_url [default : `''`]. * **xymon_cli__plug_smart_path** : Configuration file for the `smart` plugin [default : `'/etc/xymon/clientlaunch.d/smart.cfg'`]. * **xymon_cli__plug_smart_tpl** : Template used to generate the previous config file [default : `'etc/xymon/clientlaunch.d/smart.cfg.j2'`]. * **xymon_cli__plug_smart_interval** : Time between each run of the `smart` plugin [default : `'10m'`] diff --git a/defaults/main.yml b/defaults/main.yml index 8564c0b..10ef80a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -166,6 +166,7 @@ xymon_cli__plug_sge_state: False xymon_cli__plug_sge_script_path: '/usr/lib/xymon/client/ext/sge.sh' xymon_cli__plug_sge_script_tpl: 'usr/lib/xymon/client/ext/sge.sh.j2' xymon_cli__plug_sge_script_url: '' +xymon_cli__plug_sge_script_pat: '' xymon_cli__plug_sge_path: '/etc/xymon/clientlaunch.d/sge.cfg' xymon_cli__plug_sge_tpl: 'etc/xymon/clientlaunch.d/sge.cfg.j2' xymon_cli__plug_sge_interval: '5m' @@ -180,6 +181,7 @@ xymon_cli__plug_smartoverall_package: [ 'smartmontools' ] xymon_cli__plug_smartoverall_script_path: '/usr/lib/xymon/client/ext/smartoverall' xymon_cli__plug_smartoverall_script_tpl: 'usr/lib/xymon/client/ext/smartoverall.j2' xymon_cli__plug_smartoverall_script_url: '' +xymon_cli__plug_smartoverall_script_pat: '' xymon_cli__plug_smartoverall_path: '/etc/xymon/clientlaunch.d/smartoverall.cfg' xymon_cli__plug_smartoverall_tpl: 'etc/xymon/clientlaunch.d/smartoverall.cfg.j2' xymon_cli__plug_smartoverall_interval: '10m' @@ -192,6 +194,7 @@ xymon_cli__plug_smart_package: [ 'smartmontools' ] xymon_cli__plug_smart_script_path: '/usr/lib/xymon/client/ext/smart' xymon_cli__plug_smart_script_tpl: 'usr/lib/xymon/client/ext/smart.j2' xymon_cli__plug_smart_script_url: '' +xymon_cli__plug_smart_script_pat: '' xymon_cli__plug_smart_path: '/etc/xymon/clientlaunch.d/smart.cfg' xymon_cli__plug_smart_tpl: 'etc/xymon/clientlaunch.d/smart.cfg.j2' xymon_cli__plug_smart_interval: '10m' diff --git a/tasks/main.yml b/tasks/main.yml index 41cb385..709fe94 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -139,6 +139,9 @@ ansible.builtin.get_url: url: '{{ xymon_cli__plug_sge_script_url }}' dest: '{{ xymon_cli__plug_sge_script_path }}' + headers: + Content-Type: application/json + Authorization: 'Bearer {{ xymon_cli__plug_sge_script_pat }}' owner: root group: xymon mode: 0755 @@ -164,6 +167,9 @@ ansible.builtin.get_url: url: '{{ xymon_cli__plug_smartoverall_script_url }}' dest: '{{ xymon_cli__plug_smartoverall_script_path }}' + headers: + Content-Type: application/json + Authorization: 'Bearer {{ xymon_cli__plug_smartoverall_script_pat }}' owner: root group: xymon mode: 0755 @@ -189,6 +195,9 @@ ansible.builtin.get_url: url: '{{ xymon_cli__plug_smart_script_url }}' dest: '{{ xymon_cli__plug_smart_script_path }}' + headers: + Content-Type: application/json + Authorization: 'Bearer {{ xymon_cli__plug_smart_script_pat }}' owner: root group: xymon mode: 0755