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

Solve Issue #63: Add Support for Token Authentication and User/Pass Authentication in BMC Firmware Update #89

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
15 changes: 8 additions & 7 deletions .github/workflows/ansible.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
ansible-version: [stable-2.17, stable-2.15, stable-2.16]
exclude:
# Ansible-core 2.16 is supported only from Python 3.10 onwards
glimchb marked this conversation as resolved.
Show resolved Hide resolved
- python-version: "3.9"
ansible-version: stable-2.16

python-version: ["3.9", "3.10", "3.11"]
glimchb marked this conversation as resolved.
Show resolved Hide resolved
ansible-version: [stable-2.15, stable-2.16, stable-2.17]
exclude:
# Ansible-core 2.16 and 2.17 are supported only from Python 3.10 onwards
- python-version: "3.9"
ansible-version: stable-2.16
- python-version: "3.9"
glimchb marked this conversation as resolved.
Show resolved Hide resolved
ansible-version: stable-2.17
steps:
# Important: This sets up your GITHUB_WORKSPACE environment variable
- name: Checkout the source code
Expand Down
7 changes: 6 additions & 1 deletion roles/bmc_fw_update/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
when: not bmc_fw_update_local_file_check.stat.exists

# Check multipart support with user/pass authentication
- block:

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 47 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.
- name: Check multipart support using user/pass
ansible.builtin.uri:
url: "https://{{ inventory_hostname }}/redfish/v1/UpdateService"
Expand Down Expand Up @@ -103,7 +103,7 @@
when: dpu_bmc_username is defined and dpu_bmc_password is defined

# Check multipart support with token authentication
- block:

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

key-order[task]

You can improve the task key order to: when, block

Check failure on line 106 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

name[missing]

All tasks should be named.
- name: Check multipart support using token
ansible.builtin.uri:
url: "https://{{ inventory_hostname }}/redfish/v1/UpdateService"
Expand Down Expand Up @@ -171,6 +171,10 @@
category: Update
command: GetUpdateStatus
baseuri: "{{ inventory_hostname }}"
username: "{{ dpu_bmc_username | default(omit) }}"
password: "{{ dpu_bmc_password | default(omit) }}"
auth_token: "{{ dpu_bmc_token | default(omit) }}"
update_handle: "{{ bmc_firmware_update_taskid }}"
register: update_progress
until: update_progress.redfish_facts.update_status.status != 'Running'
retries: 60
Expand Down Expand Up @@ -208,4 +212,5 @@
msg: "{{ bmc_fw_update_version_failure }}"
when:
- bmc_fw_update_reboot is true
- not bmc_fw_update_image_file is search(bmc_fw_update_got_fw_version | regex_search('[0-9-.]+'))
- not bmc_fw_update_image_file is search(bmc_fw_update_got_fw_version | regex_search('[0-9-.]+'))"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

last " is typo?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, fixed it


Check failure on line 216 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

yaml[empty-lines]

Too many blank lines (1 > 0)

Check failure on line 216 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

yaml[empty-lines]

Too many blank lines (1 > 0)

Check failure on line 216 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

yaml[empty-lines]

Too many blank lines (1 > 0)

Check failure on line 216 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

yaml[empty-lines]

Too many blank lines (1 > 0)

Check failure on line 216 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

yaml[empty-lines]

Too many blank lines (1 > 0)

Check failure on line 216 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

yaml[empty-lines]

Too many blank lines (1 > 0)

Check failure on line 216 in roles/bmc_fw_update/tasks/main.yml

View workflow job for this annotation

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

yaml[empty-lines]

Too many blank lines (1 > 0)
Loading