Skip to content

Commit

Permalink
feat(bmc): add bmc_reboot_should_wait argument
Browse files Browse the repository at this point in the history
Signed-off-by: Boris Glimcher <[email protected]>
  • Loading branch information
glimchb committed Apr 16, 2024
1 parent 8fa24c1 commit 3f54ef7
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ tags: [opi, dpu, redfish, automation, devops, infrastructure]
# L(specifiers,https://python-semanticversion.readthedocs.io/en/latest/#requirement-specification). Multiple version
# range specifiers can be set and are separated by ','
dependencies: {
"community.general": ">=8.4.0",
"community.general": ">=8.6.0",
}

# The URL of the originating SCM repository
Expand Down
2 changes: 2 additions & 0 deletions roles/bmc_reboot/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
# defaults file for bmc_reboot

https_port: 443
bmc_reboot_should_wait: true
bmc_reboot_wait_timeout: 60
10 changes: 10 additions & 0 deletions roles/bmc_reboot/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ argument_specs:
description:
- DPU BMC port.
default: 443
bmc_reboot_should_wait:
description:
- Wait for the BMC to restart.
type: bool
default: true
bmc_reboot_wait_timeout:
description:
- Seconds to wait for the BMC to restart.
type: int
default: 60
12 changes: 4 additions & 8 deletions roles/bmc_reboot/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
baseuri: "{{ inventory_hostname }}"
username: "{{ dpu_bmc_username }}"
password: "{{ dpu_bmc_password }}"

- name: Pause for 60 seconds for BMC to Reboot
ansible.builtin.pause:
seconds: 60
wait: "{{ bmc_reboot_should_wait }}"
wait_timeout: "{{ bmc_reboot_wait_timeout }}"

- name: Reboot BMC when auth_token is defined
when: dpu_bmc_token is defined
Expand All @@ -42,7 +40,5 @@
command: GracefulRestart
baseuri: "{{ inventory_hostname }}"
auth_token: "{{ dpu_bmc_token }}"

- name: Pause for 60 seconds for BMC to Reboot
ansible.builtin.pause:
seconds: 60
wait: "{{ bmc_reboot_should_wait }}"
wait_timeout: "{{ bmc_reboot_wait_timeout }}"

0 comments on commit 3f54ef7

Please sign in to comment.