diff --git a/playbooks/tripleo-buildimages/pre.yaml b/playbooks/tripleo-buildimages/pre.yaml index ba6e994dc..3097ee7b3 100644 --- a/playbooks/tripleo-buildimages/pre.yaml +++ b/playbooks/tripleo-buildimages/pre.yaml @@ -19,6 +19,10 @@ when: - ansible_pkg_mgr == "yum" + - name: Include EL9 taks + when: ansible_distribution_major_version is version(9, '==') + include: pre9.yaml + - name: Include tripleo-repos include_role: name: tripleo-repos diff --git a/playbooks/tripleo-buildimages/pre9.yaml b/playbooks/tripleo-buildimages/pre9.yaml new file mode 100644 index 000000000..0afa5e4f5 --- /dev/null +++ b/playbooks/tripleo-buildimages/pre9.yaml @@ -0,0 +1,22 @@ +--- +- name: get extra repos delorean and deps + become: true + shell: + cmd: | + dnf config-manager --add-repo {{ item }} + loop: + - "https://trunk.rdoproject.org/centos9-{{ release }}/{{ promote_source | default('consistent') }}/delorean.repo" + - https://trunk.rdoproject.org/centos9-{{ release }}/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 diff --git a/roles/oooci-build-images/tasks/main.yaml b/roles/oooci-build-images/tasks/main.yaml index 3d58ecdcf..9dc3e4c2a 100644 --- a/roles/oooci-build-images/tasks/main.yaml +++ b/roles/oooci-build-images/tasks/main.yaml @@ -2,11 +2,12 @@ - name: Get python_v fact for py2 or py3 common vars include_tasks: check_set_py3.yaml -- name: Include OS specific variables - include_vars: centos-7.yaml +- name: Include OS specific variables for C7 or C9 + include_vars: "centos-{{ ansible_distribution_major_version }}.yaml" when: - ansible_distribution == "CentOS" - - ansible_distribution_major_version == '7' + - ansible_distribution_major_version is version('7', '==') or + ansible_distribution_major_version is version('9', '==') - name: Make sure logs directory exists file: diff --git a/roles/oooci-build-images/tasks/pre.yaml b/roles/oooci-build-images/tasks/pre.yaml index f9c294e57..fe1568bd6 100644 --- a/roles/oooci-build-images/tasks/pre.yaml +++ b/roles/oooci-build-images/tasks/pre.yaml @@ -97,7 +97,7 @@ pip: name: setuptools virtualenv: "{{ workspace }}/.tmp" - virtualenv_command: "virtualenv-3" + virtualenv_command: "{{ 'virtualenv' if ansible_distribution_major_version is version('9', '==') else 'virtualenv-3' }}" - name: Borrow activate_this.py copy: diff --git a/roles/oooci-build-images/vars/centos-9.yaml b/roles/oooci-build-images/vars/centos-9.yaml new file mode 100644 index 000000000..a79527dda --- /dev/null +++ b/roles/oooci-build-images/vars/centos-9.yaml @@ -0,0 +1,8 @@ +--- +tripleo_image_source: https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-20210830.0.x86_64.qcow2 +dib_yum_repo_conf: + - /etc/yum.repos.d/CentOS-Stream-9-* + - /etc/yum.repos.d/delorean* +dib_release: "9" +dib_dnf_module_streams: "container-tools:latest" +tripleo_image_os: centos9