mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-14 01:54:21 -07:00
[PR #7998/4947786d backport][stable-8] Adds group_by_hostgroups parameter to Icinga2 inventory (#8134)
Adds group_by_hostgroups parameter to Icinga2 inventory (#7998)
* (lots of commit messages)
---------
Co-authored-by: Gianluca Salvo <gianluca.salvo@gruppomol.it>
Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 4947786d36
)
Co-authored-by: Gianluca Salvo <Gianlu@users.noreply.github.com>
This commit is contained in:
parent
dba4357b65
commit
c494fe5824
3 changed files with 19 additions and 5 deletions
|
@ -86,6 +86,8 @@ def get_option(option):
|
|||
return {}
|
||||
elif option == 'strict':
|
||||
return False
|
||||
elif option == 'group_by_hostgroups':
|
||||
return True
|
||||
else:
|
||||
return None
|
||||
|
||||
|
@ -96,6 +98,7 @@ def test_populate(inventory, mocker):
|
|||
inventory.icinga2_password = 'password'
|
||||
inventory.icinga2_url = 'https://localhost:5665' + '/v1'
|
||||
inventory.inventory_attr = "address"
|
||||
inventory.group_by_hostgroups = True
|
||||
|
||||
# bypass authentication and API fetch calls
|
||||
inventory._check_api = mocker.MagicMock(side_effect=check_api)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue