mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-07-28 10:44:29 +00:00
Add inactive state for the images
Glance images can be deactivated ad reactivated with corresponding API calls. It might be useful for operators to be able to control these states through ansible modules as well. Instead of introduction of the new parameter we're adding new state for the image that is `inactive`. Change-Id: I0738ff564f81a31690872450a4731340ed6bbeb1
This commit is contained in:
@@ -176,6 +176,34 @@
|
||||
- image is changed
|
||||
- image.image.name == 'ansible_image-changed'
|
||||
|
||||
- name: Deactivate raw image
|
||||
openstack.cloud.image:
|
||||
cloud: "{{ cloud }}"
|
||||
state: inactive
|
||||
id: "{{ image.image.id }}"
|
||||
name: 'ansible_image-changed'
|
||||
register: image
|
||||
|
||||
- name: Assert changed
|
||||
assert:
|
||||
that:
|
||||
- image is changed
|
||||
- image.image.status == 'deactivated'
|
||||
|
||||
- name: Reactivate raw image
|
||||
openstack.cloud.image:
|
||||
cloud: "{{ cloud }}"
|
||||
state: present
|
||||
id: "{{ image.image.id }}"
|
||||
name: 'ansible_image-changed'
|
||||
register: image
|
||||
|
||||
- name: Assert changed
|
||||
assert:
|
||||
that:
|
||||
- image is changed
|
||||
- image.image.status == 'active'
|
||||
|
||||
- name: Rename back raw image (defaults)
|
||||
openstack.cloud.image:
|
||||
cloud: "{{ cloud }}"
|
||||
|
||||
Reference in New Issue
Block a user