Skip to content

Commit

Permalink
Merge pull request #353 from rebtoor/install-podman-during-download-c…
Browse files Browse the repository at this point in the history
…ache

Refactored `edpm_download_cache` role
  • Loading branch information
openshift-merge-robot authored Sep 20, 2023
2 parents 25ce3da + 486924f commit 5425025
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 40 deletions.
3 changes: 3 additions & 0 deletions roles/edpm_download_cache/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
# All variables intended for modification should be placed in this file.

# All variables within this role should have a prefix of "edpm_download_cache"
edpm_download_cache_packages: true

edpm_download_cache_container_images: true
10 changes: 9 additions & 1 deletion roles/edpm_download_cache/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,12 @@ argument_specs:
# ./roles/edpm_download_cache/tasks/main.yml entry point
main:
short_description: The main entry point for the edpm_download_cache role.
options: {}
options:
edpm_download_cache_packages:
type: bool
default: true
description: Enable caching of packages
edpm_download_cache_container_images:
type: bool
default: true
description: Enable caching of container images
17 changes: 17 additions & 0 deletions roles/edpm_download_cache/tasks/container_images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---

- name: Install podman
ansible.builtin.include_role:
name: osp.edpm.edpm_podman
tasks_from: install.yml
tags:
- edpm_podman
- download_cache

- name: Login to container registries if needed
ansible.builtin.include_role:
name: osp.edpm.edpm_podman
tasks_from: login.yml
tags:
- edpm_podman
- download_cache
45 changes: 6 additions & 39 deletions roles/edpm_download_cache/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,10 @@
# License for the specific language governing permissions and limitations
# under the License.

- name: Download packages
ansible.builtin.include_tasks: packages.yml
when: edpm_download_cache_packages | bool

- name: Download packages for edpm_bootstrap role
ansible.builtin.include_role:
name: osp.edpm.edpm_bootstrap
tasks_from: download_cache.yml

- name: Download packages for edpm_podman role
ansible.builtin.include_role:
name: osp.edpm.edpm_podman
tasks_from: download_cache.yml

- name: Download packages for edpm_tuned role
ansible.builtin.include_role:
name: osp.edpm.edpm_tuned
tasks_from: download_cache.yml

- name: Download packages for edpm_kernel role
ansible.builtin.include_role:
name: osp.edpm.edpm_kernel
tasks_from: download_cache.yml

- name: Download packages for edpm_network_config role
ansible.builtin.include_role:
name: osp.edpm.edpm_network_config
tasks_from: download_cache.yml

- name: Download packages for edpm_logrotate_crond role
ansible.builtin.include_role:
name: osp.edpm.edpm_logrotate_crond
tasks_from: download_cache.yml

- name: Download packages for edpm_chrony role
ansible.builtin.include_role:
name: osp.edpm.edpm_chrony
tasks_from: download_cache.yml

- name: Download packages for edpm_sshd role
ansible.builtin.include_role:
name: osp.edpm.edpm_sshd
tasks_from: download_cache.yml
- name: Download container images
ansible.builtin.include_tasks: container_images.yml
when: edpm_download_cache_container_images | bool
65 changes: 65 additions & 0 deletions roles/edpm_download_cache/tasks/packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---

- name: Download packages for edpm_bootstrap role
ansible.builtin.include_role:
name: osp.edpm.edpm_bootstrap
tasks_from: download_cache.yml
tags:
- edpm_kernel
- download_cache

- name: Download packages for edpm_podman role
ansible.builtin.include_role:
name: osp.edpm.edpm_podman
tasks_from: download_cache.yml
tags:
- edpm_podman
- download_cache

- name: Download packages for edpm_tuned role
ansible.builtin.include_role:
name: osp.edpm.edpm_tuned
tasks_from: download_cache.yml
tags:
- edpm_tuned
- download_cache

- name: Download packages for edpm_kernel role
ansible.builtin.include_role:
name: osp.edpm.edpm_kernel
tasks_from: download_cache.yml
tags:
- edpm_kernel
- download_cache

- name: Download packages for edpm_network_config role
ansible.builtin.include_role:
name: osp.edpm.edpm_network_config
tasks_from: download_cache.yml
tags:
- edpm_network_config
- download_cache

- name: Download packages for edpm_logrotate_crond role
ansible.builtin.include_role:
name: osp.edpm.edpm_logrotate_crond
tasks_from: download_cache.yml
tags:
- edpm_logrotate_crond
- download_cache

- name: Download packages for edpm_chrony role
ansible.builtin.include_role:
name: osp.edpm.edpm_chrony
tasks_from: download_cache.yml
tags:
- edpm_chrony
- download_cache

- name: Download packages for edpm_sshd role
ansible.builtin.include_role:
name: osp.edpm.edpm_sshd
tasks_from: download_cache.yml
tags:
- edpm_sshd
- download_cache

0 comments on commit 5425025

Please sign in to comment.