From 80eeccb511edc59443385290df00ab9473ca0814 Mon Sep 17 00:00:00 2001 From: rabi Date: Wed, 24 Jul 2024 13:21:05 +0530 Subject: [PATCH] Fix result check syntax Otherwise it fails with below in case the package is not available, i.e correct repos are not enabled. ASK [osp.edpm.edpm_bootstrap : Deploy network-scripts required for deprecated network service] *** fatal: [edpm-compute-1]: FAILED! => {"msg": "The conditional check 'edpm_bootstrap_legacy_network_packages_result.rc == 0' failed. The error was: error while evaluating conditional (edpm_bootstrap_legacy_network_packages_result.rc == 0): 'dict object' has no attribute 'rc'. 'dict object' has no attribute 'rc'"} Signed-off-by: rabi --- roles/edpm_bootstrap/tasks/download_cache.yml | 6 +++--- roles/edpm_bootstrap/tasks/packages.yml | 6 +++--- roles/edpm_kernel/tasks/download_cache.yml | 2 +- roles/edpm_kernel/tasks/main.yml | 2 +- roles/edpm_libvirt/tasks/download_cache.yml | 2 +- .../edpm_logrotate_crond/tasks/download_cache_packages.yml | 2 +- roles/edpm_logrotate_crond/tasks/install.yml | 2 +- roles/edpm_network_config/tasks/download_cache.yml | 2 +- roles/edpm_network_config/tasks/main.yml | 2 +- roles/edpm_network_config/tasks/network_config.yml | 2 +- roles/edpm_ovs/tasks/download_cache.yml | 2 +- roles/edpm_podman/tasks/buildah_login.yml | 2 +- roles/edpm_podman/tasks/download_cache.yml | 2 +- roles/edpm_podman/tasks/install.yml | 2 +- roles/edpm_sshd/tasks/download_cache.yml | 2 +- roles/edpm_sshd/tasks/install.yml | 2 +- roles/edpm_tuned/tasks/download_cache.yml | 2 +- roles/edpm_tuned/tasks/install.yml | 2 +- 18 files changed, 22 insertions(+), 22 deletions(-) diff --git a/roles/edpm_bootstrap/tasks/download_cache.yml b/roles/edpm_bootstrap/tasks/download_cache.yml index 10024b72b..eb10a5d8e 100644 --- a/roles/edpm_bootstrap/tasks/download_cache.yml +++ b/roles/edpm_bootstrap/tasks/download_cache.yml @@ -6,7 +6,7 @@ download_only: true become: true register: edpm_bootstrap_packages_bootstrap_download - until: edpm_bootstrap_packages_bootstrap_download.rc == 0 + until: edpm_bootstrap_packages_bootstrap_download is succeeded retries: "{{ edpm_bootstrap_download_retries }}" delay: "{{ edpm_bootstrap_download_delay }}" @@ -18,7 +18,7 @@ download_only: true become: true register: edpm_bootstrap_legacy_network_packages_download - until: edpm_bootstrap_legacy_network_packages_download.rc == 0 + until: edpm_bootstrap_legacy_network_packages_download is succeeded retries: "{{ edpm_bootstrap_download_retries }}" delay: "{{ edpm_bootstrap_download_delay }}" @@ -31,6 +31,6 @@ download_only: true become: true register: edpm_bootstrap_release_version_package_download - until: edpm_bootstrap_release_version_package_download.rc == 0 + until: edpm_bootstrap_release_version_package_download is succeeded retries: "{{ edpm_bootstrap_download_retries }}" delay: "{{ edpm_bootstrap_download_delay }}" diff --git a/roles/edpm_bootstrap/tasks/packages.yml b/roles/edpm_bootstrap/tasks/packages.yml index bb5925a09..1fb62ee2d 100644 --- a/roles/edpm_bootstrap/tasks/packages.yml +++ b/roles/edpm_bootstrap/tasks/packages.yml @@ -32,7 +32,7 @@ - (edpm_bootstrap_release_version_package | list | length) > 0 become: true register: edpm_bootstrap_release_version_package_install - until: edpm_bootstrap_release_version_package_install.rc == 0 + until: edpm_bootstrap_release_version_package_install is succeeded retries: "{{ edpm_bootstrap_download_retries }}" delay: "{{ edpm_bootstrap_download_delay }}" @@ -45,7 +45,7 @@ - not ansible_check_mode | bool - (edpm_bootstrap_packages_bootstrap_result.rc | int) == 1 register: edpm_bootstrap_packages_bootstrap_result - until: edpm_bootstrap_packages_bootstrap_result.rc == 0 + until: edpm_bootstrap_packages_bootstrap_result is succeeded retries: "{{ edpm_bootstrap_download_retries }}" delay: "{{ edpm_bootstrap_download_delay }}" become: true @@ -68,7 +68,7 @@ name: "{{ edpm_bootstrap_legacy_network_packages }}" state: present register: edpm_bootstrap_legacy_network_packages_result - until: edpm_bootstrap_legacy_network_packages_result.rc == 0 + until: edpm_bootstrap_legacy_network_packages_result is succeeded retries: "{{ edpm_bootstrap_download_retries }}" delay: "{{ edpm_bootstrap_download_delay }}" - name: Ensure network service is enabled diff --git a/roles/edpm_kernel/tasks/download_cache.yml b/roles/edpm_kernel/tasks/download_cache.yml index 297eaa8fd..8b0462d62 100644 --- a/roles/edpm_kernel/tasks/download_cache.yml +++ b/roles/edpm_kernel/tasks/download_cache.yml @@ -7,6 +7,6 @@ become: true when: edpm_kernel_extra_packages | length > 0 register: _install_packages_result - until: _install_packages_result.rc == 0 + until: _install_packages_result is succeeded retries: "{{ edpm_kernel_download_retries }}" delay: "{{ edpm_kernel_download_delay }}" diff --git a/roles/edpm_kernel/tasks/main.yml b/roles/edpm_kernel/tasks/main.yml index 41c7f367e..8a70e7ef0 100644 --- a/roles/edpm_kernel/tasks/main.yml +++ b/roles/edpm_kernel/tasks/main.yml @@ -26,7 +26,7 @@ state: present register: _install_packages_result when: edpm_kernel_extra_packages | length > 0 - until: _install_packages_result.rc == 0 + until: _install_packages_result is succeeded retries: "{{ edpm_kernel_download_retries }}" delay: "{{ edpm_kernel_download_delay }}" diff --git a/roles/edpm_libvirt/tasks/download_cache.yml b/roles/edpm_libvirt/tasks/download_cache.yml index 0d8b01c16..c09978359 100644 --- a/roles/edpm_libvirt/tasks/download_cache.yml +++ b/roles/edpm_libvirt/tasks/download_cache.yml @@ -5,6 +5,6 @@ download_only: true become: true register: _install_packages_result - until: _install_packages_result.rc == 0 + until: _install_packages_result is succeeded retries: "{{ edpm_libvirt_download_retries }}" delay: "{{ edpm_libvirt_download_delay }}" diff --git a/roles/edpm_logrotate_crond/tasks/download_cache_packages.yml b/roles/edpm_logrotate_crond/tasks/download_cache_packages.yml index cb9edcba4..7cf6cd495 100644 --- a/roles/edpm_logrotate_crond/tasks/download_cache_packages.yml +++ b/roles/edpm_logrotate_crond/tasks/download_cache_packages.yml @@ -6,6 +6,6 @@ download_only: true become: true register: edpm_logrotate_crond_cronie_package_download - until: edpm_logrotate_crond_cronie_package_download.rc == 0 + until: edpm_logrotate_crond_cronie_package_download is succeeded retries: "{{ edpm_logrotate_crond_download_retries }}" delay: "{{ edpm_logrotate_crond_download_delay }}" diff --git a/roles/edpm_logrotate_crond/tasks/install.yml b/roles/edpm_logrotate_crond/tasks/install.yml index 6eac59997..9144c7e6d 100644 --- a/roles/edpm_logrotate_crond/tasks/install.yml +++ b/roles/edpm_logrotate_crond/tasks/install.yml @@ -21,7 +21,7 @@ name: "{{ edpm_logrotate_crond_cronie_package }}" state: present register: edpm_logrotate_crond_cronie_package_download - until: edpm_logrotate_crond_cronie_package_download.rc == 0 + until: edpm_logrotate_crond_cronie_package_download is succeeded retries: "{{ edpm_logrotate_crond_download_retries }}" delay: "{{ edpm_logrotate_crond_download_delay }}" diff --git a/roles/edpm_network_config/tasks/download_cache.yml b/roles/edpm_network_config/tasks/download_cache.yml index 216cd5b3f..26aa0bf22 100644 --- a/roles/edpm_network_config/tasks/download_cache.yml +++ b/roles/edpm_network_config/tasks/download_cache.yml @@ -18,6 +18,6 @@ download_only: true become: true register: edpm_network_config_onc_download - until: edpm_network_config_onc_download.rc == 0 + until: edpm_network_config_onc_download is succeeded retries: "{{ edpm_network_config_download_retries }}" delay: "{{ edpm_network_config_download_delay }}" diff --git a/roles/edpm_network_config/tasks/main.yml b/roles/edpm_network_config/tasks/main.yml index 7134ed3ec..71b79971c 100644 --- a/roles/edpm_network_config/tasks/main.yml +++ b/roles/edpm_network_config/tasks/main.yml @@ -22,7 +22,7 @@ name: "{{ edpm_network_config_systemrole_nmstate_dependencies }}" state: present register: nm_ovs_status - until: nm_ovs_status.rc == 0 + until: nm_ovs_status is succeeded retries: "{{ edpm_network_config_download_retries }}" delay: "{{ edpm_network_config_download_delay }}" - name: Restart NetworkManager after plugin installation [nmstate] diff --git a/roles/edpm_network_config/tasks/network_config.yml b/roles/edpm_network_config/tasks/network_config.yml index f20a60749..1f3f4bb64 100644 --- a/roles/edpm_network_config/tasks/network_config.yml +++ b/roles/edpm_network_config/tasks/network_config.yml @@ -44,7 +44,7 @@ name: os-net-config state: present register: edpm_network_config_onc_download - until: edpm_network_config_onc_download.rc == 0 + until: edpm_network_config_onc_download is succeeded retries: "{{ edpm_network_config_download_retries }}" delay: "{{ edpm_network_config_download_delay }}" diff --git a/roles/edpm_ovs/tasks/download_cache.yml b/roles/edpm_ovs/tasks/download_cache.yml index cbf2e5034..000491b7b 100644 --- a/roles/edpm_ovs/tasks/download_cache.yml +++ b/roles/edpm_ovs/tasks/download_cache.yml @@ -6,6 +6,6 @@ state: "{{ dnf_state | default(omit) }}" become: true register: _install_packages_result - until: _install_packages_result.rc == 0 + until: _install_packages_result is succeeded retries: "{{ edpm_ovs_download_retries }}" delay: "{{ edpm_ovs_download_delay }}" diff --git a/roles/edpm_podman/tasks/buildah_login.yml b/roles/edpm_podman/tasks/buildah_login.yml index 05d3cf1a1..aa9d360b2 100644 --- a/roles/edpm_podman/tasks/buildah_login.yml +++ b/roles/edpm_podman/tasks/buildah_login.yml @@ -20,7 +20,7 @@ name: "{{ edpm_buildah_package }}" state: present register: edpm_buildah_package_download - until: edpm_buildah_package_download.rc == 0 + until: edpm_buildah_package_download is succeeded retries: "{{ edpm_podman_download_retries }}" delay: "{{ edpm_podman_download_delay }}" diff --git a/roles/edpm_podman/tasks/download_cache.yml b/roles/edpm_podman/tasks/download_cache.yml index 1aa382cce..b57acb0cb 100644 --- a/roles/edpm_podman/tasks/download_cache.yml +++ b/roles/edpm_podman/tasks/download_cache.yml @@ -8,6 +8,6 @@ download_only: true become: true register: edpm_podman_packages_download - until: edpm_podman_packages_download.rc == 0 + until: edpm_podman_packages_download is succeeded retries: "{{ edpm_podman_download_retries }}" delay: "{{ edpm_podman_download_delay }}" diff --git a/roles/edpm_podman/tasks/install.yml b/roles/edpm_podman/tasks/install.yml index 4ed6a267a..fd6855109 100644 --- a/roles/edpm_podman/tasks/install.yml +++ b/roles/edpm_podman/tasks/install.yml @@ -22,7 +22,7 @@ name: "{{ edpm_podman_package }}" state: present register: edpm_podman_package_download - until: edpm_podman_package_download.rc == 0 + until: edpm_podman_package_download is succeeded retries: "{{ edpm_podman_download_retries }}" delay: "{{ edpm_podman_download_delay }}" diff --git a/roles/edpm_sshd/tasks/download_cache.yml b/roles/edpm_sshd/tasks/download_cache.yml index c1d06898e..3f5c79145 100644 --- a/roles/edpm_sshd/tasks/download_cache.yml +++ b/roles/edpm_sshd/tasks/download_cache.yml @@ -6,6 +6,6 @@ download_only: true become: true register: edpm_sshd_packages_download - until: edpm_sshd_packages_download.rc == 0 + until: edpm_sshd_packages_download is succeeded retries: "{{ edpm_sshd_download_retries }}" delay: "{{ edpm_sshd_download_delay }}" diff --git a/roles/edpm_sshd/tasks/install.yml b/roles/edpm_sshd/tasks/install.yml index b92801568..b7ad8be07 100644 --- a/roles/edpm_sshd/tasks/install.yml +++ b/roles/edpm_sshd/tasks/install.yml @@ -23,7 +23,7 @@ name: "{{ edpm_sshd_packages }}" state: present register: _sshd_install_result - until: _sshd_install_result.rc == 0 + until: _sshd_install_result is succeeded retries: "{{ edpm_sshd_download_retries }}" delay: "{{ edpm_sshd_download_delay }}" diff --git a/roles/edpm_tuned/tasks/download_cache.yml b/roles/edpm_tuned/tasks/download_cache.yml index 3cb0ec1e4..3c22f65af 100644 --- a/roles/edpm_tuned/tasks/download_cache.yml +++ b/roles/edpm_tuned/tasks/download_cache.yml @@ -6,6 +6,6 @@ download_only: true become: true register: edpm_tuned_system_packages_download - until: edpm_tuned_system_packages_download.rc == 0 + until: edpm_tuned_system_packages_download is succeeded retries: "{{ edpm_tuned_download_retries }}" delay: "{{ edpm_tuned_download_delay }}" diff --git a/roles/edpm_tuned/tasks/install.yml b/roles/edpm_tuned/tasks/install.yml index ab354c3e7..1c4c1bf23 100644 --- a/roles/edpm_tuned/tasks/install.yml +++ b/roles/edpm_tuned/tasks/install.yml @@ -20,6 +20,6 @@ name: "{{ edpm_tuned_system_packages }}" state: present register: edpm_tuned_system_packages_download - until: edpm_tuned_system_packages_download.rc == 0 + until: edpm_tuned_system_packages_download is succeeded retries: "{{ edpm_tuned_download_retries }}" delay: "{{ edpm_tuned_download_delay }}"