Skip to content

Commit

Permalink
Add variable for dependency repositories within monitoring_plugins ro…
Browse files Browse the repository at this point in the history
…le (#209)

* Fix #173

This commit allows for a new variable to be used.
'icinga_monitoring_plugins_dependency_repos' defaults to either 'crb' or
'powertools' but can be overriden to temporarily enable one or multiple
repositories of choice in case manual intervention is needed.

* Add note about use of wildcard for dependency repositories

* Add changelog fragment about new variable 'icinga_monitoring_plugins_dependency_repos'
  • Loading branch information
Donien authored Jan 12, 2024
1 parent 1b1412a commit ae4e337
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/fix-173-changeable-dependency-repos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- Add variable `icinga_monitoring_plugins_dependency_repos` to allow for later modification by the user if specific other repositories need to be activated instead of `powertools` / `crb`
5 changes: 5 additions & 0 deletions doc/role-monitoring_plugins/role-monitoring_plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ The list is based on the section *"Plugin Check Commands for Monitoring Plugins"
Decides whether to run the equivalent of `dnf --enablerepo crb ...` when installing the necessary packages. Default: `false`
Enabling CRB/Powertools may be necessary, depending on the plugins wanted and the repositories already enabled.

- `icinga_monitoring_plugins_dependency_repos: list`
Decides which repositories are temporarily enabled when installing packages. Defaults to either `crb` or `powertools`.
If the need arises, you can manually overwrite this variable to temporarily enable one or multiple repositories of your choice.
You may specify `icinga_monitoring_plugins_dependency_repos: "*"` to temporarily enable every repository present.

- `icinga_monitoring_plugins_remove: boolean`
Decides whether to remove packages that have not been asked for by the user. Default `true`
The requested check commands are compared against the list of available check commands. Packages not required for installation are removed.
Expand Down
2 changes: 2 additions & 0 deletions roles/monitoring_plugins/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ icinga_monitoring_plugins_epel: false
icinga_monitoring_plugins_crb: false
icinga_monitoring_plugins_remove: true
icinga_monitoring_plugins_autoremove: false
icinga_monitoring_plugins_dependency_repos:
- "{{ 'powertools' if ansible_distribution_major_version == '8' and icinga_monitoring_plugins_crb else 'crb' if ansible_distribution_major_version == '9' and icinga_monitoring_plugins_crb }}"
2 changes: 1 addition & 1 deletion roles/monitoring_plugins/tasks/install_on_RedHat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
state: present
name: "{{ needed_packages }}"
update_cache: true
enablerepo: "{{ 'powertools' if ansible_distribution_major_version == '8' and icinga_monitoring_plugins_crb else 'crb' if ansible_distribution_major_version == '9' and icinga_monitoring_plugins_crb }}"
enablerepo: "{{ icinga_monitoring_plugins_dependency_repos }}"
when:
- ansible_distribution_major_version >= "8"
- needed_packages is defined
Expand Down

0 comments on commit ae4e337

Please sign in to comment.