Merge "Set up right DNF module stream for Upgrades and Updates." into stable/train

This commit is contained in:
Zuul 2021-01-22 15:01:11 +00:00 committed by Gerrit Code Review
commit 56106ee3ab
5 changed files with 49 additions and 0 deletions

View File

@ -108,6 +108,13 @@ parameters:
Mainly for CI purpose. It shouldn't matter on other distributions
where it's disabled in the role. Set to true to skip the enforcement.
type: string
DnfStreams:
default: []
description: List of streams to be configured before updating packages. Each list
element contains a dictionary with the following values defined
module[mandatory], stream[mandatory] and profile[optional]. If the profile
is not specified 'common' will be used instead.
type: json
outputs:
role_data:
@ -332,6 +339,16 @@ outputs:
- ''
- - "#!/bin/bash\n\n"
- {get_param: UpgradeInitCommonCommand}
- name: Ensure DNF modules have the right stream
vars:
dnf_module_list: {get_param: DnfStreams}
dnf:
name: "@{{ item.module }}:{{ item.stream }}/{{ item.profile|default('common') }}"
state: present
loop: "{{ dnf_module_list|list }}"
when:
- ansible_distribution_major_version >= '8'
- dnf_module_list|length > 0
- name: Ensure EL modules are in proper state
shell: dnf -y distro-sync
when: ansible_distribution_major_version == '8'
@ -427,6 +444,17 @@ outputs:
- step|int == 0
- ansible_distribution == 'RedHat'
- not (skip_rhel_enforcement | bool)
- name: Ensure DNF modules have the right stream
vars:
dnf_module_list: {get_param: DnfStreams}
dnf:
name: "@{{ item.module }}:{{ item.stream }}/{{ item.profile|default('common') }}"
state: present
loop: "{{ dnf_module_list|list }}"
when:
- step|int == 0
- ansible_distribution_major_version >= '8'
- dnf_module_list|length > 0
- name: Check for existing yum.pid
stat: path=/var/run/yum.pid
register: yum_pid_file

View File

@ -36,6 +36,13 @@ parameters:
Mainly for CI purpose. It shouldn't matter on other distributions
where it's disabled in the role. Set to true to skip the enforcement.
type: string
DnfStreams:
default: []
description: List of streams to be configured before updating packages. Each list
element contains a dictionary with the following values defined
module[mandatory], stream[mandatory] and profile[optional]. If the profile
is not specified 'common' will be used instead.
type: json
outputs:
role_data:
@ -60,6 +67,17 @@ outputs:
- step|int == 0
- ansible_distribution == 'RedHat'
- not (skip_rhel_enforcement | bool)
- name: Ensure DNF modules have the right stream
vars:
dnf_module_list: {get_param: DnfStreams}
dnf:
name: "@{{ item.module }}:{{ item.stream }}/{{ item.profile|default('common') }}"
state: present
loop: "{{ dnf_module_list|list }}"
when:
- step|int == 0
- ansible_distribution_major_version >= '8'
- dnf_module_list|length > 0
- name: Special treatment for OpenvSwitch
tripleo_ovs_upgrade:
when:

View File

@ -6,3 +6,4 @@ resource_registry:
parameter_defaults:
UndercloudUpgrade: true
DnfStreams: [{'module':'container-tools', 'stream':'2.0'}]

View File

@ -7,3 +7,4 @@ resource_registry:
parameter_defaults:
CephAnsiblePlaybook: default
DnfStreams: [{'module':'container-tools', 'stream':'2.0'}]

View File

@ -27,3 +27,4 @@ parameter_defaults:
# system upgrade, we need to bypass the ceph ansible
# repo validation to work.
CephAnsibleWarning: false
DnfStreams: [{'module':'container-tools', 'stream':'2.0'}]