Adding ability to set 'properties' via Glance
The 'Glance' plugin lacked the ability to set properties on the images that were created via the plugin. This patch adds that ability. Change-Id: If2c73050ed8335b3a22b79bb7ce28189de046427
This commit is contained in:
parent
a72d40ef8a
commit
7d534a4e8d
@ -57,6 +57,9 @@ options:
|
|||||||
choices:
|
choices:
|
||||||
- true (public)
|
- true (public)
|
||||||
- false (private)
|
- false (private)
|
||||||
|
image_properties:
|
||||||
|
description:
|
||||||
|
- List of properties and their values
|
||||||
api_version:
|
api_version:
|
||||||
description:
|
description:
|
||||||
- which version of the glance api to use
|
- which version of the glance api to use
|
||||||
@ -85,6 +88,7 @@ EXAMPLES = """
|
|||||||
image_container_format: bare
|
image_container_format: bare
|
||||||
image_disk_format: qcow2
|
image_disk_format: qcow2
|
||||||
image_is_public: True
|
image_is_public: True
|
||||||
|
image_properties: { "os_distro": "cirros" }
|
||||||
|
|
||||||
# Get facts about existing images
|
# Get facts about existing images
|
||||||
- name: Get image facts
|
- name: Get image facts
|
||||||
@ -183,7 +187,8 @@ class ManageGlance(object):
|
|||||||
name=image_name,
|
name=image_name,
|
||||||
disk_format=p['image_disk_format'],
|
disk_format=p['image_disk_format'],
|
||||||
container_format=p['image_container_format'],
|
container_format=p['image_container_format'],
|
||||||
copy_from=p['image_url']
|
copy_from=p['image_url'],
|
||||||
|
properties=p['image_properties']
|
||||||
)
|
)
|
||||||
if v == '1':
|
if v == '1':
|
||||||
image_opts['is_public'] = p['image_is_public']
|
image_opts['is_public'] = p['image_is_public']
|
||||||
@ -223,6 +228,7 @@ def main():
|
|||||||
image_container_format=dict(required=False),
|
image_container_format=dict(required=False),
|
||||||
image_disk_format=dict(required=False),
|
image_disk_format=dict(required=False),
|
||||||
image_is_public=dict(required=False, type='bool'),
|
image_is_public=dict(required=False, type='bool'),
|
||||||
|
image_properties=dict(required=False),
|
||||||
api_version=dict(default='1', required=False, choices=['1', '2']),
|
api_version=dict(default='1', required=False, choices=['1', '2']),
|
||||||
insecure=dict(default=False, required=False, type='bool')
|
insecure=dict(default=False, required=False, type='bool')
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user