mirror of
https://opendev.org/openstack/ansible-collections-openstack.git
synced 2026-03-26 21:43:02 +00:00
Don't compare current state for reboot_* actions
When performing these actions a server will start `ACTIVE` and end `ACTIVE` meaning that the Ansible module skips over the host you are trying to reboot because it looks like the action was already taken. Tests are updated to reflect `changed=True` with the end state remaining as `ACTIVE` Closes-Bug: 2046429 Change-Id: I8828f05bb5402fd2ba2c26b67c727abfbcc43202
This commit is contained in:
@@ -553,7 +553,7 @@
|
|||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- servers.servers.0.status == 'ACTIVE'
|
- servers.servers.0.status == 'ACTIVE'
|
||||||
- server is not changed
|
- server is changed
|
||||||
|
|
||||||
- name: Reboot server (HARD)
|
- name: Reboot server (HARD)
|
||||||
openstack.cloud.server_action:
|
openstack.cloud.server_action:
|
||||||
@@ -573,7 +573,7 @@
|
|||||||
assert:
|
assert:
|
||||||
that:
|
that:
|
||||||
- servers.servers.0.status == 'ACTIVE'
|
- servers.servers.0.status == 'ACTIVE'
|
||||||
- server is not changed
|
- server is changed
|
||||||
|
|
||||||
- name: Delete server
|
- name: Delete server
|
||||||
openstack.cloud.server:
|
openstack.cloud.server:
|
||||||
|
|||||||
@@ -136,6 +136,9 @@ class ServerActionModule(OpenStackModule):
|
|||||||
# rebuild does not depend on state
|
# rebuild does not depend on state
|
||||||
will_change = (
|
will_change = (
|
||||||
(action == 'rebuild')
|
(action == 'rebuild')
|
||||||
|
# `reboot_*` actions do not change state, servers remain `ACTIVE`
|
||||||
|
or (action == 'reboot_hard')
|
||||||
|
or (action == 'reboot_soft')
|
||||||
or (action == 'lock' and not server['is_locked'])
|
or (action == 'lock' and not server['is_locked'])
|
||||||
or (action == 'unlock' and server['is_locked'])
|
or (action == 'unlock' and server['is_locked'])
|
||||||
or server.status.lower() not in [a.lower()
|
or server.status.lower() not in [a.lower()
|
||||||
|
|||||||
Reference in New Issue
Block a user