From c22eca59beea843cbf8e9f58859668f72ea4aa72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ne=C4=8Das?= Date: Mon, 30 Jan 2023 12:14:26 +0100 Subject: [PATCH] ovirt_host: Add refresh MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Nečas --- changelogs/fragments/673-ovirt_host-add-refresh.yml | 3 +++ plugins/modules/ovirt_host.py | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/673-ovirt_host-add-refresh.yml diff --git a/changelogs/fragments/673-ovirt_host-add-refresh.yml b/changelogs/fragments/673-ovirt_host-add-refresh.yml new file mode 100644 index 00000000..db4043b9 --- /dev/null +++ b/changelogs/fragments/673-ovirt_host-add-refresh.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - ovirt_host - Add refreshed state (https://github.com/oVirt/ovirt-ansible-collection/pull/673). diff --git a/plugins/modules/ovirt_host.py b/plugins/modules/ovirt_host.py index 367d008f..d90c420e 100644 --- a/plugins/modules/ovirt_host.py +++ b/plugins/modules/ovirt_host.py @@ -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 @@ -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', ), @@ -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(