Skip to content

Add option to install EPEL during os_images prerequisites #57

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
namespace: stackhpc
name: openstack
version: 0.5.2
version: 0.5.3
readme: README.md
authors:
- StackHPC Ltd
Expand All @@ -13,6 +13,7 @@ tags:
- openstack
dependencies:
"openstack.cloud": ">=2.1.0"
"community.general": ">=8.2.0"
repository: https://github.com/stackhpc/ansible-collection-openstack
documentation: https://github.com/stackhpc/ansible-collection-openstack/blob/main/README.md
homepage: https://github.com/stackhpc/ansible-collection-openstack
Expand Down
4 changes: 4 additions & 0 deletions roles/os_images/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ Role Variables
`os_images_package_dependencies_extra`: List of additional packages to install
on the build host.

`os_images_install_epel_repo`: Whether to enable the CRB repository and install
the EPEL repository before installing packages on the build host. This is
disabled by default.

`os_images_cache`: a path to a directory in which to cache build artefacts.
It defaults to `~/disk_images`
`NOTE`: new images will NOT be built, even if changes are made in config, if an image
Expand Down
3 changes: 3 additions & 0 deletions roles/os_images/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
# List of additional host package dependencies to install.
os_images_package_dependencies_extra: []
# Whether to enable the CRB repository and install the EPEL repository before
# installing packages.
os_images_install_epel_repo: false
# Path to virtualenv in which to install python dependencies to upload images.
os_images_venv:
# Path to virtualenv in which to install DIB to build images.
Expand Down
18 changes: 18 additions & 0 deletions roles/os_images/tasks/prereqs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
- name: Include OS family-specific variables
ansible.builtin.include_vars: "{{ ansible_facts.os_family }}.yml"

- name: Ensure CRB repository is enabled
community.general.dnf_config_manager:
name: crb
state: enabled
when:
- os_images_install_epel_repo | bool
- ansible_facts.os_family == "RedHat"
become: true

- name: Ensure EPEL repository is installed
ansible.builtin.dnf:
name: epel-release
state: present
when:
- os_images_install_epel_repo | bool
- ansible_facts.os_family == "RedHat"
become: true

- name: Ensure required packages are installed
ansible.builtin.package:
name: "{{ (os_images_package_dependencies + os_images_package_dependencies_extra) | select | list }}"
Expand Down