From 63a0dbc3fc937f1c0aceefce21569e2ebeccddcb Mon Sep 17 00:00:00 2001 From: Amol Kahat Date: Thu, 6 Jan 2022 18:39:08 +0530 Subject: [PATCH] Use release file for C8 images This change implements similar solution to another, implemented for C9: I39fc32cf1249b4f14bdc35a4af7a1f8784c19801 Testproject: https://review.rdoproject.org/r/c/testproject/+/38921 Depends-On: https://review.opendev.org/c/openstack/tripleo-quickstart/+/827544 Change-Id: I4c47797c5b656af9e42b2401201b885380a29039 Co-Authored-By: Dariusz Smigiel Signed-off-by: Amol Kahat --- playbooks/tripleo-buildcontainers/pre.yaml | 6 +++--- playbooks/tripleo-buildcontainers/run.yaml | 8 ++++---- playbooks/tripleo-buildimages/pre.yaml | 4 ++-- playbooks/tripleo-buildimages/run-v3.yaml | 4 ++-- roles/oooci-build-images/defaults/main.yaml | 3 +-- roles/tripleo-build-jobs-repos/defaults/main.yaml | 7 +++++++ roles/tripleo-build-jobs-repos/tasks/main.yaml | 10 +++++++++- zuul.d/base.yaml | 5 +++++ 8 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 roles/tripleo-build-jobs-repos/defaults/main.yaml diff --git a/playbooks/tripleo-buildcontainers/pre.yaml b/playbooks/tripleo-buildcontainers/pre.yaml index 4107633c5..c9888df8c 100644 --- a/playbooks/tripleo-buildcontainers/pre.yaml +++ b/playbooks/tripleo-buildcontainers/pre.yaml @@ -19,8 +19,8 @@ when: - ansible_pkg_mgr == "yum" - - name: Container Build for 8 specific distros - when: ansible_distribution_major_version is version(8, '<=') + - name: Container Build for 7 specific distros + when: ansible_distribution_major_version is version(7, '==') block: - name: Include tripleo-repos include_role: @@ -60,7 +60,7 @@ bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/python-tripleoclient'].src_dir }}" - name: Setup repos using repo-setup role and release file - when: ansible_distribution_major_version is version(9, '>=') + when: ansible_distribution_major_version is version(8, '>=') include_role: name: tripleo-build-jobs-repos diff --git a/playbooks/tripleo-buildcontainers/run.yaml b/playbooks/tripleo-buildcontainers/run.yaml index d2644274c..cbf4fb539 100644 --- a/playbooks/tripleo-buildcontainers/run.yaml +++ b/playbooks/tripleo-buildcontainers/run.yaml @@ -3,8 +3,8 @@ name: TripleO container image building job tasks: - - name: Re-run repo-setup and build for c9 (pickup mirrors set in pre) - when: ansible_distribution_major_version is version('9', '>=') + - name: Re-run repo-setup and build for c8 and c9 (pickup mirrors set in pre) + when: ansible_distribution_major_version is version('8', '>=') block: - name: Load vars from release file and set facts needed for repo-setup include_role: @@ -16,7 +16,7 @@ vars: repo_setup_dir: "{{ workspace }}" repo_setup_use_collections: false - - name: "build containers C9 for hash: {{ buildcontainers_version_hash }}" + - name: "build containers C8 and C9 for hash: {{ buildcontainers_version_hash }}" include_role: name: build-containers vars: @@ -25,7 +25,7 @@ - name: Run build containers tasks include_role: name: build-containers - when: ansible_distribution_major_version is version('8', '<=') + when: ansible_distribution_major_version is version('7', '==') - name: Fail job if it's configured fail: diff --git a/playbooks/tripleo-buildimages/pre.yaml b/playbooks/tripleo-buildimages/pre.yaml index e00568346..4230891c1 100644 --- a/playbooks/tripleo-buildimages/pre.yaml +++ b/playbooks/tripleo-buildimages/pre.yaml @@ -20,12 +20,12 @@ - ansible_pkg_mgr == "yum" - name: Setup repos using repo-setup role and release file - when: ansible_distribution_major_version is version(9, '>=') + when: ansible_distribution_major_version is version(8, '>=') include_role: name: tripleo-build-jobs-repos - name: Include tripleo-repos - when: ansible_distribution_major_version is version(8, '<=') + when: ansible_distribution_major_version is version(8, '<') include_role: name: tripleo-repos vars: diff --git a/playbooks/tripleo-buildimages/run-v3.yaml b/playbooks/tripleo-buildimages/run-v3.yaml index c22b828c4..54c76b5d4 100644 --- a/playbooks/tripleo-buildimages/run-v3.yaml +++ b/playbooks/tripleo-buildimages/run-v3.yaml @@ -2,8 +2,8 @@ - hosts: all tasks: - - name: Re-run the repo-setup role for c9 (after rdo mirror setup in pre) - when: ansible_distribution_major_version is version('9', '>=') + - name: Re-run the repo-setup role for c8 and c9 (after rdo mirror setup in pre) + when: ansible_distribution_major_version is version('8', '>=') block: - name: Load vars from release file and set facts needed for repo-setup include_role: diff --git a/roles/oooci-build-images/defaults/main.yaml b/roles/oooci-build-images/defaults/main.yaml index a9de4f251..1eefcc67b 100644 --- a/roles/oooci-build-images/defaults/main.yaml +++ b/roles/oooci-build-images/defaults/main.yaml @@ -36,9 +36,8 @@ dib_yum_repo_conf: >- {{ dib_yum_repo_conf_centos }} {%- endif %} dib_yum_repo_conf_centos: - - /etc/yum.repos.d/tripleo-centos* + - /etc/yum.repos.d/quickstart-centos* - /etc/yum.repos.d/delorean* - - /etc/yum.repos.d/CentOS* dib_yum_repo_conf_rhel: - /etc/yum.repos.d/rh-cloud.repo - /etc/yum.repos.d/delorean* diff --git a/roles/tripleo-build-jobs-repos/defaults/main.yaml b/roles/tripleo-build-jobs-repos/defaults/main.yaml new file mode 100644 index 000000000..3a5d039d6 --- /dev/null +++ b/roles/tripleo-build-jobs-repos/defaults/main.yaml @@ -0,0 +1,7 @@ +--- +rpm_packages: + - git + - python3 + - python3-libselinux + - python3-setuptools +# - python3-venv diff --git a/roles/tripleo-build-jobs-repos/tasks/main.yaml b/roles/tripleo-build-jobs-repos/tasks/main.yaml index 4fe8591dd..2720df69e 100644 --- a/roles/tripleo-build-jobs-repos/tasks/main.yaml +++ b/roles/tripleo-build-jobs-repos/tasks/main.yaml @@ -1,4 +1,10 @@ --- +- name: Install system packages + become: true + package: + name: "{{ rpm_packages }}" + state: present + - name: Load vars from release file and set facts needed for repo-setup include_tasks: load-vars.yaml @@ -7,6 +13,7 @@ package: name: python3-pip state: absent + when: ansible_distribution_major_version is version('8', '>') - name: Get pip needed for tripleo-repos installation include_role: @@ -18,7 +25,7 @@ - name: install tripleo-repos from git checkout shell: | pushd "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}" - python setup.py install --user + python3 setup.py install --user popd failed_when: false changed_when: true @@ -29,6 +36,7 @@ vars: repo_setup_dir: "{{ workspace }}" repo_setup_use_collections: false + use_yum_config_module: false - name: Install python3-tripleoclient python3-virtualenv become: true diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index e908b25e7..f69d96628 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -801,7 +801,12 @@ - opendev.org/openstack/tripleo-puppet-elements - opendev.org/openstack/tripleo-repos - opendev.org/openstack/requirements + - opendev.org/openstack/tripleo-quickstart + - opendev.org/openstack/tripleo-quickstart-extras irrelevant-files: *irrelevant_build_img + roles: + - zuul: opendev.org/openstack/tripleo-quickstart + - zuul: opendev.org/openstack/tripleo-quickstart-extras - job: name: tripleo-build-images-base-centos-9