mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-05-08 14:23:03 +00:00
add option to exclude legacy groups
Change-Id: I73835b111b1bdfc0d8dd6409d516ad1cb84c658a
This commit is contained in:
@@ -98,6 +98,10 @@ options:
|
|||||||
description: Add hosts to group based on Jinja2 conditionals.
|
description: Add hosts to group based on Jinja2 conditionals.
|
||||||
type: dictionary
|
type: dictionary
|
||||||
default: {}
|
default: {}
|
||||||
|
legacy_groups:
|
||||||
|
description: Automatically create groups from host variables.
|
||||||
|
type: bool
|
||||||
|
default: true
|
||||||
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- inventory_cache
|
- inventory_cache
|
||||||
@@ -361,8 +365,9 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable):
|
|||||||
openstack=server)
|
openstack=server)
|
||||||
self.inventory.add_host(current_host)
|
self.inventory.add_host(current_host)
|
||||||
|
|
||||||
for group in self._get_groups_from_server(server, namegroup=namegroup):
|
if self.get_option('legacy_groups'):
|
||||||
groups[group].append(current_host)
|
for group in self._get_groups_from_server(server, namegroup=namegroup):
|
||||||
|
groups[group].append(current_host)
|
||||||
|
|
||||||
def verify_file(self, path):
|
def verify_file(self, path):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user