Merge "Added support for CentOS stream 9 container build"
This commit is contained in:
commit
5e294fc097
|
@ -10,6 +10,13 @@
|
||||||
for backwards compatibility purposes. The variables provided by this
|
for backwards compatibility purposes. The variables provided by this
|
||||||
file are now available through Ansible under hostvars[$HOST]['nodepool'].
|
file are now available through Ansible under hostvars[$HOST]['nodepool'].
|
||||||
|
|
||||||
|
- name: Create /etc/nodepool it if does not exist
|
||||||
|
become: true
|
||||||
|
file:
|
||||||
|
path: /etc/nodepool
|
||||||
|
state: directory
|
||||||
|
mode: '0777'
|
||||||
|
|
||||||
- name: Create /etc/nodepool/provider file
|
- name: Create /etc/nodepool/provider file
|
||||||
copy:
|
copy:
|
||||||
content: |
|
content: |
|
||||||
|
|
|
@ -19,31 +19,36 @@
|
||||||
when:
|
when:
|
||||||
- ansible_pkg_mgr == "yum"
|
- ansible_pkg_mgr == "yum"
|
||||||
|
|
||||||
- name: Include tripleo-repos
|
- name: Container Build for 8 specific distros
|
||||||
include_role:
|
when: ansible_distribution_major_version is version(8, '<=')
|
||||||
name: tripleo-repos
|
block:
|
||||||
vars:
|
- name: Include tripleo-repos
|
||||||
override_repos: "{{ buildcontainers_override_repos | default('') }}"
|
include_role:
|
||||||
tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
|
name: tripleo-repos
|
||||||
|
vars:
|
||||||
|
override_repos: "{{ buildcontainers_override_repos | default('') }}"
|
||||||
|
tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
|
||||||
|
|
||||||
# TODO: Move this setting to tripleo-repos yum module
|
# TODO: Move this setting to tripleo-repos yum module
|
||||||
- name: Enable supported container tools version
|
- name: Enable supported container tools version
|
||||||
become: true
|
become: true
|
||||||
shell: |
|
shell: |
|
||||||
{{ ansible_pkg_mgr }} module disable container-tools:rhel8 -y;
|
{{ ansible_pkg_mgr }} module disable container-tools:rhel8 -y;
|
||||||
{{ ansible_pkg_mgr }} module enable container-tools:3.0 -y;
|
{{ ansible_pkg_mgr }} module enable container-tools:3.0 -y;
|
||||||
{{ ansible_pkg_mgr }} clean metadata
|
{{ ansible_pkg_mgr }} clean metadata
|
||||||
when:
|
when: ansible_distribution_major_version is version(8, '==')
|
||||||
- ansible_distribution_major_version|int >= 8
|
|
||||||
- ansible_distribution_major_version|int < 9
|
|
||||||
|
|
||||||
- name: Include bindep role
|
- name: Include bindep role
|
||||||
include_role:
|
include_role:
|
||||||
name: bindep
|
name: bindep
|
||||||
vars:
|
vars:
|
||||||
bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/python-tripleoclient'].src_dir }}"
|
bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/python-tripleoclient'].src_dir }}"
|
||||||
|
|
||||||
- name: Run build containers pre tasks
|
- name: Run build containers pre tasks
|
||||||
include_role:
|
include_role:
|
||||||
name: build-containers
|
name: build-containers
|
||||||
tasks_from: pre
|
tasks_from: pre
|
||||||
|
|
||||||
|
- name: Container Build for 9 specific distros
|
||||||
|
when: ansible_distribution_major_version is version(9, '==')
|
||||||
|
include: pre9.yaml
|
||||||
|
|
|
@ -0,0 +1,41 @@
|
||||||
|
---
|
||||||
|
# It contains RHEL9 specific tasks
|
||||||
|
- name: get extra repos delorean and deps
|
||||||
|
become: true
|
||||||
|
shell:
|
||||||
|
cmd: |
|
||||||
|
dnf config-manager --add-repo {{ item }}
|
||||||
|
loop:
|
||||||
|
- "https://trunk.rdoproject.org/centos9-master/{{ promote_source | default('consistent') }}/delorean.repo"
|
||||||
|
- https://trunk.rdoproject.org/centos9-master/delorean-deps.repo
|
||||||
|
changed_when: true
|
||||||
|
|
||||||
|
- name: Enable supported container tools version
|
||||||
|
become: true
|
||||||
|
shell: |
|
||||||
|
{{ ansible_pkg_mgr }} module switch-to container-tools:latest -y;
|
||||||
|
{{ ansible_pkg_mgr }} clean metadata
|
||||||
|
|
||||||
|
- name: Install vitualenv
|
||||||
|
become: true
|
||||||
|
package:
|
||||||
|
name: python3-virtualenv
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: Include tripleo-repos
|
||||||
|
include_role:
|
||||||
|
name: tripleo-repos
|
||||||
|
vars:
|
||||||
|
override_repos: "{{ buildcontainers_override_repos | default('') }}"
|
||||||
|
tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
|
||||||
|
|
||||||
|
- name: Install python3-tripleoclient
|
||||||
|
become: true
|
||||||
|
package:
|
||||||
|
name: python3-tripleoclient
|
||||||
|
state: latest
|
||||||
|
|
||||||
|
- name: Run build containers pre tasks
|
||||||
|
include_role:
|
||||||
|
name: build-containers
|
||||||
|
tasks_from: pre
|
|
@ -45,6 +45,18 @@
|
||||||
option: registries
|
option: registries
|
||||||
value:
|
value:
|
||||||
- "localhost:{{ push_registry_port | default('5001') }}"
|
- "localhost:{{ push_registry_port | default('5001') }}"
|
||||||
|
when: ansible_distribution_major_version is version(8, '==')
|
||||||
|
|
||||||
|
- name: Configure unqualified-search-registries
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/containers/registries.conf
|
||||||
|
regexp: '^unqualified-search-registries'
|
||||||
|
line: "unqualified-search-registries = ['{{ push_registry }}',
|
||||||
|
'registry.access.redhat.com',
|
||||||
|
'registry.fedoraproject.org',
|
||||||
|
'registry.centos.org',
|
||||||
|
'docker.io']"
|
||||||
|
when: ansible_distribution_major_version is version(9, '==')
|
||||||
|
|
||||||
- name: Setup repo web service
|
- name: Setup repo web service
|
||||||
become: true
|
become: true
|
||||||
|
@ -77,9 +89,11 @@
|
||||||
set -ex
|
set -ex
|
||||||
find /etc/yum.repos.d/ -name delorean\* -o -name quickstart-centos\* | xargs -I {} cp {} /var/www/html/
|
find /etc/yum.repos.d/ -name delorean\* -o -name quickstart-centos\* | xargs -I {} cp {} /var/www/html/
|
||||||
|
|
||||||
|
# TODO(chandan): Fix No chain/target/match by that name issue for EL9
|
||||||
- name: Add http iptables rules from containers
|
- name: Add http iptables rules from containers
|
||||||
command: iptables -I openstack-INPUT 1 -p tcp --dport 80 -s 172.17.0.0/16 -j ACCEPT
|
command: iptables -I openstack-INPUT 1 -p tcp --dport 80 -s 172.17.0.0/16 -j ACCEPT
|
||||||
become: true
|
become: true
|
||||||
|
when: ansible_distribution_major_version is version(9, '<')
|
||||||
|
|
||||||
- name: Setup tripleo registry
|
- name: Setup tripleo registry
|
||||||
when:
|
when:
|
||||||
|
|
|
@ -87,5 +87,9 @@ openstack tripleo container image build \
|
||||||
{% for item in volume_mounts %}
|
{% for item in volume_mounts %}
|
||||||
--volume {{ item }} \
|
--volume {{ item }} \
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
{% if branch not in ["train", "ussuri", "victoria", "wallaby"] %}
|
||||||
|
--tcib-extra tcib_release={{ ansible_distribution_major_version }} \
|
||||||
|
--tcib-extra tcib_python_version={{ (ansible_distribution_major_version is version('9', '<')) | ternary ('3.6', '3.9') }} \
|
||||||
{% endif %}
|
{% endif %}
|
||||||
--debug
|
--debug
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
---
|
||||||
|
tripleo_deps_from_package:
|
||||||
|
- "python3-tripleoclient"
|
||||||
|
|
||||||
|
upper_constraints_items:
|
||||||
|
- tripleo-common
|
||||||
|
- python-tripleoclient
|
||||||
|
- tripleo-ansible
|
||||||
|
|
||||||
|
requirements_items:
|
||||||
|
- openstack-tripleo-common
|
||||||
|
- python-tripleoclient
|
||||||
|
- tripleo-ansible
|
||||||
|
|
||||||
|
source_items:
|
||||||
|
- "file://{{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common"
|
||||||
|
- "file://{{ openstack_git_root }}/python-tripleoclient"
|
||||||
|
- "file://{{ openstack_git_root }}/tripleo-ansible"
|
||||||
|
- decorator
|
||||||
|
|
||||||
|
volume_mounts:
|
||||||
|
- "/etc/yum.repos.d:/etc/distro.repos.d:z"
|
||||||
|
- "/etc/pki/rpm-gpg:/etc/pki/rpm-gpg:z"
|
||||||
|
- "/etc/dnf/vars:/etc/dnf/vars:z"
|
|
@ -9,6 +9,7 @@ kolla_rhel8_patch:
|
||||||
virtualenv_python:
|
virtualenv_python:
|
||||||
7: python
|
7: python
|
||||||
8: python3
|
8: python3
|
||||||
|
9: python3
|
||||||
|
|
||||||
# Current implementation assumes that any branch name not mentioned here
|
# Current implementation assumes that any branch name not mentioned here
|
||||||
# would default to the excludes defined on master branch.
|
# would default to the excludes defined on master branch.
|
||||||
|
|
|
@ -22,12 +22,12 @@
|
||||||
- name: Assure src folder has safe permissions
|
- name: Assure src folder has safe permissions
|
||||||
# Workaround for https://bugs.launchpad.net/tripleo/+bug/1807703
|
# Workaround for https://bugs.launchpad.net/tripleo/+bug/1807703
|
||||||
file:
|
file:
|
||||||
path: /home/zuul/src/
|
path: "{{ ansible_user_dir }}/src/"
|
||||||
state: directory
|
state: directory
|
||||||
mode: u=rwX,g=rX,o=rX
|
mode: u=rwX,g=rX,o=rX
|
||||||
recurse: true
|
recurse: true
|
||||||
|
|
||||||
- name: "set zull_dump"
|
- name: "set zuul_dump"
|
||||||
set_fact:
|
set_fact:
|
||||||
zuul_dump: "{{ {'zuul': zuul} }}"
|
zuul_dump: "{{ {'zuul': zuul} }}"
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,10 @@ centos_mirror_host: "http://mirror.centos.org"
|
||||||
fedora_mirror_host: "https://mirrors.fedoraproject.org"
|
fedora_mirror_host: "https://mirrors.fedoraproject.org"
|
||||||
rdo_mirror_host: "https://trunk.rdoproject.org"
|
rdo_mirror_host: "https://trunk.rdoproject.org"
|
||||||
override_repos: ""
|
override_repos: ""
|
||||||
|
# Url for the CentOS Compose for tripleo yum config module
|
||||||
|
compose_url: "https://composes.stream.centos.org/production/{{ compose_id }}/compose"
|
||||||
|
# Particular compose id to use
|
||||||
|
compose_id: "latest-CentOS-Stream"
|
||||||
rpm_packages:
|
rpm_packages:
|
||||||
- git
|
- git
|
||||||
- python3-libselinux
|
- python3-libselinux
|
||||||
|
|
|
@ -122,10 +122,28 @@
|
||||||
--no-stream
|
--no-stream
|
||||||
fi
|
fi
|
||||||
register: result
|
register: result
|
||||||
|
when: ansible_distribution_major_version is version(8, '<=')
|
||||||
changed_when: "'Installed:' in result.stdout_lines"
|
changed_when: "'Installed:' in result.stdout_lines"
|
||||||
args:
|
args:
|
||||||
warn: false
|
warn: false
|
||||||
|
|
||||||
|
- name: Install repos on EL9
|
||||||
|
become: true
|
||||||
|
shell: |
|
||||||
|
set -exo pipefail
|
||||||
|
source {{ workspace }}/venv/bin/activate
|
||||||
|
rm -fr /etc/yum.repos.d/centos9.repo
|
||||||
|
tripleo-yum-config enable-compose-repos \
|
||||||
|
--disable-all-conflicting \
|
||||||
|
--release centos-stream-9 \
|
||||||
|
--compose-url {{ compose_url }}
|
||||||
|
register: result
|
||||||
|
when: ansible_distribution_major_version is version(8, '>')
|
||||||
|
|
||||||
|
- name: Print out the stdout of result
|
||||||
|
debug:
|
||||||
|
msg: "{{ result }}"
|
||||||
|
|
||||||
- name: Update all installed packages after new repos are setup # noqa package-latest
|
- name: Update all installed packages after new repos are setup # noqa package-latest
|
||||||
become: true
|
become: true
|
||||||
package:
|
package:
|
||||||
|
|
Loading…
Reference in New Issue