Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #7998/4947786d backport][stable-8] Adds group_by_hostgroups parameter to Icinga2 inventory #8134

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Mar 24, 2024

This is a backport of PR #7998 as merged into main (4947786).

SUMMARY

This PR adds an optional parameter to Icinga2 inventory group_by_hostgroups (boolean). If true, Icinga2 hostgroups are used as Ansible groups; if false the step is ignored. For backward compatibility, the default is true.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

icinga2.py inventory

ADDITIONAL INFORMATION

In my use case, I want to use Icinga2 as inventory source but my hostgroups' naming convention isn't suitable to become an ansible group strategy (spaces, capital letters and invalid characters) so I prefer to disable the builtin grouping by hostgroups and use the capabilities of constructed inventory (groups and keyed_groups).

# my.icinga2.yml
plugin: community.general.icinga2
url: http://localhost:5665
user: ansible
password: secure
host_filter: \"linux-servers\" in host.groups
validate_certs: false  # only do this when connecting to localhost!
group_by_hostgroups: false

* (lots of commit messages)

---------

Co-authored-by: Gianluca Salvo <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 4947786)
@felixfontein felixfontein merged commit c494fe5 into stable-8 Mar 24, 2024
132 checks passed
@felixfontein felixfontein deleted the patchback/backports/stable-8/4947786d3694bee0498c40b54540f67170518b70/pr-7998 branch March 24, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants