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 Jun 3, 2024
1 parent eac057a commit b80cd09
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 9 deletions.
86 changes: 86 additions & 0 deletions docs/bmc_reboot_role.rst
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,92 @@ Parameters
Security token for authentication with DPU BMC.


.. raw:: html

</div>

* - .. raw:: html

<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--bmc_reboot_should_wait"></div>

.. _ansible_collections.opiproject.dpu.bmc_reboot_role__parameter-main__bmc_reboot_should_wait:

.. rst-class:: ansible-option-title

**bmc_reboot_should_wait**

.. raw:: html

<a class="ansibleOptionLink" href="#parameter-main--bmc_reboot_should_wait" title="Permalink to this option"></a>

.. ansible-option-type-line::

:ansible-option-type:`boolean`




.. raw:: html

</div>

- .. raw:: html

<div class="ansible-option-cell">

Wait for the BMC to restart.


.. rst-class:: ansible-option-line

:ansible-option-choices:`Choices:`

- :ansible-option-choices-entry:`false`
- :ansible-option-choices-entry-default:`true` :ansible-option-choices-default-mark:`← (default)`


.. raw:: html

</div>

* - .. raw:: html

<div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-main--bmc_reboot_wait_timeout"></div>

.. _ansible_collections.opiproject.dpu.bmc_reboot_role__parameter-main__bmc_reboot_wait_timeout:

.. rst-class:: ansible-option-title

**bmc_reboot_wait_timeout**

.. raw:: html

<a class="ansibleOptionLink" href="#parameter-main--bmc_reboot_wait_timeout" title="Permalink to this option"></a>

.. ansible-option-type-line::

:ansible-option-type:`integer`




.. raw:: html

</div>

- .. raw:: html

<div class="ansible-option-cell">

Seconds to wait for the BMC to restart.


.. rst-class:: ansible-option-line

:ansible-option-default-bold:`Default:` :ansible-option-default:`120`

.. raw:: html

</div>
Expand Down
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.6.0",
"community.general": ">=9.1.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: 120
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: 120
12 changes: 4 additions & 8 deletions roles/bmc_reboot/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,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 @@ -44,7 +42,5 @@
timeout: 60
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 b80cd09

Please sign in to comment.