mirror of
https://github.com/ansible/awx.git
synced 2026-01-16 12:20:45 -03:30
Implement vmware plugin host filtering
This commit is contained in:
parent
84d863ff9d
commit
e2f5aa987d
@ -2320,8 +2320,12 @@ class vmware(PluginFileInjector):
|
||||
|
||||
host_filters = vmware_opts.get('host_filters')
|
||||
if host_filters:
|
||||
pass
|
||||
# ret['resources'] = host_filters.split(',') # does not follow same pattern
|
||||
ret.setdefault('host_filters', [])
|
||||
for hf in host_filters.split(','):
|
||||
striped_hf = hf.replace('{', '').replace('}', '').strip() # make best effort
|
||||
if not striped_hf:
|
||||
continue
|
||||
ret['host_filters'].append(striped_hf)
|
||||
|
||||
groupby_patterns = vmware_opts.get('groupby_patterns')
|
||||
if groupby_patterns:
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
host_filters:
|
||||
- config.name == "only_my_server"
|
||||
- somevar == "bar"
|
||||
keyed_groups:
|
||||
- key: fouo
|
||||
prefix: ''
|
||||
|
||||
@ -5,6 +5,6 @@ username = fooo
|
||||
password = fooo
|
||||
server = https://foo.invalid
|
||||
base_source_var = value_of_var
|
||||
host_filters = foobaa
|
||||
host_filters = {{ config.name == "only_my_server" }},{{ somevar == "bar"}}
|
||||
groupby_patterns = fouo
|
||||
|
||||
|
||||
@ -16,7 +16,7 @@ DATA = os.path.join(os.path.dirname(data.__file__), 'inventory')
|
||||
|
||||
TEST_SOURCE_FIELDS = {
|
||||
'vmware': {
|
||||
'instance_filters': 'foobaa',
|
||||
'instance_filters': '{{ config.name == "only_my_server" }},{{ somevar == "bar"}}',
|
||||
'group_by': 'fouo'
|
||||
},
|
||||
'ec2': {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user