diff --git a/lib/ansible/modules/cloud/openstack/os_image.py b/lib/ansible/modules/cloud/openstack/os_image.py index de69498ff2..9df1a45cec 100644 --- a/lib/ansible/modules/cloud/openstack/os_image.py +++ b/lib/ansible/modules/cloud/openstack/os_image.py @@ -164,9 +164,11 @@ def main(): if module.params['state'] == 'present': if not image: + kwargs={} + if module.params['id'] is not None: + kwargs['id'] = module.params['id'] image = cloud.create_image( name=module.params['name'], - id=module.params['id'], filename=module.params['filename'], disk_format=module.params['disk_format'], container_format=module.params['container_format'], @@ -174,7 +176,8 @@ def main(): timeout=module.params['timeout'], is_public=module.params['is_public'], min_disk=module.params['min_disk'], - min_ram=module.params['min_ram'] + min_ram=module.params['min_ram'], + **kwargs ) changed = True if not module.params['wait']: