From 15d971d8780aeeff0cff61848769520ff57bf661 Mon Sep 17 00:00:00 2001 From: Luis Tomas Bolivar Date: Wed, 4 Oct 2023 11:28:34 +0200 Subject: [PATCH] Ensure logrotate image is also pre-downloaded --- roles/edpm_download_cache/tasks/container_images.yml | 8 ++++++++ roles/edpm_download_cache/tasks/packages.yml | 2 +- .../tasks/download_cache_images.yml | 10 ++++++++++ ...{download_cache.yml => download_cache_packages.yml} | 0 roles/edpm_ovn_bgp_agent/tasks/download_cache.yml | 4 +--- 5 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 roles/edpm_logrotate_crond/tasks/download_cache_images.yml rename roles/edpm_logrotate_crond/tasks/{download_cache.yml => download_cache_packages.yml} (100%) diff --git a/roles/edpm_download_cache/tasks/container_images.yml b/roles/edpm_download_cache/tasks/container_images.yml index 1f45e4926..ecffba13e 100644 --- a/roles/edpm_download_cache/tasks/container_images.yml +++ b/roles/edpm_download_cache/tasks/container_images.yml @@ -76,3 +76,11 @@ ansible.builtin.include_role: name: osp.edpm.edpm_neutron_dhcp tasks_from: download_cache.yml + +- name: Download images for edpm_logrotate_crond role + ansible.builtin.include_role: + name: osp.edpm.edpm_logrotate_crond + tasks_from: download_cache_images.yml + tags: + - edpm_logrotate_crond + - download_cache diff --git a/roles/edpm_download_cache/tasks/packages.yml b/roles/edpm_download_cache/tasks/packages.yml index 6d2c8f9fd..4ec24d0a4 100644 --- a/roles/edpm_download_cache/tasks/packages.yml +++ b/roles/edpm_download_cache/tasks/packages.yml @@ -43,7 +43,7 @@ - name: Download packages for edpm_logrotate_crond role ansible.builtin.include_role: name: osp.edpm.edpm_logrotate_crond - tasks_from: download_cache.yml + tasks_from: download_cache_packages.yml tags: - edpm_logrotate_crond - download_cache diff --git a/roles/edpm_logrotate_crond/tasks/download_cache_images.yml b/roles/edpm_logrotate_crond/tasks/download_cache_images.yml new file mode 100644 index 000000000..3af6f4e22 --- /dev/null +++ b/roles/edpm_logrotate_crond/tasks/download_cache_images.yml @@ -0,0 +1,10 @@ +--- + +- name: Download needed container images + containers.podman.podman_image: + name: "{{ edpm_logrotate_crond_image }}" + become: true + register: edpm_logrotate_crond_cronie_images_download + until: edpm_logrotate_crond_cronie_images_download.failed == false + retries: "{{ edpm_logrotate_crond_download_retries }}" + delay: "{{ edpm_logrotate_crond_download_delay }}" diff --git a/roles/edpm_logrotate_crond/tasks/download_cache.yml b/roles/edpm_logrotate_crond/tasks/download_cache_packages.yml similarity index 100% rename from roles/edpm_logrotate_crond/tasks/download_cache.yml rename to roles/edpm_logrotate_crond/tasks/download_cache_packages.yml diff --git a/roles/edpm_ovn_bgp_agent/tasks/download_cache.yml b/roles/edpm_ovn_bgp_agent/tasks/download_cache.yml index a83e98b0e..33376990f 100644 --- a/roles/edpm_ovn_bgp_agent/tasks/download_cache.yml +++ b/roles/edpm_ovn_bgp_agent/tasks/download_cache.yml @@ -2,9 +2,7 @@ - name: Download needed container images containers.podman.podman_image: - name: "{{ item }}" - loop: - - "{{ edpm_ovn_bgp_agent_image }}" + name: "{{ edpm_ovn_bgp_agent_image }}" become: true register: edpm_ovn_bgp_agent_images_download until: edpm_ovn_bgp_agent_images_download.failed == false