Browse Source

Remove all ignore_errors to avoid confusion when debugging

- octavia_controller_post_config: remove "ignore_errors: true". It's not
  supposed to be needed, since there is already a
  "failed_when: config_contents.rc != 0" which knows when to fail.

- octavia_undercloud, tripleo_cellv2, tripleo_ceph_common,
  tripleo_container_manage, tripleo_packages and tripleo_puppet_cache:
  replace "ignore_errors: true" by "failed_when: false" for debugging
  experience. We know the tasks can fail and we don't care, let's just
  not show them as failures in that case and force the task to never
  fail.

- tripleo_podman: instead of ignoring errors, check if the config file
  actually exists before wipping it out.

Change-Id: Ib3716e4823735a9db9bd3cac33b8daf0e5f3d186
changes/29/711129/4
Emilien Macchi 2 years ago
parent
commit
c1959707db
  1. 3
      tripleo_ansible/roles/octavia_controller_post_config/tasks/main.yml
  2. 4
      tripleo_ansible/roles/octavia_undercloud/tasks/image_mgmt.yml
  3. 3
      tripleo_ansible/roles/octavia_undercloud/tasks/main.yml
  4. 2
      tripleo_ansible/roles/tripleo_cellv2/tasks/check_cell_exist.yml
  5. 2
      tripleo_ansible/roles/tripleo_ceph_common/tasks/main.yml
  6. 2
      tripleo_ansible/roles/tripleo_container_manage/tasks/podman/create.yml
  7. 2
      tripleo_ansible/roles/tripleo_packages/handlers/main.yml
  8. 12
      tripleo_ansible/roles/tripleo_packages/tasks/upgrade.yml
  9. 8
      tripleo_ansible/roles/tripleo_podman/tasks/tripleo_podman_install.yml
  10. 9
      tripleo_ansible/roles/tripleo_puppet_cache/tasks/main.yml

3
tripleo_ansible/roles/octavia_controller_post_config/tasks/main.yml

@ -22,7 +22,6 @@
register: config_contents
failed_when: config_contents.rc != 0
changed_when: false
ignore_errors: true
- name: retrieve current ip list
set_fact:
@ -54,7 +53,7 @@
become_user: root
shell: |
systemctl is-active --quiet {{ item }} && echo {{ item }}
ignore_errors: true
failed_when: false
register: octavia_active_services
loop:
- tripleo_octavia_api

4
tripleo_ansible/roles/octavia_undercloud/tasks/image_mgmt.yml

@ -38,7 +38,7 @@
OS_PASSWORD: "{{ auth_password }}"
OS_PROJECT_NAME: "{{ auth_project_name }}"
register: glance_id_result
ignore_errors: true
failed_when: false
- name: set image id fact
set_fact:
@ -56,7 +56,7 @@
when:
- image_id is defined
register: glance_results
ignore_errors: true
failed_when: false
- name: set current_md5 fact from glance if image already exists there
set_fact:

3
tripleo_ansible/roles/octavia_undercloud/tasks/main.yml

@ -37,12 +37,11 @@
- name: check if pub key file exists
stat: path="{{ amp_ssh_key_path }}"
register: key_file_result
ignore_errors: true
- name: fail if ssh pub key file does not exist or is not readable
fail: msg="{{ amp_ssh_key_path }} does not exist or is not readable by user {{ ansible_user }}"
when:
- (key_file_result is failed) or (not (key_file_result.stat.exists | bool)) or (not (key_file_result.stat.readable | bool))
- (not (key_file_result.stat.exists | bool)) or (not (key_file_result.stat.readable | bool))
- name: Set final key fact
set_fact:

2
tripleo_ansible/roles/tripleo_cellv2/tasks/check_cell_exist.yml

@ -26,7 +26,7 @@
{{ tripleo_cellv2_containercli }} exec -i -u root nova_api \
nova-manage {{ (tripleo_cellv2_debug | bool) | ternary('--debug', '') }} \
cell_v2 list_cells | grep {{ tripleo_cellv2_cell_name }}
ignore_errors: true
failed_when: false
register: cell_check_result
- name: Fail if cell already exist
fail: msg="Cell with name {{ tripleo_cellv2_cell_name }} already exist!"

2
tripleo_ansible/roles/tripleo_ceph_common/tasks/main.yml

