From 85c8ecd758bc85fba604f64279f36b75747f8840 Mon Sep 17 00:00:00 2001 From: "Chandan Kumar (raukadah)" Date: Tue, 27 Oct 2020 09:07:17 +0530 Subject: [PATCH] Move content provider plays to a seperate playbook https://review.opendev.org/#/c/752419 added the content provider for centos-7 in multinode-standalone-pre.yml and the playbook become little messy. In order to keep thing seperate, we are moving the content provider plays to a seperate playbook and calling the same in multinode-standalone-pre.yml to avoid distruption in existing workflow. Change-Id: I3f8ae8b380b44db49e7a0486efba29d66437bd08 Signed-off-by: Chandan Kumar (raukadah) --- playbooks/content-provider-containers.yml | 57 +++++++++++++++++++++++ playbooks/multinode-standalone-pre.yml | 57 +---------------------- 2 files changed, 58 insertions(+), 56 deletions(-) create mode 100644 playbooks/content-provider-containers.yml diff --git a/playbooks/content-provider-containers.yml b/playbooks/content-provider-containers.yml new file mode 100644 index 000000000..e07836cf1 --- /dev/null +++ b/playbooks/content-provider-containers.yml @@ -0,0 +1,57 @@ +--- +- name: Build containers for content provider job + hosts: undercloud + tasks: + - name: Build containers for CentOS 8 + include_role: + name: standalone + tasks_from: containers + apply: + tags: + - standalone + when: ansible_distribution_major_version is version('8', '>=') + + - name: Build containers for CentOS 7 + when: ansible_distribution_major_version is version('8', '<') + block: + + - name: Include pre tasks from build-containers role + vars: + buildcontainers_venv: false + include_role: + name: build-containers + tasks_from: pre + + - name: Check for gating repo + stat: + path: "/etc/yum.repos.d/gating.repo" + register: new_repo + + - name: Set proper repos + set_fact: + buildcontainers_rpm_setup_config: >- + http://{{ ansible_default_ipv4.address }}/delorean.repo, + http://{{ ansible_default_ipv4.address }}/delorean-current.repo, + {% if new_repo.stat.exists %} + http://{{ ansible_default_ipv4.address }}/gating.repo, + {% endif %} + {% if release in ['queens'] %} + http://{{ ansible_default_ipv4.address }}/quickstart-centos-ceph-luminous.repo, + http://{{ ansible_default_ipv4.address }}/quickstart-centos-extras.repo, + http://{{ ansible_default_ipv4.address }}/quickstart-centos-opstools.repo, + http://{{ ansible_default_ipv4.address }}/quickstart-centos-updates.repo, + http://{{ ansible_default_ipv4.address }}/quickstart-centos7-rt.repo, + {% else %} + http://{{ ansible_default_ipv4.address }}/delorean-{{ ci_branch }}-build-deps.repo, + {% endif %} + http://{{ ansible_default_ipv4.address }}/quickstart-centos-qemu.repo, + http://{{ ansible_default_ipv4.address }}/delorean-{{ ci_branch }}-deps.repo + + - name: Build containers for provider job + vars: + buildcontainers_venv: false + include_role: + name: build-containers + tags: + - standalone + - undercloud diff --git a/playbooks/multinode-standalone-pre.yml b/playbooks/multinode-standalone-pre.yml index 0fc6c05f1..d64e9e53d 100644 --- a/playbooks/multinode-standalone-pre.yml +++ b/playbooks/multinode-standalone-pre.yml @@ -46,59 +46,4 @@ tags: - build -- name: Build containers for content provider job - hosts: undercloud - tasks: - - name: Build containers for CentOS 8 - include_role: - name: standalone - tasks_from: containers - apply: - tags: - - standalone - when: ansible_distribution_major_version is version('8', '>=') - - - name: Build containers for CentOS 7 - when: ansible_distribution_major_version is version('8', '<') - block: - - - name: Include pre tasks from build-containers role - vars: - buildcontainers_venv: false - include_role: - name: build-containers - tasks_from: pre - - - name: Check for gating repo - stat: - path: "/etc/yum.repos.d/gating.repo" - register: new_repo - - - name: Set proper repos - set_fact: - buildcontainers_rpm_setup_config: >- - http://{{ ansible_default_ipv4.address }}/delorean.repo, - http://{{ ansible_default_ipv4.address }}/delorean-current.repo, - {% if new_repo.stat.exists %} - http://{{ ansible_default_ipv4.address }}/gating.repo, - {% endif %} - {% if release in ['queens'] %} - http://{{ ansible_default_ipv4.address }}/quickstart-centos-ceph-luminous.repo, - http://{{ ansible_default_ipv4.address }}/quickstart-centos-extras.repo, - http://{{ ansible_default_ipv4.address }}/quickstart-centos-opstools.repo, - http://{{ ansible_default_ipv4.address }}/quickstart-centos-updates.repo, - http://{{ ansible_default_ipv4.address }}/quickstart-centos7-rt.repo, - {% else %} - http://{{ ansible_default_ipv4.address }}/delorean-{{ ci_branch }}-build-deps.repo, - {% endif %} - http://{{ ansible_default_ipv4.address }}/quickstart-centos-qemu.repo, - http://{{ ansible_default_ipv4.address }}/delorean-{{ ci_branch }}-deps.repo - - - name: Build containers for provider job - vars: - buildcontainers_venv: false - include_role: - name: build-containers - tags: - - standalone - - undercloud +- import_playbook: content-provider-containers.yml