Add support to install distro packages from RDO CloudSIG repos

RDO provides two sets of repositories with OpenStack packages, RDO Trunk
and RDO CloudSIG [1]. Currently, openstack_hosts role always uses Trunk
repos but in some cases, users may prefer to use CloudSIG.

This patch adds a variable openstack_hosts_rdo_repo_type which can take
values "trunk" or "cloudsig" to select the type or repos to be used.

[1] https://www.rdoproject.org/what/repos/

Change-Id: I95ee40ae1366e815507b62ba632935e664971f42
This commit is contained in:
Alfredo Moralejo 2023-04-14 11:17:41 +02:00
parent 5e92c6b3e9
commit 25e8634b71
3 changed files with 20 additions and 2 deletions

View File

@ -163,6 +163,8 @@ openstack_host_sysstat_cron_mode: '0755'
# Set default mirror for CentOS repositories
# NOTE(mhayden): Ensure that the full path to the 'centos' directory is used.
openstack_hosts_centos_mirror_url: "{{ centos_mirror_url | default('http://mirror.centos.org/centos') }}"
# openstack_hosts_rdo_repo_type can be trunk or cloudsig
openstack_hosts_rdo_repo_type: trunk
openstack_hosts_rdo_mirror_url: 'https://trunk.rdoproject.org'
openstack_hosts_rdo_repo_url: "{{ _openstack_hosts_rdo_repo_url }}"
openstack_hosts_rdo_deps_url: "{{ _openstack_hosts_rdo_deps_url }}"

View File

@ -101,7 +101,7 @@
when:
- openstack_hosts_package_manager_extra_conf | length > 0 or openstack_hosts_package_manager_default_conf | length > 0
- name: Add rdo repositories via url
- name: Add rdo repositories via url for trunk based installation
get_url:
url: "{{ openstack_hosts_rdo_repo_url }}/delorean.repo"
dest: /etc/yum.repos.d/rdo.repo
@ -111,6 +111,15 @@
delay: 2
when:
- (install_method | default('source')) == 'distro'
- openstack_hosts_rdo_repo_type == 'trunk'
- name: Install centos-release-openstack package for cloudsig based installation
package:
name:
- centos-release-openstack-{{ openstack_distrib_code_name }}
when:
- (install_method | default('source')) == 'distro'
- openstack_hosts_rdo_repo_type == 'cloudsig'
- name: Enable PowerTools repository
command: dnf config-manager --set-enabled "[Pp]ower[Tt]ools"

View File

@ -92,7 +92,7 @@ _package_list:
_openstack_hosts_rdo_repo_url: "{{ openstack_hosts_rdo_mirror_url }}/centos{{ ansible_facts['distribution_major_version'] }}-{{ openstack_distrib_code_name | lower }}/current/"
_openstack_hosts_rdo_deps_url: "{{ openstack_hosts_rdo_mirror_url }}/centos{{ ansible_facts['distribution_major_version'] }}-{{ openstack_distrib_code_name | lower }}/deps/latest/"
_package_repos:
_package_repos_trunk:
- name: rdo-deps
file: rdo-deps
description: rdo-deps
@ -101,4 +101,11 @@ _package_repos:
module_hotfixes: yes
exclude: "{{ (ansible_facts['distribution'] == 'Rocky') | ternary(['*rdo-openvswitch*3.1*', '*rdo-ovn*3.1*'], omit) }}"
_package_repos: |-
{% if openstack_hosts_rdo_repo_type == 'trunk' %}
{{ _package_repos_trunk }}
{% else %}
[]
{% endif %}
_openstack_ca_bundle_path: /etc/pki/tls/certs/ca-bundle.crt