From d45ceb3a4f5101e07df3c11e846488d61af072c7 Mon Sep 17 00:00:00 2001 From: Ondra Machacek Date: Thu, 8 Mar 2018 12:07:03 +0100 Subject: [PATCH] ovirt_hosts: Add option to choose to reboot the host (#35956) --- lib/ansible/modules/cloud/ovirt/ovirt_hosts.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_hosts.py b/lib/ansible/modules/cloud/ovirt/ovirt_hosts.py index bb2dfcb405..c66c6cf7d7 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_hosts.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_hosts.py @@ -129,6 +129,11 @@ options: action before executing upgrade action." default: True version_added: 2.4 + reboot_after_upgrade: + description: + - "If I(true) and C(state) is I(upgraded) reboot host after successful upgrade." + default: True + version_added: 2.6 extends_documentation_fragment: ovirt ''' @@ -412,6 +417,7 @@ def main(): activate=dict(default=True, type='bool'), iscsi=dict(default=None, type='dict'), check_upgrade=dict(default=True, type='bool'), + reboot_after_upgrade=dict(default=True, type='bool'), ) module = AnsibleModule( argument_spec=argument_spec, @@ -497,6 +503,7 @@ def main(): wait_condition=lambda h: h.status == result_state, post_action=lambda h: time.sleep(module.params['poll_interval']), fail_condition=hosts_module.failed_state_after_reinstall, + reboot=module.params['reboot_after_upgrade'], ) elif state == 'iscsidiscover': host_id = get_id_by_name(hosts_service, module.params['name'])