@ -39,7 +39,7 @@
- name: get all ansible environment variables
shell: "env | grep ^ANSIBLE_"
register: env_shell_output
ignore_errors: true
failed_when: false
delegate_to: localhost
connection: local
run_once: true

2
tripleo_ansible/roles/tripleo_container_manage/tasks/podman/create.yml

@ -132,7 +132,7 @@
# We need to ignore the failures since later we print some debug.
# We can't use "rescue" here because the debug tasks use
# "podman_containers_infos".
ignore_errors: true
failed_when: false
no_log: "{{ not tripleo_container_manage_debug }}"
- name: Create a list of containers which didn't exit
set_fact:

2
tripleo_ansible/roles/tripleo_packages/handlers/main.yml

@ -24,7 +24,7 @@
systemd:
name: openvswitch
changed_when: false
ignore_errors: true
failed_when: false
register: openvswitch_service_state
listen: start openvswitch

12
tripleo_ansible/roles/tripleo_packages/tasks/upgrade.yml

@ -147,7 +147,7 @@
set -o pipefail
yum info -q rhosp-openvswitch | awk '/^Version/{print $NF}'
register: rhosp_package_result
ignore_errors: true
failed_when: false
- name: Set fact for triggering OpenvSwitch layered product package handling
set_fact:
@ -228,7 +228,7 @@
block:
- name: check if an upgrade is required
register: ovs_need_upgrade
ignore_errors: true
failed_when: false
shell: |
yum check-upgrade openvswitch | awk '/openvswitch/{print}'
@ -237,13 +237,13 @@
set -o pipefail
rpm -q --scripts openvswitch | awk '/postuninstall/,/*/' | grep -q "systemctl.*try-restart"
register: ovs_packaging_issue
ignore_errors: true
failed_when: false
- name: Upgrade openvswitch
when:
- (step | int) == 2
- run_ovs_update | default(true)
- ovs_packaging_issue is success
- ovs_packaging_issue.rc == 0
- ovs_need_upgrade.stdout | default('')
block:
- name: "Ensure empty directory: emptying."
@ -293,7 +293,7 @@
shell: |-
set -o pipefail
yum check-upgrade | awk '/os-net-config/{print}'
ignore_errors: true
failed_when: false
register: os_net_config_need_upgrade
when:
- (step | int) == 3
@ -301,7 +301,7 @@
- name: Check that os-net-config has configuration
shell: test -s /etc/os-net-config/config.json
register: os_net_config_has_config
ignore_errors: true
failed_when: false
when:
- (step | int) == 3

8
tripleo_ansible/roles/tripleo_podman/tasks/tripleo_podman_install.yml

@ -34,12 +34,18 @@
when:
- cni0_interface.rc == 0
- name: Check if 87-podman-bridge.conflist exists
stat:
path: /etc/cni/net.d/87-podman-bridge.conflist
register: podman_bridge_config
- name: Remove default cni config for cni0 if exists
copy:
dest: /etc/cni/net.d/87-podman-bridge.conflist
content: ''
force: true
ignore_errors: true
when:
- podman_bridge_config.stat.exists | bool
- name: configure insecure registries /etc/containers/registries.conf
ini_file:

9
tripleo_ansible/roles/tripleo_puppet_cache/tasks/main.yml vendored

@ -75,21 +75,20 @@
file:
path: /opt/puppetlabs/facter
state: absent
ignore_errors: true
- name: Pre-cache facts
become: true
check_mode: false
command: facter --config "{{ tripleo_puppet_cache_base_dir }}/facter.conf"
shell: facter --config "{{ tripleo_puppet_cache_base_dir }}/facter.conf"
no_log: true
ignore_errors: true
failed_when: false
register: _facter_cache_run
- name: Facter error output when failed
check_mode: false
debug:
msg: "{{ _facter_cache_run.stderr }}"
when: _facter_cache_run is failed
when: _facter_cache_run.rc != 0
- name: Sync cached facts
become: true
@ -98,4 +97,4 @@
src: "/opt/puppetlabs/"
dest: "{{ tripleo_puppet_cache_base_dir }}/"
delegate_to: "{{ inventory_hostname }}"
when: _facter_cache_run is succeeded
when: _facter_cache_run.rc == 0

Loading…
Cancel
Save