Use repo-setup when injecting repos

We still have one-off code from when we first implemented
devmode in the task that injects repos into downloaded images.

This code works only for the master-tripleo-ci release we use
for gating. In order to allow using other releases (like
master-consistent for promote), we need to instead use the
generic repo-setup role.

Closes-Bug: 1674799
Change-Id: Id7f22e5e386df0b80f1a4abd104e644f47bd14d3
This commit is contained in:
John Trowbridge 2017-05-15 13:16:20 +00:00
parent 88a27f70c4
commit aaf88f4c00
4 changed files with 19 additions and 60 deletions

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Updated repo injection code to use the repo-setup role. This allows for
configuring what repos get injected to the provided images rather than
relying on hardcoded repo setup.

View File

@ -221,3 +221,6 @@ run_tripleo_validations_negative_tests: False
# Exit tripleo-quickstart on validations failures
exit_on_validations_failure: False
# Update undercloud and overcloud images with the repos provided via the
# release config.
update_images: true

View File

@ -1,49 +1,4 @@
# we download all the repos first to make sure that undercloud and overcloud
# are tested with the same repos
- name: download delorean repos for master
get_url:
url: "{{ item.url }}"
dest: "{{ item.dest }}"
with_items:
- url: "https://trunk.rdoproject.org/centos7/current/delorean.repo"
dest: "{{working_dir}}/delorean-current.repo"
- url: "https://trunk.rdoproject.org/centos7-master/current-tripleo/delorean.repo"
dest: "{{working_dir}}/delorean.repo"
- url: "https://trunk.rdoproject.org/centos7/delorean-deps.repo"
dest: "{{working_dir}}/delorean-deps.repo"
- name: alter repos name
replace:
dest: "{{ item.dest }}"
regexp: "\\[delorean\\]"
replace: "{{ item.replace }}"
with_items:
- dest: "{{working_dir}}/delorean-current.repo"
replace: "[delorean-current]"
- dest: "{{working_dir}}/delorean.repo"
replace: "[delorean-tripleo]"
- name: alter repo priority
replace:
dest: "{{ item.dest }}"
regexp: "priority=.*"
replace: "{{ item.replace }}"
with_items:
- dest: "{{working_dir}}/delorean-current.repo"
replace: "priority=10"
- dest: "{{working_dir}}/delorean.repo"
replace: "priority=20"
- dest: "{{working_dir}}/delorean-deps.repo"
replace: "priority=30"
- name: specify packages from delorean-current
lineinfile:
dest: "{{working_dir}}/delorean-current.repo"
state: present
insertafter: EOF
line: "includepkgs=diskimage-builder,instack,instack-undercloud,os-apply-config,os-collect-config,os-net-config,os-refresh-config,python-tripleoclient,openstack-tripleo-common*,openstack-tripleo-heat-templates,openstack-tripleo-image-elements,openstack-tripleo,openstack-tripleo-puppet-elements,openstack-puppet-modules,openstack-tripleo-ui,openstack-tripleo-docs,puppet-*"
---
- name: get all qcow2 images
find:
path: "{{ working_dir }}"
@ -51,18 +6,12 @@
register: qcow_images
- name: upload repos on the images
command: >
virt-customize -v --smp 2 -m 4096 -a {{ item.path }}
--delete '/etc/yum.repos.d/delorean*'
--delete '/etc/yum.repos.d/epel*'
--upload delorean-current.repo:/etc/yum.repos.d/delorean-current.repo
--upload delorean.repo:/etc/yum.repos.d/delorean.repo
--upload delorean-deps.repo:/etc/yum.repos.d/delorean-deps.repo
args:
chdir: "{{ working_dir }}"
environment:
LIBGUESTFS_BACKEND: direct
LIBVIRT_DEFAULT_URI: "{{ libvirt_uri }}"
include_role:
name: repo-setup
vars:
repo_inject_image_path: "{{ item.path }}"
repo_run_live: false
repo_setup_dir: "{{ working_dir }}"
with_items: "{{ qcow_images.files | default([]) }}"
changed_when: true

View File

@ -39,10 +39,11 @@
name: fetch-images
# Conditionally include a playbook for all the images specified
# in options that updates images to the latest delorean version
# in options that updates images with the repos provided via the
# release config.
- include: inject_repos.yml
static: no
when: devmode|bool
when: update_images|bool
# inject the gating repo generated by ansible-role-tripleo-gate
- include: inject_gating_repo.yml