add feature to execute repoclosure
* execute repoclosure directly after the repos are setup * if zuul.repoclosure is defined, stop multinode-standalone.yml from fully executing. * new playbook add in 785690 that exits after repoclosure Depends-On: https://review.opendev.org/c/openstack/tripleo-ci/+/785690 Change-Id: I420d04c4ae83f8471a2cdd8db1a1d1fa5db63e30
This commit is contained in:
parent
d6b7ec625a
commit
b0d8b11297
32
playbooks/multinode-standalone-repoclosure.yml
Normal file
32
playbooks/multinode-standalone-repoclosure.yml
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
- name: Add the overcloud nodes to the generated inventory
|
||||
hosts: undercloud
|
||||
gather_facts: true
|
||||
tags:
|
||||
- standalone
|
||||
vars:
|
||||
inventory: multinode
|
||||
roles:
|
||||
- tripleo-inventory
|
||||
|
||||
- name: Enable nested virtualization on the host
|
||||
hosts: undercloud
|
||||
gather_facts: true
|
||||
roles:
|
||||
- parts/kvm
|
||||
tags:
|
||||
- nested_virt
|
||||
|
||||
- name: Prepare the undercloud for installation
|
||||
hosts: undercloud
|
||||
roles:
|
||||
- undercloud-setup
|
||||
tags:
|
||||
- standalone
|
||||
|
||||
- name: Test available repos for repoclosure
|
||||
hosts: undercloud
|
||||
roles:
|
||||
- repoclosure
|
||||
tags:
|
||||
- standalone
|
61
roles/repoclosure/README.md
Normal file
61
roles/repoclosure/README.md
Normal file
@ -0,0 +1,61 @@
|
||||
repoclosure
|
||||
================
|
||||
|
||||
This role will execute repoclosure against the enabled repos on a system.
|
||||
It runs repoclosure per repo to better determine what needs to be fixed in the
|
||||
yum repo.
|
||||
|
||||
You can exclude certain repos w/ the *repoclosure_exclude_repos* variable.
|
||||
You can exclude certain packages via excludepkgs w/ *repoclosure_exclude_pkgs*
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
Available yum repos
|
||||
|
||||
Role Variables
|
||||
--------------
|
||||
|
||||
repoclosure_script_source: <repoclosure.sh.j2> the jina template used
|
||||
repoclosure_script: <repoclosure.sh> out of jinja2 template
|
||||
repoclosure_log: the log file
|
||||
repoclosure_exclude_repos: a list of repos that are not worthy of repoclosure.
|
||||
repoclosure_include_repos:
|
||||
- "--enablerepo delorean-*"
|
||||
- "--enablerepo quickstart-*"
|
||||
- "--enablerepo advanced-virt*"
|
||||
- "--enablerepo centos-rabbitmq*"
|
||||
- "--enablerepo centos-opstools"
|
||||
- "--enablerepo centos-nfv-ovs"
|
||||
repoclosure_exclude_pkgs:
|
||||
- "*-test*"
|
||||
- "*.src"
|
||||
- "*-devel"
|
||||
- "*-debug"
|
||||
- "*-docs"
|
||||
|
||||
|
||||
Dependencies
|
||||
------------
|
||||
|
||||
This role has no dependencies.
|
||||
Example Playbook
|
||||
----------------
|
||||
|
||||
1. Sample playbook to call the role
|
||||
|
||||
- name: Set up CentOS undercloud node to run TripleO Quickstart
|
||||
hosts: undercloud
|
||||
gather_facts: false
|
||||
roles:
|
||||
- repoclosure
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Apache-2.0
|
||||
|
||||
Author Information
|
||||
------------------
|
||||
|
||||
RDO-CI Team
|
47
roles/repoclosure/defaults/main.yml
Normal file
47
roles/repoclosure/defaults/main.yml
Normal file
@ -0,0 +1,47 @@
|
||||
---
|
||||
repo_setup_dir: "{{ working_dir }}"
|
||||
repoclosure_script_source: repoclosure.sh.j2
|
||||
repoclosure_script: repoclosure.sh
|
||||
repoclosure_log: repoclosure.log
|
||||
repoclosure_include_repos:
|
||||
- "--enablerepo delorean-*"
|
||||
- "--enablerepo quickstart-*"
|
||||
- "--enablerepo advanced-virt*"
|
||||
- "--enablerepo centos-rabbitmq*"
|
||||
- "--enablerepo centos-opstools"
|
||||
- "--enablerepo centos-nfv-ovs"
|
||||
repoclosure_exclude_pkgs:
|
||||
- "*-test*"
|
||||
- "*.src"
|
||||
- "*-devel"
|
||||
- "*-debug"
|
||||
- "*-docs"
|
||||
# the following packages are probably package bugs
|
||||
- python3-oslotest
|
||||
- python3-mox3
|
||||
- python3-stackviz
|
||||
- python3-tobiko
|
||||
- openstack-tempest-all
|
||||
- python3-sahara-tempest
|
||||
- python3-tempest
|
||||
- openstack-tempest
|
||||
- python3-tempestconf
|
||||
- openstack-tripleo-common
|
||||
- openstack-tripleo-common-devtools
|
||||
- openstack-tripleo-heat-templates
|
||||
- python3-tripleoclient
|
||||
- ksc
|
||||
- awscli
|
||||
- ansible-tripleo-powerflex
|
||||
# repos that are enabled but not required to check
|
||||
repoclosure_exclude_repos:
|
||||
- advanced-virtualization
|
||||
- centos-opstools
|
||||
- quickstart-centos-opstools
|
||||
- centos-rabbitmq-38
|
||||
- delorean-master-testing
|
||||
- quickstart-centos-appstreams
|
||||
- quickstart-centos-ceph-octopus
|
||||
- quickstart-centos-powertools
|
||||
- centos-nfv-ovs
|
||||
- delorean-master-build-deps
|
3
roles/repoclosure/meta/main.yml
Normal file
3
roles/repoclosure/meta/main.yml
Normal file
@ -0,0 +1,3 @@
|
||||
---
|
||||
dependencies:
|
||||
- extras-common
|
5
roles/repoclosure/tasks/main.yml
Normal file
5
roles/repoclosure/tasks/main.yml
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
# execute and log repoclosure
|
||||
- name: execute repoclosure
|
||||
include: repoclosure.yml
|
||||
when: job.repoclosure is defined or repoclosure is defined
|
33
roles/repoclosure/tasks/repoclosure.yml
Normal file
33
roles/repoclosure/tasks/repoclosure.yml
Normal file
@ -0,0 +1,33 @@
|
||||
---
|
||||
# The following two tasks turn a standalone
|
||||
# deployment into a single purpose job
|
||||
# setup repos and test for repoclosure.
|
||||
|
||||
# execute and log repoclosure
|
||||
# stops execution when failed: if zuul.repoclosure
|
||||
# or repoclosure is defined
|
||||
# if this passes continue
|
||||
- name: register enabled yum repos
|
||||
shell: dnf repolist | awk '{print $1}'
|
||||
register: yum_repos
|
||||
changed_when: true
|
||||
|
||||
- name: debug register yum_repos
|
||||
debug:
|
||||
var: yum_repos.stdout_lines
|
||||
|
||||
- name: Create repoclosure script
|
||||
template:
|
||||
src: "{{ repoclosure_script_source }}"
|
||||
dest: "{{ repo_setup_dir }}/{{ repoclosure_script }}"
|
||||
mode: 0755
|
||||
changed_when: true
|
||||
|
||||
- name: Execute repoclosure to ensure rpms are installable
|
||||
shell: >
|
||||
set -o pipefail &&
|
||||
{{ repo_setup_dir }}/{{ repoclosure_script }} 2>&1 {{ timestamper_cmd }}
|
||||
| tee -a {{ repo_setup_dir }}/{{ repoclosure_log }}
|
||||
become: true
|
||||
no_log: result.rc == 0
|
||||
changed_when: result.rc == 0
|
35
roles/repoclosure/templates/repoclosure.sh.j2
Normal file
35
roles/repoclosure/templates/repoclosure.sh.j2
Normal file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
set -x
|
||||
set -o pipefail
|
||||
|
||||
### --start_docs
|
||||
## Execute repoclosure w/ options
|
||||
## ==============================
|
||||
|
||||
## * run repoclosure
|
||||
## ::
|
||||
|
||||
EXIT_CODE=0
|
||||
|
||||
{% for repo_name in yum_repos.stdout_lines %}
|
||||
|
||||
echo "*********************** repo: {{ repo_name }} *****************"
|
||||
{% if repo_name in repoclosure_exclude_repos %}
|
||||
|
||||
echo "skipping, {{ repo_name }} is in var repoclosure_exclude_repos"
|
||||
|
||||
{% else %}
|
||||
|
||||
dnf repoclosure --newest --check {{ repo_name }} --disablerepo '*' \
|
||||
{{ repoclosure_include_repos|join(' ') }} \
|
||||
--excludepkgs {{ repoclosure_exclude_pkgs|join(',') }}
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
EXIT_CODE=1
|
||||
fi
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
exit $EXIT_CODE
|
||||
### --stop_docs
|
@ -39,6 +39,9 @@
|
||||
- ^roles/ipa-multinode.*$
|
||||
- ^roles/standalone.*$
|
||||
- ^playbooks/multinode-standalone-ipa.yml.*$
|
||||
- tripleo-ci-centos-8-repoclosure:
|
||||
files:
|
||||
- ^roles/repoclosure.*$
|
||||
gate:
|
||||
queue: tripleo
|
||||
jobs:
|
||||
|
Loading…
Reference in New Issue
Block a user