Skip to content

Commit

Permalink
ovirt_host: Add refresh (#673)
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Nečas <necas.marty@gmail.com>
  • Loading branch information
mnecas authored Feb 14, 2023
1 parent d90bf40 commit 6bfce01
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/673-ovirt_host-add-refresh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- ovirt_host - Add refreshed state (https://github.com/oVirt/ovirt-ansible-collection/pull/673).
11 changes: 9 additions & 2 deletions plugins/modules/ovirt_host.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@
description:
- "State which should a host to be in after successful completion."
- "I(iscsilogin) and I(iscsidiscover) are supported since version 2.4."
- "I(refreshed) is supported since 3.1.0"
choices: [
'present', 'absent', 'maintenance', 'upgraded', 'started',
'restarted', 'stopped', 'reinstalled', 'iscsidiscover', 'iscsilogin'
'restarted', 'stopped', 'reinstalled', 'iscsidiscover', 'iscsilogin',
'refreshed'
]
default: present
type: str
Expand Down Expand Up @@ -493,7 +495,8 @@ def main():
state=dict(
choices=[
'present', 'absent', 'maintenance', 'upgraded', 'started',
'restarted', 'stopped', 'reinstalled', 'iscsidiscover', 'iscsilogin'
'restarted', 'stopped', 'reinstalled', 'iscsidiscover', 'iscsilogin',
'refreshed'
],
default='present',
),
Expand Down Expand Up @@ -711,6 +714,10 @@ def main():
fail_condition=hosts_module.failed_state_after_reinstall,
fence_type='restart',
)
elif state == 'refreshed':
ret = hosts_module.action(
action='refreshed',
)
elif state == 'reinstalled':
# Deactivate host if not in maintanence:
hosts_module.action(
Expand Down

0 comments on commit 6bfce01

Please sign in to comment.