Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(bmc): add bmc_reboot_should_wait argument #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -4,4 +4,6 @@
---
# defaults file for bmc_reboot

https_port: 443

Check warning on line 7 in roles/bmc_reboot/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.16)

var-naming[no-role-prefix]

Variables names from within roles should use bmc_reboot_ as a prefix. (vars: https_port)

Check warning on line 7 in roles/bmc_reboot/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.17)

var-naming[no-role-prefix]

Variables names from within roles should use bmc_reboot_ as a prefix. (vars: https_port)

Check warning on line 7 in roles/bmc_reboot/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.15)

var-naming[no-role-prefix]

Variables names from within roles should use bmc_reboot_ as a prefix. (vars: https_port)

Check warning on line 7 in roles/bmc_reboot/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.12, stable-2.17)

var-naming[no-role-prefix]

Variables names from within roles should use bmc_reboot_ as a prefix. (vars: https_port)

Check warning on line 7 in roles/bmc_reboot/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.11, stable-2.15)

var-naming[no-role-prefix]

Variables names from within roles should use bmc_reboot_ as a prefix. (vars: https_port)

Check warning on line 7 in roles/bmc_reboot/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.12, stable-2.16)

var-naming[no-role-prefix]

Variables names from within roles should use bmc_reboot_ as a prefix. (vars: https_port)

Check warning on line 7 in roles/bmc_reboot/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.17)

var-naming[no-role-prefix]

Variables names from within roles should use bmc_reboot_ as a prefix. (vars: https_port)

Check warning on line 7 in roles/bmc_reboot/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.10, stable-2.16)

var-naming[no-role-prefix]

Variables names from within roles should use bmc_reboot_ as a prefix. (vars: https_port)

Check warning on line 7 in roles/bmc_reboot/defaults/main.yml

View workflow job for this annotation

GitHub Actions / Ansible lint (3.12, stable-2.15)

var-naming[no-role-prefix]

Variables names from within roles should use bmc_reboot_ as a prefix. (vars: https_port)
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 }}"
Loading