From 776116e80911f576779051dfd7c6ab514d65f734 Mon Sep 17 00:00:00 2001 From: Dave Buckley Date: Thu, 23 Feb 2017 19:34:46 +0000 Subject: [PATCH] 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' --- lib/ansible/modules/cloud/openstack/os_server_facts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/openstack/os_server_facts.py b/lib/ansible/modules/cloud/openstack/os_server_facts.py index 460b233914b..cc6246ad313 100644 --- a/lib/ansible/modules/cloud/openstack/os_server_facts.py +++ b/lib/ansible/modules/cloud/openstack/os_server_facts.py @@ -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). 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))