diff options
author | Bill Dodd <billdodd@gmail.com> | 2019-05-02 07:50:41 -0500 |
---|---|---|
committer | John R Barker <john@johnrbarker.com> | 2019-05-02 13:50:41 +0100 |
commit | 2614e823dfdc8dc8e317678a50768d56b40b03c6 (patch) | |
tree | 890d5e449ec42b0c87d7aae154f0976f8197cca3 /lib/ansible/modules/remote_management | |
parent | eb7190264eef1fcd52bf46aa128a4e3e58f46017 (diff) | |
download | ansible-2614e823dfdc8dc8e317678a50768d56b40b03c6.tar.gz |
Fix SetOneTimeBoot to use standard ComputerSystem 'Boot' property (#54201)
* fix SetOneTimeBoot to use standard ComputerSystem 'Boot' property
* add support for UefiTarget and UefiBootNext boot sources
Diffstat (limited to 'lib/ansible/modules/remote_management')
-rw-r--r-- | lib/ansible/modules/remote_management/redfish/redfish_command.py | 42 |
1 files changed, 39 insertions, 3 deletions
diff --git a/lib/ansible/modules/remote_management/redfish/redfish_command.py b/lib/ansible/modules/remote_management/redfish/redfish_command.py index 498a0e5978..9b9d8d027f 100644 --- a/lib/ansible/modules/remote_management/redfish/redfish_command.py +++ b/lib/ansible/modules/remote_management/redfish/redfish_command.py @@ -74,6 +74,16 @@ options: default: 10 type: int version_added: '2.8' + uefi_target: + required: false + description: + - UEFI target when bootdevice is "UefiTarget" + version_added: "2.9" + boot_next: + required: false + description: + - BootNext target when bootdevice is "UefiBootNext" + version_added: "2.9" author: "Jose Delarosa (@jose-delarosa)" ''' @@ -96,6 +106,26 @@ EXAMPLES = ''' username: "{{ username }}" password: "{{ password }}" + - name: Set one-time boot device to UefiTarget of "/0x31/0x33/0x01/0x01" + redfish_command: + category: Systems + command: SetOneTimeBoot + bootdevice: "UefiTarget" + uefi_target: "/0x31/0x33/0x01/0x01" + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + + - name: Set one-time boot device to BootNext target of "Boot0001" + redfish_command: + category: Systems + command: SetOneTimeBoot + bootdevice: "UefiBootNext" + boot_next: "Boot0001" + baseuri: "{{ baseuri }}" + username: "{{ username }}" + password: "{{ password }}" + - name: Set chassis indicator LED to blink redfish_command: category: Chassis @@ -183,7 +213,9 @@ def main(): new_password=dict(no_log=True), roleid=dict(), bootdevice=dict(), - timeout=dict(type='int', default=10) + timeout=dict(type='int', default=10), + uefi_target=dict(), + boot_next=dict() ), supports_check_mode=False ) @@ -248,7 +280,10 @@ def main(): if "Power" in command: result = rf_utils.manage_system_power(command) elif command == "SetOneTimeBoot": - result = rf_utils.set_one_time_boot_device(module.params['bootdevice']) + result = rf_utils.set_one_time_boot_device( + module.params['bootdevice'], + module.params['uefi_target'], + module.params['boot_next']) elif category == "Chassis": result = rf_utils._find_chassis_resource(rf_uri) @@ -283,7 +318,8 @@ def main(): # Return data back or fail with proper message if result['ret'] is True: del result['ret'] - module.exit_json(changed=True, msg='Action was successful') + changed = result.get('changed', True) + module.exit_json(changed=changed, msg='Action was successful') else: module.fail_json(msg=to_native(result['msg'])) |