Skip to content

Commit

Permalink
Fix regex for DCQCN
Browse files Browse the repository at this point in the history
- skip task if regex does not match
- won't fail if the regex doesn't match now
  • Loading branch information
velomatt committed Sep 20, 2023
1 parent 7aeac41 commit 5a2f6a1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions roles/configure_dcqcn/tasks/configure_dcqcn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@
loop_control:
label: "{{ item.item.ibdev }}"
vars:
found_setting: "{{ item.stdout | regex_search('ROCE_CC_PRIO_MASK_P1 +([^ ]+)','\\1') | first }}"
when: found_setting != dcqcn_roce_cc_prio_mask_p1 | string
mlx_re: 'ROCE_CC_PRIO_MASK_P1 +([^ ]+)'
when:
- item.stdout is regex(mlx_re)
- item.stdout | regex_search(mlx_re,'\\1') | first != dcqcn_roce_cc_prio_mask_p1 | string
notify: Reboot system - dcqcn
become: true

Expand All @@ -55,8 +57,10 @@
loop_control:
label: "{{ item.item.ibdev }}"
vars:
found_setting: "{{ item.stdout | regex_search('CNP_DSCP_P1 +([^ ]+)','\\1') | first }}"
when: found_setting != dcqcn_cnp_dscp_p1 | string
mlx_re: 'CNP_DSCP_P1 +([^ ]+)'
when:
- item.stdout is regex(mlx_re)
- item.stdout | regex_search(mlx_re,'\\1') | first != dcqcn_cnp_dscp_p1 | string
notify: Reboot system - dcqcn
become: true

Expand All @@ -66,8 +70,10 @@
loop_control:
label: "{{ item.item.ibdev }}"
vars:
found_setting: "{{ item.stdout | regex_search('CNP_802P_PRIO_P1 +([^ ]+)','\\1') | first }}"
when: found_setting != dcqcn_cnp_802p_prio_p1 | string
mlx_re: 'CNP_802P_PRIO_P1 +([^ ]+)'
when:
- item.stdout is regex(mlx_re)
- item.stdout | regex_search(mlx_re,'\\1') | first != dcqcn_cnp_802p_prio_p1 | string
notify: Reboot system - dcqcn
become: true

Expand Down

0 comments on commit 5a2f6a1

Please sign in to comment.