Skip to content

Commit

Permalink
Merge pull request #826 from openshift-cherrypick-robot/cherry-pick-7…
Browse files Browse the repository at this point in the history
…99-to-18.0-fr1

[18.0-fr1] Don't use rescue with any_errors_fatal: true
  • Loading branch information
openshift-merge-bot[bot] authored Nov 22, 2024
2 parents 8e56c67 + 12f0bd4 commit 4283fe7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion roles/edpm_frr/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,15 @@
- name: Construct FRR uplink interfaces from os-net-config mappings
ansible.builtin.set_fact:
edpm_frr_bgp_uplinks_mapped: "{{ edpm_frr_bgp_uplinks | map('extract', iface_map) | list }}"
rescue:
register: check_edpm_frr_bgp_uplinks_mapped
ignore_errors: true

- name: Failed to construct FRR uplink interfaces
ansible.builtin.fail:
msg: |
Failed to map at least one interface from {{ edpm_frr_bgp_uplinks }} to {{ iface_map }}.
Please check value of Ansible variable edpm_frr_bgp_uplinks.
when: check_edpm_frr_bgp_uplinks_mapped is failed

- name: Gather facts if they don't exist
when: "'system' not in ansible_facts"
Expand Down
10 changes: 8 additions & 2 deletions roles/edpm_users/tasks/create_users_and_groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@
ansible.builtin.getent:
database: passwd
key: "{{ item.name }}"
rescue:
register: user_check
ignore_errors: true

- name: Ensure group is present on the host [ {{ item.name }} ]
ansible.builtin.group:
name: "{{ item.name }}"
gid: "{{ item.gid }}"
state: present
when: user_check is failed

- name: Ensure user is present on the host [ {{ item.name }} ]
when: not (item.group_only | default(false))
when:
- not (item.group_only | default(false))
- user_check is failed
ansible.builtin.user:
name: "{{ item.name }}"
uid: "{{ item.uid }}"
Expand Down

0 comments on commit 4283fe7

Please sign in to comment.