mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
allow server facts to be retrieved by nova UUID (#20924)
* allow server facts to be retrieved by nova UUID * update docs to state that a nova UUID can be passed to 'server'
This commit is contained in:
parent
a3099b2294
commit
776116e809
1 changed files with 2 additions and 2 deletions
|
@ -35,7 +35,7 @@ requirements:
|
|||
options:
|
||||
server:
|
||||
description:
|
||||
- restrict results to servers with names matching
|
||||
- restrict results to servers with names or UUID matching
|
||||
this glob expression (e.g., C<web*>).
|
||||
required: false
|
||||
default: None
|
||||
|
@ -92,7 +92,7 @@ def main():
|
|||
# filter servers by name
|
||||
pattern = module.params['server']
|
||||
openstack_servers = [server for server in openstack_servers
|
||||
if fnmatch.fnmatch(server['name'], pattern)]
|
||||
if fnmatch.fnmatch(server['name'], pattern) or fnmatch.fnmatch(server['id'], pattern)]
|
||||
module.exit_json(changed=False, ansible_facts=dict(
|
||||
openstack_servers=openstack_servers))
|
||||
|
||||
|
|
Loading…
Reference in a new issue