🐞 fix: 修复 ofed ansible 脚本错误问题

修复 ofed ansible 脚本错误问题
This commit is contained in:
songyanchao
2023-06-20 07:31:55 -04:00
committed by 付明卫
parent ab5be1df00
commit 5becfd7b81

View File

@@ -86,27 +86,12 @@
when: runtime_env == 'TSG-X-P0804' or runtime_env == 'TSG-X-P0906'
############ end ############
###### Set RUN_FW_UPDATER_ONBOOT=yes ######
- name: Update RUN_FW_UPDATER_ONBOOT setting
tasks:
- name: Check if RUN_FW_UPDATER_ONBOOT is present in the file
shell: grep -q "^RUN_FW_UPDATER_ONBOOT=no$" /etc/infiniband/openib.conf
register: grep_result
changed_when: false
ignore_errors: true
- name: Replace RUN_FW_UPDATER_ONBOOT if found
lineinfile:
path: /etc/infiniband/openib.conf
regexp: "^RUN_FW_UPDATER_ONBOOT=no$"
line: "RUN_FW_UPDATER_ONBOOT=yes"
when: grep_result.rc == 0
- name: Append RUN_FW_UPDATER_ONBOOT if not found
lineinfile:
path: /etc/infiniband/openib.conf
line: "RUN_FW_UPDATER_ONBOOT=yes"
when: grep_result.rc != 0
###### Set RUN_FW_UPDATER_ONBOOT ######
- name: "enable auto update firmware on boot"
lineinfile:
path: /etc/infiniband/openib.conf
regexp: '^RUN_FW_UPDATER_ONBOOT'
line: "RUN_FW_UPDATER_ONBOOT=yes"
when: runtime_env == 'TSG-X-P0804' or runtime_env == 'TSG-X-P0906'
###### end ######