Retire Tripleo: remove repo content

TripleO project is retiring
- https://review.opendev.org/c/openstack/governance/+/905145

this commit remove the content of this project repo

Depends-On: https://review.opendev.org/c/openstack/ansible-role-collect-logs/+/910044
Depends-On: https://review.opendev.org/c/openstack/neutron/+/910099

Change-Id: I338ed19678cf4a6248c46551bdf9cb23abc511bd
This commit is contained in:
Ghanshyam Mann 2024-02-24 11:32:53 -08:00 committed by Ghanshyam
parent a45099a746
commit a606c60efc
182 changed files with 8 additions and 16518 deletions

View File

@ -1,15 +0,0 @@
---
exclude_paths:
- roles/validate-ui/.travis.yml
- roles/oooci-build-images/tasks/main.yaml # the role 'discover-latest-image' was not found
parseable: true
quiet: false
skip_list:
- empty-string-compare # https://github.com/ansible/ansible-lint/issues/457
- role-name # Role name run-test does not match ``^[a-z][a-z0-9_]+$`` pattern
- risky-file-permissions # File permissions unset or incorrect
- package-latest
- document-start
verbosity: 1
mock_modules:
- zuul_return

24
.gitignore vendored
View File

@ -1,24 +0,0 @@
tripleo-jobs.db
tripleo-jobs.html
tripleo-jobs.html-table
*.swp
*~
scripts/website/out_html/
scripts/website/reviewday/
scripts/website/tripleo-ci/
scripts/website/tripleo-docs/
scripts/website/tripleosphinx/
scripts/website/planet-2.0/
scripts/website/planet.html.tmplc
.eggs/
.tox/
.coverage
.pytest_cache/
__pycache__/
scripts/emit_releases_file/assets/
*.pyc
scripts/emit_releases_file/htmlcov/
scripts/emit_releases_file/pytest-report.html
tripleo_ci.egg-info/
.cache

View File

@ -1,51 +0,0 @@
---
repos:
- repo: https://github.com/python/black.git
rev: 22.10.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pycqa/flake8.git
rev: 5.0.4
hooks:
- id: flake8
additional_dependencies:
- flake8-black>=0.1.1
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
- id: check-byte-order-marker
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: debug-statements
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/pycqa/flake8
rev: '5.0.4'
hooks:
- id: flake8
- repo: https://github.com/ansible/ansible-lint.git
rev: v6.16.0
hooks:
- id: ansible-lint
always_run: true
pass_filenames: false
additional_dependencies:
- ansible-core
- yamllint
- repo: https://github.com/openstack-dev/bashate.git
rev: 2.1.1
hooks:
- id: bashate
entry: bashate --error . --ignore=E006,E040
# Run bashate check for all bash scripts
# Ignores the following rules:
# E006: Line longer than 79 columns (as many scripts use jinja
# templating, this is very difficult)
# E040: Syntax error determined using `bash -n` (as many scripts
# use jinja templating, this will often fail and the syntax
# error will be discovered in execution anyway)

View File

@ -1,6 +0,0 @@
---
extends: default
rules:
line-length:
max: 180

View File

@ -1,188 +1,10 @@
toci
====
This project is no longer maintained.
Description
-----------
The contents of this repository are still available in the Git
source code management system. To see the contents of this
repository before it reached its end of life, please check out the
previous commit with "git checkout HEAD^1".
TripleO CI test framework.
Tools to help run CI jobs for TripleO. Includes things like:
* Shell scripts to help execute jobs on CI slave nodes (Jenkins slaves)
* A test environment broker framework which uses a client-server
model to execute jobs on a remote bare metal machine in an isolated
test environment (using VMs).
* Image elements to help build images for the test environment
broker nodes.
* Heat templates to help deploy and maintain test environment nodes
using an undercloud.
* Helper script(s) to generate CI status reports. (tox -ecireport -- -f)
* Helper `getthelogs` script to download important job logs locally.
Then you may want to inspect the logs for known errors and contribute
discovered search patterns as the
`elastic-recheck queries <https://opendev.org/opendev/elastic-recheck/src/branch/master/queries>`_.
OpenStack Infrastructure is deploying multiple jobs with different scenarios.
OpenStack services are balanced between different scenarios because OpenStack
Infastructure Jenkins slaves can not afford the load of running everything on
the same node.
Usage Details
-------------
On March 2017, the ansible quickstart framework was added to TOCI to gradually
replace the bash scripts that drove the jobs. Part of the original framework has
been changed to allow the new framework to handle jobs, but maintaining
backwards compatibility with the original framework while jobs are being
transitioned
TOCI entry point
~~~~~~~~~~~~~~~~
Upon starting a job, based on the configuration of its layout, zuul will call
devstack-gate, which is needed for the basic nodepool node setup, but will then
pass the control to ``toci_gate_test.sh``.
During the transition, this will be a symbolic link to
``toci_gate_test-oooq.sh``.
Quickstart Transition scripts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The initial part of ``toci_gate_test-oooq.sh`` script decides whether to exec
the original workflow or continue with the quickstart workflow, based on the job
type passed down by zuul layout parameters. To move a job to the new quickstart
framework, it is enough to propose a change to zuul layout to add a "featureset"
keyword on its type.
When using the quickstart workflow, the rest of the script will assemble a set of
arguments to pass to quickstart scripts, based on the components of the job type
separated by dashes e.g. a job type value of "periodic-ovb-featureset001"
will make the script assemble arguments to deal with "ovb" provisioning,
and set featurset001 to be the test matrix for the job.
This script will also invoke the test environment broker to create the proper
ovb environment.
At the end the ``toci_gate_test-oooq.sh`` will pass control to
``toci_quickstart.sh`` script that will actually call quickstart with its
parameters.
Quickstart Framework
~~~~~~~~~~~~~~~~~~~~
``toci_quickstart.sh`` consists of three parts, setup, invocationo and logs
collection.
For more information about feature sets and test matrix please see
.. _Featureset Documentation: https://docs.openstack.org/developer/tripleo-quickstart/feature-configuration.html
from quickstart documentation
The new workflow uses the directory toci-quickstart/ to store TripleO ci specific
configurations, roles or playbooks for the quickstart workflow
The parts of quickstart under scripts/ are instead handled by the original
framework only
Original Framework
~~~~~~~~~~~~~~~~~~
Job parameters are configured in ``toci_gate_test-orig.sh``. Control passes to
one of the ``toci_instack_*.sh`` scripts (depending on the type of job being
run) which do environment-specific setup. These scripts then call
``scripts/deploy.sh`` to run the actual deployment steps. For most things,
``deploy.sh`` simply calls ``scripts/tripleo.sh`` with the appropriate
parameters.
In ascii art, the flow of the scripts would look like:
toci_gate_test -> toci_instack_* -> deploy.sh -> tripleo.sh
There's some additional complexity that this description glosses over, but
for the most part only tripleo-ci admins need to worry about it.
temprevert, cherry-pick, pin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are three functions available in tripleo-ci which can be used to alter
the git repos of non-tripleo projects that are used in tripleo-ci. They only
work on projects that are part of OpenStack. Use of these should
be avoided whenever possible as any changes made during a ci run will not
apply to regular users of TripleO. However, they can be useful for determining
which commit broke something, and in rare cases we may want to use them
until a project can sort out a problem itself.
To apply one of these functions during a ci run, add it to the appropriate
location in the ``toci_instack_*.sh`` script. There should be a comment that
says "Tempreverts/cherry-picks/pins go here."
.. note:: Do not include the bug number in the commit message where you
propose adding one of these functions. Any change whose commit
message includes a reference to the bug will not apply the function.
This is to allow testing of patches intended to fix the bug.
.. warning:: As of this writing, these functions all apply against the latest
master branch of the project in question. They do not respect
the current-tripleo repo versions.
* temprevert
Revert a commit from a project. Takes 3 parameters: project, commit id,
and bug number. Example::
temprevert neutron 2ad9c679ed8718633732da1e97307f9fd9647dcc 1654032
* pin
Pin to a commit from a project. This usually is not necessary now that our
repos are gated by the promotion jobs. Takes 3 parameters: project,
commit id, and bug number. Example::
pin neutron 2ad9c679ed8718633732da1e97307f9fd9647dcc 1654032
* cherrypick
Cherry-pick an active review from a project. Takes 3 parameters: project,
Gerrit refspec, and bug number. The Gerrit refspec can be found under the
download button of the change in question. Example::
cherrypick neutron refs/changes/49/317949/28 1654032
Service testing matrix
----------------------
The CI testing matrix for all scenarios is defined in
`tripleo-heat-templates <https://opendev.org/openstack/tripleo-heat-templates/src/branch/master/README.rst>`_.
This matrix describes the services that will run in each environment.
Feature testing matrix
----------------------
======================== ===== == =======
Feature nonha ha updates
------------------------ ----- -- -------
undercloud ssl X
overcloud ssl X
ceph X X
ipv4 net-iso X
ipv6 net-iso X
pacemaker X X
predictable placement X
introspection X
======================== ===== == =======
How to deprecate job?
---------------------
1. Move the job definition to zuul.d/deprecated-jobs.yaml
2. Change the parent job to 'tripleo-ci-deprecated'
3. Change the branches var value to 'none/deprecated'
4. Remove job usage from the project-templates and from projects.
Documentation
-------------
Please refer to the official `TripleO documentation
<https://docs.openstack.org/tripleo-docs/latest/#contributor-guide>`_
for details regarding TripleO CI.
Please refer to the official `TripleO Quickstart documentation
<https://docs.openstack.org/tripleo-quickstart/latest/>`_
for details regarding the tools used in TripleO CI.
For any further questions, please email
openstack-discuss@lists.openstack.org or join #openstack-dev on
OFTC.

View File

@ -1,5 +0,0 @@
# This is a cross-platform list tracking distribution packages needed by tests;
# see http://docs.openstack.org/infra/bindep/ for additional information.
libssl-dev [platform:dpkg]
openssl-devel [platform:redhat]

View File

@ -1 +0,0 @@
pytest_plugins = ['pytest_html']

View File

@ -1,265 +0,0 @@
#
# This file is autogenerated by pip-compile with python 3.9
# To update, run:
#
# pip-compile --output-file=constraints.txt --pip-args='-chttps://releases.openstack.org/constraints/upper/master' requirements.txt setup.py test-requirements.txt
#
ansi2html==1.6.0
# via
# -r test-requirements.txt
# molecule
ansible==2.9.23
# via -r test-requirements.txt
ansible-lint==5.0.12
# via molecule
appdirs==1.4.4
# via virtualenv
arrow==1.1.0
# via jinja2-time
attrs==21.2.0
# via pytest
bcrypt==3.2.0
# via paramiko
binaryornot==0.4.4
# via cookiecutter
bracex==2.1.1
# via wcmatch
cerberus==1.3.2
# via molecule
certifi==2021.5.30
# via requests
cffi==1.14.5
# via
# bcrypt
# cryptography
# pynacl
cfgv==3.3.0
# via pre-commit
chardet==4.0.0
# via
# binaryornot
# requests
click==8.0.1
# via
# click-help-colors
# cookiecutter
# molecule
click-help-colors==0.9
# via molecule
colorama==0.4.4
# via
# -r requirements.txt
# rich
# tripleo-ci (setup.py)
commonmark==0.9.1
# via rich
cookiecutter==1.7.3
# via molecule
coverage==5.5
# via pytest-cov
cryptography==3.4.7
# via
# ansible
# paramiko
distlib==0.3.2
# via virtualenv
docker==5.0.0
# via molecule-docker
enrich==1.2.6
# via
# ansible-lint
# molecule
execnet==1.9.0
# via pytest-xdist
filelock==3.0.12
# via virtualenv
greenlet==1.1.0
# via sqlalchemy
identify==2.2.10
# via pre-commit
idna==2.10
# via requests
iniconfig==1.1.1
# via pytest
jenkinsapi==0.3.11
# via
# -r requirements.txt
# tripleo-ci (setup.py)
jinja2==3.0.1
# via
# ansible
# cookiecutter
# jinja2-time
# molecule
jinja2-time==0.2.0
# via cookiecutter
markupsafe==2.0.1
# via jinja2
molecule[test]==3.3.4
# via
# -r test-requirements.txt
# molecule-containers
# molecule-docker
# molecule-podman
# pytest-molecule
molecule-containers==0.2.1
# via -r test-requirements.txt
molecule-docker==0.2.4
# via
# -r test-requirements.txt
# molecule-containers
molecule-podman==0.3.0
# via
# -r test-requirements.txt
# molecule-containers
more-itertools==8.8.0
# via pytest-plus
nodeenv==1.6.0
# via pre-commit
packaging==20.9
# via
# ansible-lint
# molecule
# pytest
paramiko==2.7.2
# via
# -r test-requirements.txt
# molecule
pbr==5.6.0
# via
# -r requirements.txt
# tripleo-ci (setup.py)
pexpect==4.8.0
# via molecule
pluggy==0.13.1
# via
# molecule
# pytest
poyo==0.5.0
# via cookiecutter
pre-commit==2.13.0
# via -r test-requirements.txt
ptyprocess==0.7.0
# via pexpect
py==1.10.0
# via
# pytest
# pytest-forked
pycparser==2.20
# via cffi
pygments==2.9.0
# via rich
pynacl==1.4.0
# via paramiko
pyparsing==2.4.7
# via packaging
pytest==6.2.4
# via
# -r test-requirements.txt
# molecule
# pytest-cov
# pytest-forked
# pytest-helpers-namespace
# pytest-html
# pytest-metadata
# pytest-mock
# pytest-plus
# pytest-testinfra
# pytest-verbose-parametrize
# pytest-xdist
pytest-cov==2.12.1
# via
# -r test-requirements.txt
# molecule
pytest-forked==1.3.0
# via pytest-xdist
pytest-helpers-namespace==2021.4.29
# via molecule
pytest-html==3.1.1
# via
# -r test-requirements.txt
# molecule
# pytest-molecule
pytest-metadata==1.11.0
# via pytest-html
pytest-mock==3.6.1
# via molecule
pytest-molecule==1.3.4
# via -r test-requirements.txt
pytest-plus==0.2
# via
# -r test-requirements.txt
# molecule
pytest-testinfra==6.4.0
# via molecule
pytest-verbose-parametrize==1.7.0
# via molecule
pytest-xdist==2.3.0
# via
# -r test-requirements.txt
# molecule
python-dateutil==2.8.1
# via arrow
python-slugify==5.0.2
# via cookiecutter
pytz==2021.1
# via jenkinsapi
pyyaml==5.4.1
# via
# -r test-requirements.txt
# ansible
# ansible-lint
# molecule
# molecule-containers
# pre-commit
requests==2.25.1
# via
# -r test-requirements.txt
# cookiecutter
# docker
# jenkinsapi
rich==10.4.0
# via
# ansible-lint
# enrich
# molecule
ruamel.yaml==0.17.10
# via ansible-lint
ruamel.yaml.clib==0.2.2
# via ruamel.yaml
six==1.16.0
# via
# bcrypt
# cookiecutter
# jenkinsapi
# pynacl
# pytest-verbose-parametrize
# python-dateutil
# tenacity
# virtualenv
sqlalchemy==1.4.19
# via
# -r requirements.txt
# tripleo-ci (setup.py)
subprocess-tee==0.3.2
# via molecule
tenacity==7.0.0
# via ansible-lint
text-unidecode==1.3
# via python-slugify
toml==0.10.2
# via
# pre-commit
# pytest
# pytest-cov
urllib3==1.26.5
# via requests
virtualenv==20.4.7
# via pre-commit
wcmatch==8.2
# via ansible-lint
websocket-client==1.1.0
# via docker
# The following packages are considered to be unsafe in a requirements file:
# setuptools

View File

@ -1,242 +0,0 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<title>README for Quickstart Logs</title>
</head>
<body>
<style>
.collapsible {
background-color: #777;
color: white;
cursor: pointer;
padding: 18px;
width: 100%;
border: none;
text-align: left;
outline: none;
font-size: 15px;
}
.active, .collapsible:hover {
background-color: #555;
}
.content {
padding: 0 18px;
max-height: 0;
overflow: hidden;
transition: max-height 0.2s ease-out;
background-color: #f1f1f1;
}
</style>
<h3>Links to important log files</h3>
<ul>
<li><a href='undercloud/var/log/extra/errors.txt.gz'>undercloud/var/log/extra/errors.txt.gz</a>
- the concatenation of all the errors on any node in a single file</li>
<li><a href='undercloud/home/zuul/'>undercloud/home/zuul/</a>
- the source and log output of all templated shell scripts</li>
<li><a href='undercloud/var/log/'>undercloud/var/log/</a> -
directories and files copied from /var/log on the undercloud.
If other overcloud/subnodes exist, similar $node/var/log
directories will also exist in these logs.</li>
<li><a href='undercloud/var/log/extra/'>undercloud/var/log/extra/</a> -
Available on each node, extra system details like package list, and cpu info gathered from the
undercloud</li>
<li> /var/log/messages is captured in the journal files in /var/log/extras on each node
</li>
<li><a href='undercloud/var/lib/mistral'>undercloud/var/lib/mistral</a>
- output of all ansible used by config-download to drive the overcloud deployment</li>
</ul>
<h3>Links yum repo and rpm info</h3>
<ul>
<li><a href='delorean_logs'>delorean_logs</a>
- Note: if content-providers are used, the rpm build is done on the content-provider.
The source code change is built into rpm and the build logs are here</li>
<li><a href='etc/yum.repos.d/gating.repo'>gating.repo</a>
- the yum repo where the gerrit change is built and provided. i.e. content-provider</li>
<li><a href='undercloud/etc/yum.repos.d/'>undercloud/etc/yum.repos.d/</a>
- link to the yum.repos.d directory </li>
<li><a href='undercloud/etc/yum.repos.d/delorean.repo'>undercloud/etc/yum.repos.d/delorean.repo</a>
- link to the delorean.repo ( the build ) </li>
<li><a href='undercloud/var/log/extra/rpm-list.txt.gz'>undercloud/var/log/extra/rpm-list.txt.gz</a>
- rpms installed to the undercloud, container rpms can be found in extra/<podman|docker>/containers/$container/info.log</li>
<li><a href='undercloud/etc/dnf/modules.d/'>undercloud/etc/dnf/modules.d/</a>
- link to yum module information </li>
</ul>
<h3>Links container log files</h3>
<ul>
<li><a href='undercloud/var/log/containers/'>undercloud/var/log/containers/</a>
- the system logs for each container</li>
<li><a href='undercloud/var/log/extra/podman/'>undercloud/var/log/extra/podman/</a>
- the podman container setup configuration and setup logs</li>
<li><a href='undercloud/var/log/extra/docker/'>undercloud/var/log/extra/docker/</a>
- the docker container setup configuration and setup logs</li>
<li><a href='undercloud/var/log/tripleo-container-image-prepare.log'>undercloud/var/log/tripleo-container-image-prepare.log</a>
- the container download, container update and provision log </li>
</ul>
<h3>Links to tempest results</h3>
<ul>
<li><a href='undercloud/var/log/tempest/'>undercloud/var/log/tempest/</a>
- Tempest run results logs </li>
<li><a href='undercloud/home/zuul/tempest/etc/'>undercloud/home/zuul/tempest/etc/</a>
- tempest.conf and tempest blacklist and whitelist tests </li>
<li><a href='stackviz/#/testrepository.subunit'>stackviz</a> - stackviz tempest test results</li>
</ul>
<h3>Links to puppet logs</h3>
<ul>
<li><a href='undercloud/var/lib/config-data/'>undercloud/var/lib/config-data/</a>
- the configuration files for each openstack service</li>
<li><a href='undercloud/etc/puppet/hieradata/'>undercloud/etc/puppet/hieradata/</a>
- the hieradata of the deployment, service-configs, net and vip info</li>
<lib><a href='undercloud/var/lib/container-puppet'>undercloud/var/lib/container-puppet</a>
- puppet config for each container
</ul>
<h3>SELinux Alerts</h3>
<ul>
<li><a href='undercloud/var/log/extra/selinux_denials_detail.txt'>selinux_denials_detail</a>
<li>Available on each node under /var/log/extra/selinux_denials_detail</li>
</ul>
<button class="collapsible">How to recreate this job</button>
<div class="content">
<p> Please refer to the <a href="README-reproducer.html">recreation
instructions</a>
</p>
</div>
<button class="collapsible">Additional logs for OVB jobs, a.k.a openstack virtual baremetal</button>
<div class="content">
<p>
Note: These logs are only available in jobs that use OVB.
<ul>
<li>
<a href='https://openstack-virtual-baremetal.readthedocs.io/en/latest/'>OpenStack Virtual Baremetal Documentation</a>
</li>
<li><a href='baremetal_0-console.log'>baremetal boot log</a>
- all the overcloud nodes should have boot logs associated e.g. baremetal_1, baremetal_2 etc.</li>
<li><a href='bmc-console.log'>baremetal controller log, a.k.a BMC</a></li>
<li><a href='overcloud-controller-0'>logs collected from overcloud-controller-[0-2] node</a></li>
<li><a href='overcloud-novacompute-0'>logs collected from the overcloud-novacompute-[0-1] node</a></li>
</p>
</div>
<button class="collapsible">How to figure out what went wrong?</button>
<div class="content">
<p> Check the base directory for a file called <b>*failure_reason*</b> for
automatic failure detection. If no known error has been found the file will
be named "No_failure_reason_found".
<p>Most of the undercloud and overcloud deployment log files can
be found in <a href='undercloud/home/zuul'>undercloud/home/zuul</a>
<b>tracebacks and other errors are collected in the following log per node:</b>
<ul>
<li><a href='undercloud/var/log/extra/errors.txt.gz'>undercloud/var/log/extra/errors.txt.gz</a>
- the concatenation of all the errors on any node in a single file</li>
</ul>
<p>Next check the console log and search for <b>PLAY RECAP</b>. There are sometimes
multiple ansible runs in a job, usually the last one is the relevant.
<br>If no <b>PLAY RECAP</b> text is found that usually means an infra failure
before Quickstart could even start.
<br>
If this is a different Ansible error, that could mean either an infra
problem (often has <b>UNREACHABLE</b> in the line) or a bug in Quickstart.
</p>
<p>
Ask on <i>#tripleo</i> to get help or open a bug on
<a href='https://bugs.launchpad.net/tripleo/+filebug'>Launchpad</a>. Add the
"ci" tag if it's a CI issue and "quickstart" if you suspect that the bug is in
Quickstart itself.</p>
Finally try rechecking or asking on <i>#tripleo</i>
</p>
</div>
<button class="collapsible">Variables used in the job run</button>
<div class="content">
<p>The logs contain files showing variables used in the job run.</p>
<ul>
<li><a href='undercloud/var/log/extra/dump_variables_vars.json.txt.gz'>undercloud/var/log/extra/dump_variables_vars.json.txt.gz</a>
- contains the variables used in the running the actual test</li>
<li><a href='releases.sh'>releases.sh</a>
- the output of the script setting release-related variables</li>
<li><a href='playbook_executions.log'>playbook_executions.log</a>
- prints out the complete commands, with all expanded arguments,
to run the playbooks</li>
</ul>
</div>
<button class="collapsible">Additional tools to help</button>
<div class="content">
<p> Upstream OpenStack Health, Elastic Search and Kibana
</p>
<ul>
<li><a href='http://status.openstack.org/elastic-recheck/'>http://status.openstack.org/elastic-recheck/</a>
- A tool to track the impact of known bugs in OpenStack CI</li>
<li><a href='http://logstash.openstack.org/#/dashboard/file/logstash.json'>http://logstash.openstack.org</a>
- filter in details in the log files from OpenStack CI</li>
<li><a href='http://status.openstack.org/openstack-health/#/?searchProject=tripleo'>OpenStack Health</a>
- upstream job results by project</li>
</ul>
<p> Tools that will help you spot a trend in TripleO CI
</p>
<ul>
<li><a href='http://dashboard-ci.tripleo.org/d/jobs/jobs-exploration?orgId=1&var-influxdb_filter=job_name%7C%3D%7Ctripleo-ci-centos-7-containers-multinode'>Job Exploration</a>
- check the job history across upstream clouds</li>
<li><a href='http://zuul.openstack.org/builds?job_name=tripleo-ci-centos-7-containers-multinode%09'>zuul job filter</a>
- zuul's job filter per job</li>
<li><a href='http://cistatus.tripleo.org/'>http://cistatus.tripleo.org</a>
- Overall check job status</li>
<li><a href='http://cistatus.tripleo.org/gates/'>http://cistatus.tripleo.org/gates/</a>
- Overall gate job status</li>
</ul>
<p>
Tools to compare one job to another.
<ul>
<li><a href='https://github.com/sshnaidm/jcomparison'>jcomparison</a>
- A tool to compare results from one job to another</li>
<li><a href='https://pypi.org/project/logreduce/'>log reduce</a>
- A tool that uses AI features to reduce the noise in logs and present only what is needed for debug</li>
</ul>
</p>
</div>
<button class="collapsible">Dry run option</button>
<div class="content">
<p>As a debugging step, a job can be run manually with '-dryrun'
appended to the job name. When the "playbook dry run" option is invoked,
the playbooks will not execute and collect logs will not run but
certain log files, including 'toci_env_args_output.log', which
contains the environment variables used in the job, and
playbook_executions.log will still be produced in the logs
directory for inspection. This option serves to assist with
debugging and to test the testing scripts themselves.</p>
</div>
<script>
var coll = document.getElementsByClassName("collapsible");
var i;
for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
this.classList.toggle("active");
var content = this.nextElementSibling;
if (content.style.maxHeight){
content.style.maxHeight = null;
} else {
content.style.maxHeight = content.scrollHeight + "px";
}
});
}
</script>
</body>
</html>

View File

@ -1,5 +0,0 @@
Job Name ,Pacemaker ,Reboot ,Upgrade ,NetIso V4 ,NetIso V6 ,Ceph Scale ,Swift Scale ,Block Scale ,External Ceph ,Ceph on Compute ,Cinder/RBD ,Nova/RBD ,Glance/RBD ,Cinder/NFS ,Glance/NFS ,Glance/Swift ,External LB ,Compute containers ,Public Endpoint TLS ,Internal services TLS
centos-7-updates ,x , ,x , ,x ,x , , , , ,x ,x ,x , , , , , , ,
centos-7-ha ,x ,o , ,x , , , , , , , , , , , ,x , , , ,
centos-7-nonha , , , , , ,x , , , ,o ,x ,x ,x , , , , , ,x ,
centos-7-containers , , , , , , , , , , , , , , , ,x , ,x , ,
1 Job Name Pacemaker Reboot Upgrade NetIso V4 NetIso V6 Ceph Scale Swift Scale Block Scale External Ceph Ceph on Compute Cinder/RBD Nova/RBD Glance/RBD Cinder/NFS Glance/NFS Glance/Swift External LB Compute containers Public Endpoint TLS Internal services TLS
2 centos-7-updates x x x x x x x
3 centos-7-ha x o x x
4 centos-7-nonha x o x x x x
5 centos-7-containers x x

View File

@ -1,2 +0,0 @@
This playbook prints a deprecation warning message to inform
that the job is no longer supported and should not be in use.

View File

@ -1,15 +0,0 @@
---
- name: Deprecation warning
hosts: all
gather_facts: false
tasks:
- name: Warn that the job is deprecated
debug:
msg: |
--------------------------------------------------------
D E P R E C A T E D J O B W A R N I N G
--------------------------------------------------------
This job is deprecated and is no longer supported.
Please DO NOT use this job in your Zuul config.
Refer to #tripleo irc channel on OFTC for more info.

View File

@ -1,2 +0,0 @@
This playbook writes a backwards compatible /etc/nodepool/provider file for
legacy jobs running on Zuul v3 which no longer provides that file.

View File

@ -1,27 +0,0 @@
---
- name: Configure /etc/nodepool/provider for backwards compatibility
hosts: all
gather_facts: false
tasks:
- name: Warn that /etc/nodepool/provider is deprecated
debug:
msg: |
The /etc/nodepool/provider file no longer exists and is being created
for backwards compatibility purposes. The variables provided by this
file are now available through Ansible under hostvars[$HOST]['nodepool'].
- name: Create /etc/nodepool it if does not exist
become: true
file:
path: /etc/nodepool
state: directory
mode: '0777'
- name: Create /etc/nodepool/provider file
copy:
content: |
NODEPOOL_PROVIDER={{ nodepool.provider }}
NODEPOOL_CLOUD={{ nodepool.cloud }}
NODEPOOL_REGION={{ nodepool.region }}
NODEPOOL_AZ={{ nodepool.az }}
dest: /etc/nodepool/provider

View File

@ -1,83 +0,0 @@
---
- hosts: all
gather_facts: false
tasks:
- name: Set IP addresses for the nodes missing private IPs
set_fact:
nodepool_ip: "{{ nodepool.public_ipv4 }}"
when: not (nodepool.private_ipv4 | ipv4)
- name: Set IP addresses for the nodes without private IPs (a fallback)
set_fact:
nodepool_ip: "{{ nodepool.private_ipv4 | default(nodepool.public_ipv4) }}"
when: nodepool_ip is not defined
- hosts: all
tasks:
- name: Create nodepool directory
file:
path: /etc/nodepool
state: directory
- name: Create nodepool sub_nodes file
copy:
dest: /etc/nodepool/sub_nodes
content: ""
- name: Create nodepool sub_nodes_private file
copy:
dest: /etc/nodepool/sub_nodes_private
content: ""
- name: Populate nodepool sub_nodes file
lineinfile:
path: /etc/nodepool/sub_nodes
line: "{{ hostvars[item]['nodepool']['public_ipv4'] }}"
with_items: "{{ groups['subnodes'] }}"
when: groups['subnodes'] is defined
- name: Populate nodepool sub_nodes_private file
lineinfile:
path: /etc/nodepool/sub_nodes_private
line: "{{ hostvars[item]['nodepool_ip'] }}"
insertafter: EOF
with_items: "{{ groups['subnodes'] }}"
when: groups['subnodes'] is defined
- name: Create nodepool primary file
copy:
dest: /etc/nodepool/primary_node_private
content: "{{ hostvars['primary']['nodepool_ip'] }}"
when: hostvars['primary'] is defined
- name: Create nodepool node_private for this node
copy:
dest: /etc/nodepool/node_private
content: "{{ nodepool_ip }}"
- name: Copy ssh keys to nodepool directory
command: "cp .ssh/{{ item }} /etc/nodepool/{{ item }}"
with_items:
- id_rsa
- id_rsa.pub
changed_when: true
- name: Add sudoers role for zuul-sudo-grep.sh
copy:
dest: /etc/sudoers.d/zuul-sudo-grep
content: "zuul ALL = NOPASSWD:/usr/local/jenkins/slave_scripts/zuul-sudo-grep.sh\n"
mode: 0440
become: true
- name: Validate sudoers config after edits
command: "/usr/sbin/visudo -c"
become: true
changed_when: false
- name: Show the environment passed in to job shell scripts
command: env
args:
executable: /bin/bash
warn: false
environment: '{{ zuul | zuul_legacy_vars }}'
changed_when: false

View File

@ -1,15 +0,0 @@
---
- hosts: all
tasks:
- name: Configure docker proxy
include_role:
name: use-docker-mirror
tasks_from: mirror
- name: Set fact of docker upstream
set_fact:
use_upstream_docker: false
- name: Install docker
include_role:
name: ensure-docker

View File

@ -1,7 +0,0 @@
---
- hosts: primary
tasks:
- name: Run build containers post tasks
include_role:
name: build-containers
tasks_from: post

View File

@ -1,70 +0,0 @@
---
- hosts: all
name: TripleO Setup Container Registry and repos mirror
tasks:
- name: Disable EPEL repos with dnf if exists
command: dnf config-manager --set-disabled "epel*"
become: true
changed_when: true
failed_when: false
when:
- ansible_pkg_mgr == "dnf"
- name: Disable EPEL repos with yum if exists
command: yum-config-manager --disable "epel*"
become: true
changed_when: true
failed_when: false
when:
- ansible_pkg_mgr == "yum"
- name: Container Build for 7 specific distros
when: ansible_distribution_major_version is version(7, '==')
block:
- name: Include tripleo-repos
include_role:
name: tripleo-repos
vars:
override_repos: "{{ buildcontainers_override_repos | default('') }}"
tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
# TODO: Move this setting to tripleo-repos yum module
- name: Enable supported container tools version
become: true
shell: |
{{ ansible_pkg_mgr }} module disable container-tools:rhel8 -y;
{{ ansible_pkg_mgr }} module enable container-tools:3.0 -y;
{{ ansible_pkg_mgr }} clean metadata
when: ansible_distribution_major_version is version(8, '==')
# workaround for LP #1950916
- name: Check if /etc/yum.repos.d/CentOS-Stream-AppStream.repo exists
stat:
path: /etc/yum.repos.d/CentOS-Stream-AppStream.repo
register: stat_appstream
- name: Exclude libvirt/qemu from AppStream repo
become: true
lineinfile:
dest: /etc/yum.repos.d/CentOS-Stream-AppStream.repo
line: "exclude=libvirt*,python*libvirt*,qemu*"
when:
- stat_appstream.stat.exists
- release is defined and release in ['master', 'wallaby']
- name: Include bindep role
include_role:
name: bindep
vars:
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(8, '>=')
include_role:
name: tripleo-build-jobs-repos
- name: Run build containers pre tasks
include_role:
name: build-containers
tasks_from: pre

View File

@ -1,34 +0,0 @@
---
- hosts: all
name: TripleO container image building job
tasks:
- 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:
name: tripleo-build-jobs-repos
tasks_from: load-vars
- name: Run repo-setup again to pickup c9 mirrors
include_role:
name: repo-setup
vars:
repo_setup_dir: "{{ workspace }}"
repo_setup_use_collections: false
- name: "build containers C8 and C9 for hash: {{ buildcontainers_version_hash }}"
include_role:
name: build-containers
vars:
buildcontainers_version_hash: "{{ dlrn_hash|default(omit) }}"
- name: Run build containers tasks
include_role:
name: build-containers
when: ansible_distribution_major_version is version('7', '==')
- name: Fail job if it's configured
fail:
msg: >-
Job has finished successfully, but forced to fail by force_job_failure variable
when: force_job_failure|default(false)|bool

View File

@ -1,7 +0,0 @@
---
- hosts: primary
tasks:
- name: Run build-images role post tasks (collect logs)
include_role:
name: oooci-build-images
tasks_from: post

View File

@ -1,44 +0,0 @@
---
- hosts: all
name: TripleO image building job pre.yaml
tasks:
- name: Disable EPEL repos with dnf if exists
command: dnf config-manager --set-disabled "epel*"
become: true
changed_when: true
failed_when: false
when:
- ansible_pkg_mgr == "dnf"
- name: Disable EPEL repos with yum if exists
command: yum-config-manager --disable "epel*"
become: true
changed_when: true
failed_when: false
when:
- ansible_pkg_mgr == "yum"
- name: Setup repos using repo-setup role and release file
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, '<')
include_role:
name: tripleo-repos
vars:
override_repos: "{{ build_override_repos | default('') }}"
tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
- name: Include bindep role
include_role:
name: bindep
vars:
bindep_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/python-tripleoclient'].src_dir }}"
- name: Import pre tasks from build-images role
include_role:
name: oooci-build-images
tasks_from: pre

View File

@ -1,26 +0,0 @@
---
- hosts: all
tasks:
- 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:
name: tripleo-build-jobs-repos
tasks_from: load-vars
- name: Run repo-setup again to pickup c9 mirrors
include_role:
name: repo-setup
vars:
repo_setup_dir: "{{ workspace }}"
repo_setup_use_collections: false
- name: Run image build using the build-images role
include_role:
name: oooci-build-images
- name: Fail job if it's configured
fail:
msg: >-
Job has finished successfully, but forced to fail by force_job_failure variable
when: force_job_failure | default(false) | bool

View File

@ -1,9 +0,0 @@
---
- hosts: all
tasks:
- name: remove removal of tmp files
become: true
lineinfile:
path: /usr/lib/tmpfiles.d/tmp.conf
regex: "(10|30)d"
state: absent

View File

@ -1,92 +0,0 @@
---
- hosts: all
vars:
workspace: "{{ ansible_user_dir }}"
tripleo_repos_repository: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
default_compose_url: >-
{%- if (ansible_distribution_major_version is version('8','==')) -%}
https://composes.centos.org/latest-CentOS-Stream-8/compose/
{%- else -%}
https://odcs.stream.centos.org/production/latest-CentOS-Stream/compose/
{%- endif -%}
compose_url: >-
{{
centos_compose_url |
default(job.centos_compose_url) |
default(default_compose_url)
}}
rpm_packages:
- dnf-utils
- git
- python3-libselinux
- python3-pip
- python3-setuptools
tasks:
- when: (job.dependency is defined and job.dependency == "centos-compose") or
(dependency is defined and dependency == "centos-compose")
block:
- name: Install system packages
become: true
package:
name: "{{ rpm_packages }}"
state: present
- name: Include dependency-related vars
include_vars: >-
{{ zuul.executor.work_root }}/{{
zuul.projects[
'opendev.org/openstack/tripleo-quickstart'
].src_dir
}}/config/release/dependency_ci/{{ dependency }}/repo_config.yaml
- name: Install tripleo-repos
vars:
ansible_python_interpreter: /usr/bin/python3
become: true
pip:
name: "{{ tripleo_repos_repository }}"
virtualenv: "{{ workspace }}/venv"
# https://github.com/ansible/ansible/issues/52275
virtualenv_command: "{{ ansible_python_interpreter }} -m venv"
virtualenv_site_packages: true
- name: Configure repos for CentOS Compose job
become: true
shell: |
set -exo pipefail
source {{ workspace }}/venv/bin/activate
# Populate CentOS compose repos
tripleo-yum-config enable-compose-repos \
--disable-all-conflicting \
--release centos-stream-{{ ansible_distribution_major_version }} \
--compose-url {{ compose_url }} \
--variants \
AppStream BaseOS HighAvailability \
{% if ansible_distribution_major_version is version("8", "==") -%}
PowerTools \
{% else -%}
CRB \
{% endif -%}
--disable-repos quickstart-centos-appstreams.repo quickstart-centos-base.repo \
quickstart-centos-highavailability.repo \
{% if ansible_distribution_major_version is version("8", "==") -%}
quickstart-centos-powertools.repo
{% else -%}
quickstart-centos-crb.repo
{% endif -%}
register: result
- name: Rebuild package database
become: true
command: rpm --rebuilddb
- name: Print out the stdout of result
debug:
msg: "{{ result }}"
- name: Update all installed packages after new repos are setup # noqa package-latest
become: true
package:
name: '*'
state: latest

View File

@ -1,6 +0,0 @@
---
- hosts: subnodes
name: Bootstrap subnodes - setup ceph-ansible /dev/loop3 /var/lib/ceph-osd.img
tasks:
- include_role:
name: ceph-loop-device

View File

@ -1,49 +0,0 @@
---
- hosts: all
vars:
gating_repo_loop_input: "{{ dict(registry_ip_address_branch|default({})) }}"
tasks:
- when: registry_ip_address_branch is defined
block:
- name: override gating_repo_loop_input if we have distro.keys
when:
- registry_ip_address_distro is defined
- registry_ip_address_distro.keys() | length > 1
set_fact:
gating_repo_loop_input: "{{ dict(registry_ip_address_distro) }}"
# Check if we have built something in content provider.
# If we did - create a gating-repo pointing to content provider. The
# port 8766 will be opened.
# If we didn't build, port 8766 will be closed - skip gating-repo creating.
- name: Check if we have a repo
wait_for:
timeout: 2
port: 8766
host: '{{ gating_repo_loop_input[item.key] }}'
register: waitfor
ignore_errors: true
loop: '{{ gating_repo_loop_input | dict2items }}'
# create the gating repo for any branch defined in
# registry_ip_address_branch.
# Allow the release config to appropriately enable the gating repo
# for the branch in use.
# related-review: https://review.opendev.org/ 763747
# LP: https://launchpad.net/bugs/1907122
- name: Create a repo if got registry IP from Zuul
become: true
when:
- server is not failed
copy:
dest: /etc/yum.repos.d/gating-repo-{{ server.item.key }}.repo
content: |
[gating-repo-{{ server.item.key }}]
name=Gating repository
baseurl=http://{{ server.item.value }}:8766/
enabled=1
gpgcheck=0
priority=1
loop: "{{ waitfor.results }}"
loop_control:
loop_var: server

View File

@ -1,138 +0,0 @@
---
- name: Return Zuul artifacts
hosts: primary
roles:
- tripleo-ci-post
- name: Write console log to localhost as fact zuul_console_json
hosts: localhost
tasks:
- name: capture console log json as fact
set_fact:
zuul_console_json: "{{ lookup('file', zuul.executor.log_root + '/job-output.json') }}"
- name: Generate build report for the container build
hosts: primary
tasks:
- name: "Create log directory"
file:
path: "{{ ansible_user_dir }}/workspace/logs"
state: directory
recurse: true
- name: Build report (content provider)
include_role:
name: build-containers
tasks_from: build-report
when:
- ansible_distribution_major_version is version('8', '>=')
- provider_job | default(false) | bool
- name: Check that the report.html exists
stat:
path: "{{ ansible_user_dir }}/workspace/logs/report.html"
register: stat_report_result
- name: Return report.html artifact to Zuul
zuul_return:
data:
zuul:
artifacts:
- name: "Build report"
url: "logs/report.html"
metadata:
type: build_report
when: stat_report_result.stat.exists
- name: Collect logs
hosts: primary
tasks:
- name: set collection timeout
set_fact:
collect_timeout_sec: "{{ zuul.post_timeout|default(3600) - copy_logs_time|default(300) }}"
- name: Copy zuul_console_json log to workspace for reproducer
copy:
content: "{{ hostvars['localhost'].zuul_console_json }}"
dest: "{{ ansible_user_dir }}/workspace/logs/zuul_console.json"
- name: Check for artifacts created by a previous collect_logs
stat:
path: "{{ ansible_user_dir }}/workspace/logs/undercloud"
register: undercloud_logs
# Collect logs in ovb needs to run before te broker deletes the overcloud nodes.
# if a timeout happens, collect logs will not run, overcloud nodes will get deleted
# and we'll not even get undercloud logs
# Check if we have and undercloud dir in logs. If not, launch collect logs.
# TODO(gcerami) find a way to run collect logs before te broker deletes the env in
# case of timeout.
- name: Remark of collect logs running before post in ovb
debug:
msg: "OVB job collect logs already run, not running collect_logs in post"
when: environment_type == "ovb" and undercloud_logs.stat.exists
- name: Run ansible playbook to collect logs for ovb jobs that weren't able to run collect logs
shell: |
if [[ -e {{ ansible_user_dir }}/workspace/logs/collect_logs.sh ]]; then
bash {{ ansible_user_dir }}/workspace/logs/collect_logs.sh
mv {{ ansible_user_dir }}/workspace/logs/collect_logs.sh {{ ansible_user_dir }}/workspace/logs/ovb_collect_logs.sh
fi
when: environment_type == "ovb" and not undercloud_logs.stat.exists
- name: Check script existence
stat:
path: "{{ ansible_user_dir }}/workspace/logs/collect_logs.sh"
register: collect_logs_path
- name: Collect logs with a timeout
block:
- name: Run ansible playbook to collect logs
command: |
timeout --preserve-status -s 15 \
-k {{ [collect_timeout_sec|int, 60]|sum|string }} {{ collect_timeout_sec|string }} \
bash {{ ansible_user_dir }}/workspace/logs/collect_logs.sh
when: collect_logs_path.stat.exists
register: collect_logs_run
rescue:
- name: warn when collect logs timed out (SIGTERM or SIGKILL used)
debug:
msg: "ERROR: Collect logs timed out"
when: collect_logs_path.stat.exists and (collect_logs_run.rc == 143 or collect_logs_run.rc == 137)
- name: warn when collect logs failed
debug:
msg: "ERROR: Collect logs failed, please check the logs"
when: collect_logs_path.stat.exists and collect_logs_run.rc != 143 and collect_logs_run.rc != 137
always:
- name: Ensure artifacts directory exists
file:
path: '{{ zuul.executor.work_root }}/artifacts'
state: directory
delegate_to: localhost
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
no_log: true
failed_when: false
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Fail job when logs collection fail and it's critical
fail:
msg: "ERROR: Collect logs failed and job is configured to fail!"
when:
- collect_logs_path.stat.exists
- collect_logs_run.rc != 0
- fail_logs_collection|default(false)|bool
- zuul.pipeline|default('') != 'gate'

View File

@ -1,6 +0,0 @@
---
- hosts: all
name: Common tasks for nodes preparation
roles:
- role: ci-common-vars
- role: prepare-node

View File

@ -1,72 +0,0 @@
---
- hosts: all
tasks:
- name: Collect only facts of network
setup:
gather_subset:
- network
- name: Discover an IPv4 for provider job
set_fact:
provider_ip: >-
{{ hostvars[groups.all[0]].ansible_host if hostvars[groups.all[0]].ansible_host
is match("[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+")
else hostvars[inventory_hostname]['ansible_default_ipv4']['address'] }}
- name: Discover the content-provider branch and set ci_branch
include_role:
name: build-containers
tasks_from: set_ci_branch.yml
- name: Combine override_repos with ci_branch variable
set_fact:
ci_branch: "{{ ci_branch + '-' + override_repos }}"
when: override_repos != ''
- name: Set branch variables
set_fact:
provider_job_branch: "{{ ci_branch }}"
registry_ip_address_branch: "{'{{ ci_branch }}': '{{ provider_ip }}'}"
registry_ip_address_distro: "{'{{ ansible_distribution_major_version }}': '{{ provider_ip }}'}"
- name: Check if DLRN tag was dumped in /tmp/container_build_id
stat:
path: /tmp/container_build_id
register: build_id
- name: Recover DLRN tag
when: build_id.stat.exists
block:
- name: Load file
slurp:
src: /tmp/container_build_id
register: dlrn_file
- name: Set fact for DLRN tag
set_fact:
provider_dlrn_hash_branch: "{'{{ ci_branch }}': '{{ dlrn_file['content'] | b64decode | trim }}'}"
provider_dlrn_hash_tag_branch: "{'{{ ci_branch }}': '{{ dlrn_file['content'] | b64decode | trim }}'}"
provider_dlrn_hash_distro: "{'{{ ansible_distribution_major_version }}': '{{ dlrn_file['content'] | b64decode | trim }}'}"
- name: Return Zuul data
debug:
msg: >-
Running podman registry and repository on
{{ provider_ip | default('nowhere') }}
for branch {{ ci_branch }} and DLRN tag {{ dlrn_hash|default('no tag') }}
- name: Set registry IP address
zuul_return:
data:
zuul:
pause: true
provider_dlrn_hash_branch: "{{ provider_dlrn_hash_branch|default('') }}"
provider_dlrn_hash_tag_branch: "{{ provider_dlrn_hash_tag_branch|default('') }}"
provider_job_branch: "{{ provider_job_branch }}"
registry_ip_address_branch: "{{ registry_ip_address_branch }}"
registry_ip_address_distro: "{{ registry_ip_address_distro }}"
provider_dlrn_hash_distro: "{{ provider_dlrn_hash_distro|default('') }}"
tags:
- skip_ansible_lint

View File

@ -1,6 +0,0 @@
---
- hosts:
- primary
roles:
- role: ci-common-vars
- role: run-test

View File

@ -1,70 +0,0 @@
---
- hosts:
- primary
- centos-7
name: Autoconverted job from tripleo legacy jobs
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- name: zuul-cloner
shell:
cmd: |
set -e
set -x
cat > clonemap.yaml << EOF
clonemap:
- name: openstack-infra/devstack-gate
dest: devstack-gate
EOF
/usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \
https://opendev.org \
openstack/devstack-gate
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
changed_when: true
- name: run safe-devstack-vm-gate-wrap.sh
shell:
cmd: |
set -e
set -x
export TOCI_JOBTYPE={{ toci_jobtype }}
export DISTRIBUTION={{ ansible_distribution }}
export DISTRIBUTION_MAJOR_VERSION={{ ansible_distribution_major_version }}
# ZUUL does not set these for periodic jobs
export ZUUL_BRANCH=${ZUUL_BRANCH:-master}
export ZUUL_REF=${ZUUL_REF:-None}
# Compatibility with zuul v3 variables
export JOB_NAME={{ zuul.job }}
export LOG_PATH={{ zuul.change[-2:] }}/{{ zuul.change }}/{{ zuul.patchset }}/{{ zuul.pipeline }}/{{ zuul.job }}/{{ zuul.build[:7] }}
export BRANCH_OVERRIDE="{{ branch_override | default('default') }}"
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
fi
export PYTHONUNBUFFERED=true
export DEVSTACK_GATE_TEMPEST=0
export DEVSTACK_GATE_HORIZON=1
export PROJECTS="openstack/tripleo-quickstart $PROJECTS"
export PROJECTS="openstack/tripleo-quickstart-extras $PROJECTS"
export PROJECTS="openstack/tripleo-upgrade $PROJECTS"
sudo chown -hR $(whoami) /opt/git
function gate_hook {
bash -xe /opt/stack/new/tripleo-ci/toci_gate_test.sh
}
export -f gate_hook
cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh
./safe-devstack-vm-gate-wrap.sh
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
changed_when: true

View File

@ -1,2 +0,0 @@
[tool.black]
skip-string-normalization = true

View File

@ -1,4 +0,0 @@
[pytest]
markers:
hookwrapper
optionalhook

View File

@ -1,5 +0,0 @@
pbr
# required to run scripts/tripleo-jobs.py
sqlalchemy
jenkinsapi
colorama

View File

@ -1,4 +0,0 @@
---
collections:
- name: community.general # molecule uses 'ini_file'
- name: ansible.posix

View File

@ -1,50 +0,0 @@
---
push_registry_port: 8787
push_registry: "127.0.0.1:{{ push_registry_port }}"
push_containers: "false"
kolla_base: "{{ ansible_distribution|lower }}"
kolla_base_image: "{{ kolla_base }}"
# DO NOT define a default for kolla_base_tag,
# this is here to notify of its availability as a parameter
# Kolla sets the default kolla tag on its own based on dstro
# and setting a different default breaks other distro dependent
# default (like the package manager)
# kolla_base_tag: latest
kolla_base_pull: true
use_buildah: false
buildcontainers_override_repos: ""
buildcontainers_rpm_setup_config: "http://{{ ansible_default_ipv4.address }}/delorean.repo,http://{{ ansible_default_ipv4.address }}/delorean-{{ ci_branch }}-testing.repo"
buildcontainers_venv: true
openstack_repo_name: delorean
container_cli_opt: ""
# component_ci_containers used by component-ci jobs to build e.g. nova only
# used together with component_ci_configs in vars/main
component_ci_containers: ""
openstack_git_root: "{{ ansible_user_dir }}/src/opendev.org/openstack"
# container prefix is generally centos for usptream and rhel for downstream
container_name_prefix: >-
{% if osp_branch is not defined and ci_branch in ['train'] -%}
{{ ansible_distribution|lower }}-binary
{%- else -%}
openstack
{%- endif -%}
# In order to use custom auth file for pushing containers to registry
# --authfile flag is used. The default auth file is
# /run/containers/0/auth.json, It will be auto
# generated on doing sudo buildah login -u <user> -p <pass>
# --authfile <dir/auth.json> registry url
# buildcontainers_authfile_path: '/run/containers/0/auth.json'
registry_namespace: >-
{% if osp_branch is defined -%}
tripleo{{ osp_branch }}
{%- else -%}
tripleo{{ ci_branch }}
{%- endif -%}
container_registry_image: quay.io/tripleoci/registry:2
provider_registry_port: 5001
container_exclude_distro: "{{ ansible_distribution|lower }}{{ ansible_distribution_major_version}}"
# Extra config needs to be passed to tcib tool
# https://docs.openstack.org/tripleo-ansible/latest/roles/role-tripleo_container_image_build.html#r-o-l-e-d-e-f-a-u-l-t-s
tcib_extra_config:
tcib_args:
TRIPLEO_ANSIBLE_REQ: /usr/share/openstack-tripleo-common-containers/container-images/kolla/tripleo-ansible-ee/requirements.yaml

View File

@ -1,63 +0,0 @@
# Copyright 2020 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import glob
import pytest
import subprocess
def _get_build_log(image):
"""
Retrieve the inidividual log filename for a given image
e.g. ./logs/container-builds/**/<image>-build.log
"""
# compose the log filename
log = f"{ image }-build.log"
# glob search in ./logs/container-builds/**/<image>-build.log
logfile = f"./{ pytest.logs_dir }/{ pytest.build_dir }/**/{ log }"
for f in glob.glob(logfile, recursive=True):
# return only first match
return f
# log not found, return glob string
return logfile
def test_container_is_built(image):
"""
Test if container image is built
"""
# image in skip list, skip the build check
if image in pytest.excluded_containers:
pytest.skip("container image excluded: {}".format(image))
# [TEST 1]: check if image exists
cmd = ['podman', 'images', image]
proc = subprocess.run(
cmd, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
# buildah images <image> should return 0 and image should be in stdout
assert image in proc.stdout and proc.returncode == 0, proc.stderr
print(proc.stdout)
# [TEST 2]: check if build log has errors
try:
# read log file
with open(_get_build_log(image), 'r') as build_log:
log = build_log.read()
# test if any error is found in the log
assert 'Error:' not in log, f"Image failed to build: { image }"
except IOError as err:
print(f"Warning: Build log not found: { err }")
# [TEST N+1]: additional tests can be added here

View File

@ -1,93 +0,0 @@
# Copyright 2020 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import glob
import pytest
from py.xml import html
BUILD_DIR = 'container-builds'
LOGS_DIR = 'logs'
EXCLUDE_CONTAINERS = 'containers-excluded.log'
def _get_build_link(funcargs):
"""
Retrieves the link of the build log for a given container
"""
# compose logfile to glob search
log = f"{ funcargs.get('image') }-build.log"
logfile = f"./{ LOGS_DIR }/{ BUILD_DIR }/**/{ log }"
for f in glob.glob(logfile, recursive=True):
# remove parent 'logs/' dir from the path
# link will be like ./container-builds/**/<image>-build.log
link = "./" + "/".join(f.split("/")[2:])
# return first log file as href link
return html.a(log, href=link)
# log file not found
return ""
def _get_excluded_containers_list():
"""
Retrieves the list of excluded images to skip the build
"""
try:
with open(EXCLUDE_CONTAINERS) as f:
excluded_containers_list = [line.strip() for line in f]
except IOError:
excluded_containers_list = []
return excluded_containers_list
def pytest_addoption(parser):
parser.addoption(
"--image",
action="append",
default=[],
help="list of container images to pass to test functions",
)
def pytest_generate_tests(metafunc):
if "image" in metafunc.fixturenames:
metafunc.parametrize("image", metafunc.config.getoption("image"))
def pytest_configure():
# these vars are visible from build-report.py functions
pytest.excluded_containers = _get_excluded_containers_list()
pytest.build_dir = BUILD_DIR
pytest.logs_dir = LOGS_DIR
@pytest.mark.optionalhook
def pytest_html_results_table_header(cells):
# this replaces the default 'Links' column in position #3
cells.insert(3, html.th('Build Log'))
cells.pop()
@pytest.mark.optionalhook
def pytest_html_results_table_row(report, cells):
if hasattr(report, 'build_log'):
# report.logs has the link of each build log
cells.insert(3, html.td(report.build_log))
@pytest.mark.hookwrapper
def pytest_runtest_makereport(item, call):
outcome = yield
report = outcome.get_result()
# get the link for a given image build log
report.build_log = _get_build_link(item.funcargs)

View File

@ -1,100 +0,0 @@
---
- name: Container build report
block:
- name: Move container-builds dir to workspace/logs
shell: "mv {{ ansible_user_dir }}/container-* ./logs/"
become: true
args:
chdir: "{{ workspace }}"
failed_when: false
- name: Set ci_branch for building containers check jobs
include_tasks: set_ci_branch.yml
- name: Set branch
set_fact:
branch: "{{ osp_branch | default(ci_branch) }}"
- name: fetch tripleo_containers.yaml into ansible controller
fetch:
src: "{{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common/container-images/tripleo_containers.yaml"
dest: "{{ zuul.executor.work_root }}/"
flat: true
- name: Load list of containers expected to build
include_vars:
file: "{{ zuul.executor.work_root }}/tripleo_containers.yaml"
- name: build list of expected images w/ prefix
set_fact:
expected_images: "{{ expected_images|default([]) + [item['imagename'].split(':')[0].split('/')[2]] }}"
when: item['image_source'] == "tripleo"
with_items: "{{ container_images }}"
- name: remove prefix from expected containers list
vars:
prefix: "{{ container_name_prefix }}-"
set_fact:
expected_containers: "{{ expected_containers|default([]) + [item | replace(prefix, '')] }}"
with_items: "{{ expected_images }}"
- name: Get list of excluded containers
shell: |
set -eux
echo {{ item }} >> {{ workspace }}/containers-excluded.log
with_items: "{{ exclude_containers[branch][container_exclude_distro] }}"
when: exclude_containers is defined and branch in exclude_containers
- name: Write containers-expected.log
lineinfile:
line: "{{ item }}"
path: "{{ workspace }}/containers-expected.log"
create: true
state: present
with_items: "{{ expected_containers }}"
- name: Get actual built containers
shell: |
set -eux
{{ container_cli | default('buildah') }} images | grep {{ container_name_prefix }} \
| tee {{ workspace }}/containers-built.log
become: true
- name: Copy build-report files
copy:
src: "files/{{ item }}"
dest: "{{ workspace }}"
with_items:
- build-report.py
- conftest.py
- name: construct images args
set_fact:
images_args: "{{ images_args | default('') + ' --image ' + item }}"
with_items: "{{ expected_containers }}"
- name: Install pytest
pip:
name: "{{ item }}"
virtualenv: "{{ workspace }}/venv_build"
virtualenv_command: '{{ ensure_pip_virtualenv_command }}'
with_items:
- pytest
- pytest-html
- name: install podman
become: true
package:
name: podman
state: present
- name: Execute build-report
shell: |
source "venv_build/bin/activate"
pytest --html=logs/report.html --self-contained-html {{ images_args }} build-report.py
args:
chdir: "{{ workspace }}"
become: true
ignore_errors: true

View File

@ -1,307 +0,0 @@
---
- name: Ensure logs directory exists
file:
path: '{{ workspace }}/logs'
state: directory
- name: Set ci_branch for building containers check jobs
include_tasks: set_ci_branch.yml
- name: Set facts for kolla-build.conf
set_fact:
push_registry: "{{ push_registry | default('127.0.0.1:8787') }}"
push_containers: "{{ push_containers | default(false) | bool }}"
container_config: ""
- name: Set arch_tag fact
set_fact:
# NOTE(mjturek): Push old style tag for x86_64 first to maintain compatibility.
arch_tag: "{{ '_' + ansible_architecture if ansible_architecture != 'x86_64' else ''}}"
- name: Check the contents of the openstack_repo_name repo
become: true
shell: >
set -o pipefail &&
cat /etc/yum.repos.d/{{ openstack_repo_name }}.repo |grep -o 'baseurl=' |wc -l
register: number_baseurl_lines
when: buildcontainers_version_hash is not defined
- name: Use baseurl if there is only one
when:
- buildcontainers_version_hash is not defined
- number_baseurl_lines.stdout|int == 1
block:
- name: Get contents of openstack repo baseurl for the version hash
become: true
shell: >
set -o pipefail &&
cat /etc/yum.repos.d/{{ openstack_repo_name }}.repo |awk -F= '/baseurl/ {print $2}'
register: baseurl
- name: Set version_hash fact
set_fact:
version_hash: "{{ baseurl.stdout.split('/')[-1] }}"
- name: Use the md5sum if there is more than one baseurl line
when:
- buildcontainers_version_hash is not defined
- number_baseurl_lines.stdout|int > 1
block:
- name: Get contents of openstack repo baseurl for the version hash
become: true
shell: md5sum /etc/yum.repos.d/{{ openstack_repo_name }}.repo | awk '{print $1}'
register: md5sum_repo
- name: Set version_hash fact
set_fact:
version_hash: "{{ md5sum_repo.stdout }}"
- name: Set version_hash fact if buildcontainers_version_hash is defined
set_fact:
version_hash: "{{ buildcontainers_version_hash }}"
when: buildcontainers_version_hash is defined
# collectd tries to disable epel and epel-modular repository, which doesn't
# exist, and so fail, this is just a dummy repository so the container won't
# fail.
- name: Add dummy epel and epel-module repository
become: true
when:
- ansible_pkg_mgr == "dnf"
- ansible_distribution|lower == "redhat"
yum_repository:
name: "{{ item }}"
description: Dummy epel repository
file: delorean_epel_dummy
baseurl: https://download.fedoraproject.org/pub/epel/$releasever/$basearch/
enabled: false
with_items:
- epel
- epel-modular
- name: grab kolla patch rhel8
when:
- ansible_pkg_mgr == "dnf"
- ansible_distribution|lower == "redhat"
- zuul_internal is undefined
shell: |
set -euxo pipefail
git config --global user.email "zuul@openstack.org"
git config --global user.name "Zuul"
git remote add upstream https://review.opendev.org/openstack/kolla
git ls-remote https://review.opendev.org/openstack/kolla | \
grep -E refs/changes/[[:digit:]]+/{{ kolla_rhel8_patch[branch_override|default('master')] }}/ | \
awk '{print $2}' | \
sort -t / -k 5 -g -r | \
head -1 | \
xargs -I{} git fetch https://review.opendev.org/openstack/kolla {} && \
git checkout -b rhel8 FETCH_HEAD
# Look for Kolla changes running in check queue and if present then
# set the git_rebase branch as kolla change as are already clonned and
# can be grabbed from zuul.ref var otherwise use master.
git_rebase_branch={{ branch_override|default('master') }}
{% if zuul.ref is defined and zuul.ref and zuul.pipeline in ['check', 'openstack-check'] %}
found=$(git ls-remote https://review.opendev.org/openstack/kolla | grep {{ zuul.ref }} || true);
echo $found;
if [[ -n "$found" ]] ; then
git_rebase_branch={{ zuul.ref }}
fi
{% endif %}
git pull --rebase upstream $git_rebase_branch
args:
chdir: "{{ openstack_git_root }}/kolla"
warn: false
register: result
changed_when: "'nothing to commit, working directory clean' not in result.stdout_lines"
- include_tasks: venv_setup.yml
when: buildcontainers_venv is defined and buildcontainers_venv
- include_tasks: package_setup.yml
when: buildcontainers_venv is defined and not buildcontainers_venv
# TODO(aschultz): make the kolla-build branch aware
- name: Generate kolla-build.conf
template:
src: templates/kolla-build.conf.j2
dest: "{{ workspace }}/kolla-build.conf"
mode: 0644
force: true
- name: Set container cli
set_fact:
container_cli: "{% if use_buildah|bool %}buildah{% else %}docker{% endif %}"
cacheable: true
- name: Set --config-file for component-ci if component_ci_containers is specified
set_fact:
container_config: "--config-file {{ component_ci_configs[component_ci_containers] }}"
when: component_ci_containers != ""
- name: build base rhel container
block:
- name: create docker-build dir
file:
path: /tmp/base-build
state: directory
- name: create docker-build repos dir
file:
path: /tmp/base-build/repos
state: directory
- name: Move delorean repos to base build
become: true
shell:
cmd: |
{% if zuul_internal is defined %}
cp /etc/yum.repos.d/* /tmp/base-build/repos/
{% else %}
cp /etc/yum.repos.d/delorean* /tmp/base-build/repos/
{% endif %}
chown -R {{ ansible_user }}: /tmp/base-build/repos/*
- name: render dockerfile zuul_internal
when: zuul_internal is defined
template:
src: templates/Dockerfile_redhat.j2
dest: /tmp/base-build/Dockerfile
- name: create base container with repos from rhel container
shell:
cmd: |
set -x
sudo buildah --debug bud -t {{ kolla_base_image }}:{{ kolla_base_tag }} . \
2>&1 {{ timestamper_cmd }} > {{ workspace }}/build-rhel-base.log
args:
chdir: /tmp/base-build
when:
- ansible_distribution|lower == "redhat"
- kolla_base_image is defined
- kolla_base_tag is defined
- name: Make sure authfile exists
when: buildcontainers_authfile_path is defined
block:
- name: Check for authfile
stat:
path: '{{ buildcontainers_authfile_path }}'
register: authfile_exist
- name: Make sure autfile exists
assert:
that:
- authfile_exist.stat.exists | bool
- name: Generate tcib extra config file
copy:
dest: "{{ workspace }}/extra_config.yaml"
content: |
{{ tcib_extra_config | to_nice_yaml }}
- name: Generate kolla building script
template:
src: templates/kolla-build.sh.j2
dest: "{{ workspace }}/build_containers.sh"
mode: 0777
force: true
when: use_kolla | default(true)
- name: Generate tripleo building script
template:
src: templates/tripleo-build.sh.j2
dest: "{{ workspace }}/build_containers.sh"
mode: 0777
force: true
when: not use_kolla | default(true)
- name: "Run image build as ansible user > {{ workspace }}/logs/build.log"
args:
chdir: '{{ workspace }}'
shell: set -o pipefail && bash build_containers.sh 2>&1 {{ timestamper_cmd }} > {{ workspace }}/logs/build.log
when:
- ansible_distribution|lower != "redhat"
- name: "Run image build as root > {{ workspace }}/logs/build.log"
args:
chdir: '{{ workspace }}'
shell: set -o pipefail && bash build_containers.sh 2>&1 {{ timestamper_cmd }} > {{ workspace }}/logs/build.log
when:
- ansible_distribution|lower == "redhat"
become: true
# Workaround for https://bugs.launchpad.net/tripleo/+bug/1916742 as buildah is throwing warnings
- name: Check if "/usr/share/containers/libpod.conf" exists.
become: true
stat: path=/usr/share/containers/libpod.conf
register: libpod_conf_file_stat
- name: "Move /usr/share/containers/libpod.conf to /usr/share/containers/libpod.conf_backup"
become: true
command: mv /usr/share/containers/libpod.conf /usr/share/containers/libpod.conf_backup
when: libpod_conf_file_stat.stat.exists
- name: Retrieve built images # noqa risky-shell-pipe
shell: "{{ container_cli }} images | grep {{ container_name_prefix }} | awk '{ print $1 }'"
register: built_images
become: true
changed_when: false
- name: Retag and push x86_64 images
when:
- ansible_architecture == "x86_64"
- push_containers | bool
- not push_containers_podman | default(false) | bool
block:
- name: Disable HTTPS and certificates to access registry (buildah)
set_fact:
container_cli_opt: '--tls-verify=false'
when: use_buildah | bool
- name: Tag images
vars:
image: "{{ item }}"
include_tasks: tag.yaml
loop: "{{ built_images.stdout_lines }}"
become: true
- name: Run registry
when:
- job.provider_job|default(false)|bool
block:
- name: Run registry
shell: >-
$(command -v docker || command -v podman) run -d \
-e REGISTRY_HTTP_ADDR=0.0.0.0:{{ provider_registry_port }} \
-p {{ provider_registry_port }}:{{ provider_registry_port }} \
--name registry {{ container_registry_image }}
changed_when: true
rescue:
- name: Run registry (rescue)
shell: >-
$(command -v docker || command -v podman) run -d \
-e REGISTRY_HTTP_ADDR=0.0.0.0:{{ provider_registry_port }} \
-p {{ provider_registry_port }}:{{ provider_registry_port }} \
--name registry quay.rdoproject.org/ceph/registry:2
changed_when: true
become: true
- name: Populate provider registry
when:
- job.provider_job|default(false)|bool
block:
- name: Open ports
command: iptables -I INPUT -p tcp --dport 5001 -j ACCEPT
changed_when: true
- name: Disable HTTPS and certificates to access registry (buildah)
set_fact:
container_cli_opt: '--tls-verify=false'
when: use_buildah | bool
- name: Retag and push images to provider registry
vars:
image: "{{ item }}"
include_tasks: provider_push.yaml
loop: "{{ built_images.stdout_lines }}"
become: true

View File

@ -1,12 +0,0 @@
---
- name: Include OS distro version specific variables
include_vars: "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- name: install tripleo dependencies from package
become: true
package:
name: "{{ tripleo_deps_from_package }}"
- name: set template override
set_fact:
kolla_override_path: "/usr/share/openstack-tripleo-common-containers/container-images/tripleo_kolla_template_overrides.j2"

View File

@ -1,57 +0,0 @@
---
- name: Build report
include: build-report.yaml
when: not use_kolla | default(true)
- name: Grab job artifacts
become: true
args:
chdir: "{{ workspace }}"
shell: |
set -x
mkdir -p {{ workspace }}/conf/
mkdir -p {{ workspace }}/logs/system
mkdir -p {{ workspace }}/logs/httpd_data
mkdir -p {{ workspace }}/etc/ansible
mkdir -p {{ workspace }}/etc/docker
mkdir -p {{ workspace }}/etc/httpd
mv *.conf {{ workspace }}/conf/
mv {{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common/container-images/*_containers.yaml {{ workspace }}/conf/
mv *.log {{ workspace }}/logs/
mv *.html {{ workspace }}/logs/
mv *.sh {{ workspace }}/logs/
mv /tmp/kolla-* {{ workspace }}/logs/ || true
rsync -var --no-links /var/log/ {{ workspace }}/logs/system/ || true
rsync -var --no-links /etc/ansible/ {{ workspace }}/etc/ansible/ || true
rsync -var --no-links /etc/docker/ {{ workspace }}/etc/docker/ || true
rsync -var --no-links /etc/httpd/ {{ workspace }}/etc/httpd/ || true
rsync -var --no-links /var/www/html/ {{ workspace }}/logs/httpd_data/ || true
rsync -var --no-links /etc/containers/ {{ workspace }}/etc/containers/ || true
rsync -var --no-links --include 'yum.repos.d/***' --include 'yum.conf' --include 'dnf/***' --exclude='*' /etc/ {{ workspace }}/etc/ || true
# Collect installed packages
{{ ansible_pkg_mgr }} list installed &>{{ workspace }}/logs/system/installed_pkgs.txt
# Save some statistics
df -h &>{{ workspace }}/logs/system/disk_usage.txt
chmod -R a+r "{{ workspace }}"
chown -R {{ ansible_user }}: "{{ workspace }}"
changed_when: true
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
no_log: true
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/etc/**
- --include=/conf/**
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs

View File

@ -1,128 +0,0 @@
---
- name: Ensure legacy workspace directory
file:
path: '{{ workspace }}'
state: directory
- name: Setup docker registry
when:
- ansible_distribution|lower != 'redhat'
- ansible_distribution_major_version is version('8', '<')
- buildcontainers_venv | default(true) | bool or setup_docker_registry | default(false) | bool
block:
- name: Set registry_deploy to true only when needed
set_fact:
registry_deploy: true
when:
- push_containers is defined and push_containers | bool
- "'127.0.0.1' in push_registry or push_registry.split(':')[0] in ansible_all_ipv4_addresses"
- name: Configure docker registry
include_role:
name: ansible-role-container-registry
vars:
container_registry_docker_options: "--log-driver=journald --signature-verification=false --iptables=true --live-restore"
container_registry_port: "{{ push_registry_port | default('8787') }}"
container_registry_deploy_docker_distribution: "{{ registry_deploy | default(false) }}"
container_registry_deployment_user: "{{ ansible_user }}"
- include_tasks: reset_connection.yaml
when: not use_buildah | default(false) | bool
- name: Prepare Buildah
become: true
when: use_buildah | default(false) | bool
block:
- name: Install Buildah
package:
name: buildah
state: present
- name: Configure insecure registry
ini_file:
path: /etc/containers/registries.conf
section: 'registries.insecure'
option: registries
value:
- "localhost:{{ push_registry_port | default('5001') }}"
when: ansible_distribution_major_version is version(8, '==')
- name: Configure unqualified-search-registries
lineinfile:
path: /etc/containers/registries.conf
regexp: '^unqualified-search-registries'
line: "unqualified-search-registries = ['{{ push_registry }}',
'registry.access.redhat.com',
'registry.fedoraproject.org',
'registry.centos.org',
'docker.io']"
when: ansible_distribution_major_version is version(9, '==')
- name: Setup repo web service
become: true
when: ansible_distribution|lower != 'redhat'
block:
- name: Install apache
package:
name: httpd
state: present
- name: Start apache
service:
name: httpd
state: started
- name: Check if gating repo was built
stat:
path: /etc/yum.repos.d/gating.repo
register: gating
- name: Change gating repo for Kolla build
shell: |
cp /etc/yum.repos.d/gating.repo /var/www/html/
cp -r /opt/gating_repo /var/www/html/
sed -i "s@baseurl=.*@baseurl=http://{{ ansible_default_ipv4.address }}/gating_repo@g" /var/www/html/gating.repo
when: gating.stat.exists
- name: Fetch delorean repos if present
shell: |
set -ex
find /etc/yum.repos.d/ -name delorean\* -o -name quickstart-centos\* | xargs -I {} cp {} /var/www/html/
# TODO(chandan): Fix No chain/target/match by that name issue for EL9
- name: Add http iptables rules from containers
command: iptables -I openstack-INPUT 1 -p tcp --dport 80 -s 172.17.0.0/16 -j ACCEPT
become: true
when: ansible_distribution_major_version is version(9, '<')
- name: Setup tripleo registry
when:
- ansible_distribution|lower != 'redhat'
- ansible_distribution_major_version is version('8', '>=')
- use_buildah | default(false) | bool
block:
- name: Enable ports for httpd
seport:
ports:
- '80'
- "{{ push_registry_port | string }}"
proto: tcp
setype: http_port_t
state: present
- name: Setup Listen on default port for serving repo files
copy:
dest: /etc/httpd/conf.d/repos.conf
content: "Listen 80"
- name: set tripleo image serve role name for train
set_fact:
tripleo_image_serve_role: tripleo-image-serve
when:
(release is defined and release == 'train')
or (branch_override is defined and branch_override == 'stable/train')
or (ci_branch is defined and ci_branch == 'train')
- name: Configure tripleo registry
include_role:
name: "{{ tripleo_image_serve_role | default('tripleo_image_serve') }}"
vars:
tripleo_container_registry_port: "{{ push_registry_port | default('8787') }}"
become: true

View File

@ -1,11 +0,0 @@
---
# Tag and push in the same task for the sake of doing less tasks
- name: "Tag for provider registry and push image: {{ image }}"
command: >
{{ cmd }}
with_items:
- "{{ container_cli }} tag {{ image }}:{{ version_hash }} {{ image.replace(push_registry_port|string, '5001') }}:{{ version_hash }}"
- "{{ container_cli }} push {% if use_buildah|bool %}{{ container_cli_opt }}{% endif %} {{ image.replace(push_registry_port|string, '5001') }}:{{ version_hash }}"
loop_control:
loop_var: "cmd"
changed_when: true

View File

@ -1,3 +0,0 @@
---
- name: Reset connection because of group changes for current user
meta: reset_connection

View File

@ -1,30 +0,0 @@
---
- name: Set ci_branch from regular Zuul branch
set_fact:
ci_branch: "{{ zuul.branch | regex_replace('(stable|cloudsig)/', '') }}"
when: zuul is defined
- name: Set ci_branch from branch_override variable
set_fact:
ci_branch: "{{ branch_override | regex_replace('(stable|cloudsig)/', '') }}"
when: branch_override is defined
- name: Set ci_branch from release variable (in periodic)
set_fact:
ci_branch: "{{ release }}"
when: release is defined
- name: Set ci_branch for Downstream
set_fact:
ci_branch: "{{ osp_branch }}"
when: osp_branch is defined
- name: Set override_repos for buildcontainers_override_repos
set_fact:
override_repos: "{{ buildcontainers_override_repos | default('') }}"
- name: Fail if we did not set ci_branch fact
fail:
msg: >-
Failed to get ci_branch from zuul.branch or branch_override or release
when: ci_branch is not defined

View File

@ -1,11 +0,0 @@
---
# Tag and push in the same task for the sake of doing less tasks
- name: "Tag w/ arch suffix and push image: {{ image }}"
command: >
{{ cmd }}
with_items:
- "{{ container_cli }} tag {{ image }}:{{ version_hash }} {{ image }}:{{ version_hash }}_{{ ansible_architecture }}"
- "{{ container_cli }} push {% if use_buildah|bool %}{{ container_cli_opt }}{% endif %} {{ image }}:{{ version_hash }}_{{ ansible_architecture }}"
loop_control:
loop_var: "cmd"
changed_when: true

View File

@ -1,55 +0,0 @@
---
- name: Make sure we have pip
include_role:
name: ensure-pip
- name: Include OS distro version specific variables
include_vars: "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
- name: https://bugs.launchpad.net/tripleo/+bug/1862941 install six>=1.14.0
pip:
name:
- six>=1.14.0
extra_args: --user
- name: Ensure a recent version of pip is installed
pip:
name: "pip>=19.1.1"
virtualenv: "{{ workspace }}/venv_build"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
virtualenv_site_packages: true
- name: Install deps from upper-constraints
when: zuul_internal is undefined
pip:
extra_args: "-c {{ openstack_git_root }}/requirements/upper-constraints.txt"
requirements: "{{ openstack_git_root }}/{{ item }}/requirements.txt"
virtualenv: "{{ workspace }}/venv_build"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
virtualenv_site_packages: true
with_items: "{{ upper_constraints_items }}"
- name: Install deps from requirements
when: zuul_internal is defined
pip:
requirements: "{{ openstack_git_root }}/{{ item }}/requirements.txt"
virtualenv: "{{ workspace }}/venv_build"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
virtualenv_site_packages: true
with_items: "{{ requirements_items }}"
- name: Installation from source
pip:
name: "{{ source_items }}"
virtualenv: "{{ workspace }}/venv_build"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
virtualenv_site_packages: true
- name: set template override
set_fact:
kolla_override_path: >-
{% if zuul_internal is defined -%}
"{{ openstack_git_root }}/openstack-tripleo-common/container-images/tripleo_kolla_template_overrides.j2"
{% else -%}
"{{ openstack_git_root }}/tripleo-common/container-images/tripleo_kolla_template_overrides.j2"
{% endif %}

View File

@ -1,4 +0,0 @@
FROM {{ base_ubi_image }}:{{ base_ubi_tag }}
RUN rm -f /etc/yum.repos.d/delorean*
COPY repos/* /etc/yum.repos.d/.
RUN dnf clean all

View File

@ -1,22 +0,0 @@
---
container_images:
- imagename: docker.io/tripleomaster/centos-binary-nova-api:current-tripleo
image_source: kolla
- imagename: docker.io/tripleomaster/centos-binary-nova-compute-ironic:current-tripleo
image_source: kolla
- imagename: docker.io/tripleomaster/centos-binary-nova-compute:current-tripleo
image_source: kolla
- imagename: docker.io/tripleomaster/centos-binary-nova-conductor:current-tripleo
image_source: kolla
- imagename: docker.io/tripleomaster/centos-binary-nova-libvirt:current-tripleo
image_source: kolla
- imagename: docker.io/tripleomaster/centos-binary-nova-novncproxy:current-tripleo
image_source: kolla
- imagename: docker.io/tripleomaster/centos-binary-nova-scheduler:current-tripleo
image_source: kolla
- imagename: docker.io/tripleomaster/centos-binary-nova-serialproxy:current-tripleo
image_source: kolla
- imagename: docker.io/tripleomaster/centos-binary-novajoin-notifier:current-tripleo
image_source: kolla
- imagename: docker.io/tripleomaster/centos-binary-novajoin-server:current-tripleo
image_source: kolla

View File

@ -1,4 +0,0 @@
---
container_images:
- imagename: docker.io/tripleomaster/centos-binary-keystone:current-tripleo
image_source: kolla

View File

@ -1,16 +0,0 @@
[DEFAULT]
base={{ kolla_base }}
base_image={{ kolla_base_image }}
{% if kolla_base_tag is defined %}
base_tag={{ kolla_base_tag }}
{% endif %}
type=binary
registry={{ push_registry }}
tag={{ version_hash }}{{ arch_tag }}
template_override={{ kolla_override_path }}
# we use the repos off the main host as they will already have the correct mirror info in them
rpm_setup_config="{{ buildcontainers_rpm_setup_config }}"
push={{ push_containers }}
pull={{ kolla_base_pull }}
namespace={{ registry_namespace }}
debug=True

View File

@ -1,29 +0,0 @@
#!/bin/bash -eux
{% if buildcontainers_venv is defined and buildcontainers_venv %}
source {{ workspace }}/venv_build/bin/activate
pip install -U decorator
TRIPLEO_COMMON_PATH="{{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common"
{% else %}
TRIPLEO_COMMON_PATH="/usr/share/openstack-tripleo-common"
{% endif %}
TRIPLEO_CI_PATH="{{ ansible_user_dir }}/src/opendev.org/openstack/tripleo-ci"
### build
openstack overcloud container image build {{ container_config }}\
{% if ci_branch in exclude_containers %}
{% for item in exclude_containers[ci_branch][container_exclude_distro] %}
--exclude {{ item }} \
{% endfor %}
{% endif %}
{% if use_buildah is defined and use_buildah %}
--use-buildah \
{% endif %}
--work-dir {{ ansible_user_dir }}/container-builds \
{% if build_timeout is defined %}
--build-timeout {{ build_timeout }} \
{% endif %}
--kolla-config-file {{ workspace }}/kolla-build.conf
### grep errors in all build logs
sudo egrep "^Error:|No match" /tmp/kolla-*/docker -R > containers-build-errors.log 2>&1 || true
sudo egrep "^Error:|No match" /tmp/container-builds/*/docker -R >> containers-build-errors.log 2>&1 || true

View File

@ -1,102 +0,0 @@
#!/bin/bash -eux
{% if buildcontainers_venv is defined and buildcontainers_venv %}
source {{ workspace }}/venv_build/bin/activate
pip install -U decorator
TRIPLEO_COMMON_PATH="{{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common"
{% else %}
TRIPLEO_COMMON_PATH="/usr/share/openstack-tripleo-common"
{% endif %}
TRIPLEO_CI_PATH="{{ ansible_user_dir }}/src/opendev.org/openstack/tripleo-ci"
export TRIPLEO_CI_USR_PATH="${VIRTUAL_ENV:-/usr}"
export TRIPLEO_ANSIBLE_WORKPATH="${TRIPLEO_CI_USR_PATH}/share/ansible"
export ANSIBLE_ACTION_PLUGINS="${TRIPLEO_ANSIBLE_WORKPATH}/plugins/action"
export ANSIBLE_CALLBACK_PLUGINS="${TRIPLEO_ANSIBLE_WORKPATH}/plugins/callback"
export ANSIBLE_FILTER_PLUGINS="${TRIPLEO_ANSIBLE_WORKPATH}/plugins/filter"
export ANSIBLE_LIBRARY="${TRIPLEO_ANSIBLE_WORKPATH}/plugins/modules"
export ANSIBLE_MODULE_UTILS="${TRIPLEO_ANSIBLE_WORKPATH}/plugins/module_utils"
export ANSIBLE_ROLES_PATH="${TRIPLEO_ANSIBLE_WORKPATH}/roles"
export ROLE_REPOS="tripleo-common ansible/roles"
echo "print exported variables"
set | grep -i TRIPLEO
set | grep -i ANSIBLE
echo "list files in ansible role path, ${TRIPLEO_ANSIBLE_WORKPATH}/roles"
ls -la "${TRIPLEO_ANSIBLE_WORKPATH}/roles"
# Ensure that the roles from tripleo-common and tripleo-ansible installed
# from the venv are available in the roles path
# The tripleo-common role path can be found here:
# https://opendev.org/openstack/tripleo-common/src/branch/master/tripleo_common/actions/ansible.py
for ROLE_REPO in $ROLE_REPOS; do
if [[ "${TRIPLEO_CI_USR_PATH}" != '/usr' && -d "${TRIPLEO_CI_USR_PATH}/share/${ROLE_REPO}" ]]; then
# Check if the target directory exists and is not a symlink
if [[ -d "/usr/share/${ROLE_REPO}" && ! -L "/usr/share/${ROLE_REPO}" ]]; then
echo "Creating a backup of /usr/share/${ROLE_REPO}.bak"
sudo mv /usr/share/${ROLE_REPO} /usr/share/${ROLE_REPO}.bak
fi
# Link our venv'd ${ROLE_REPO} files into the root path.
echo -e "Linking ${TRIPLEO_CI_USR_PATH}/share/${ROLE_REPO} to /usr/share/${ROLE_REPO}"
sudo ln -sf ${TRIPLEO_CI_USR_PATH}/share/${ROLE_REPO} /usr/share/${ROLE_REPO}
fi
done
### build
openstack tripleo container image build \
{% if push_containers|bool %}
--push \
{% endif %}
{% if buildcontainers_authfile_path is defined %}
--authfile {{ buildcontainers_authfile_path }} \
{% endif %}
{% if distro is defined %}
--distro {{ distro }} \
{% endif %}
{% if registry_namespace is defined %}
--namespace {{ registry_namespace }} \
{% endif%}
{% if push_registry is defined %}
--registry {{ push_registry }} \
{% endif %}
{% if rhel_modules is defined %}
--rhel-modules {{ rhel_modules | join(",") }} \
{% endif %}
{% set branch = osp_branch|default(ci_branch) %}
{% if branch in exclude_containers %}
{% for item in exclude_containers[branch][container_exclude_distro] %}
--exclude {{ item }} \
{% endfor %}
{% endif %}
--tag {{ version_hash }}{{ arch_tag | default('') }}\
--base {{ containers_base_image | default('ubi8') }} \
--prefix {{ container_name_prefix }} \
--config-file {{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common/container-images/tripleo_containers.yaml \
--config-path {{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common/container-images \
--work-dir {{ ansible_user_dir }}/container-builds \
{% if build_timeout is defined %}
--build-timeout {{ build_timeout }} \
{% endif %}
{% if dockerfile_labels is defined %}
{% for item in dockerfile_labels %}
--label {{ item }} \
{% endfor %}
{% endif %}
{% if volume_mounts is defined %}
{% for item in volume_mounts %}
--volume {{ item }} \
{% endfor %}
{% endif %}
{% if release|default(branch) not in ["train"] %}
--tcib-extra tcib_release={{ ansible_distribution_major_version }} \
--tcib-extra tcib_python_version={{ (ansible_distribution_major_version is version('9', '<')) | ternary ('3.6', '3.9') }} \
{% endif %}
{% if (tcib_extra_config is defined) and (release|default(branch) not in ["train", "wallaby"]) %}
--extra-config {{ workspace }}/extra_config.yaml \
{% endif %}
# TODO(tkajinam): With Ansible 2.14, the playbook triggered by the command
# gets stuck if -vvv is set. We temporarily remove --debug
# as a workaround until we find out the appropriate fix.
# https://github.com/ansible/ansible-runner/issues/1164
# --debug

View File

@ -1,23 +0,0 @@
---
tripleo_deps_from_package:
- "openstack-kolla"
- "python*-tripleoclient"
upper_constraints_items:
- tripleo-common
- python-tripleoclient
- tripleo-ansible
- kolla
requirements_items:
- openstack-tripleo-common
- python-tripleoclient
- tripleo-ansible
- kolla
source_items:
- "file://{{ openstack_git_root }}/kolla"
- "file://{{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common"
- "file://{{ openstack_git_root }}/python-tripleoclient"
- "file://{{ openstack_git_root }}/tripleo-ansible"
- decorator

View File

@ -1,24 +0,0 @@
---
tripleo_deps_from_package:
- "python3-tripleoclient"
upper_constraints_items:
- tripleo-common
- python-tripleoclient
- tripleo-ansible
requirements_items:
- openstack-tripleo-common
- python-tripleoclient
- tripleo-ansible
source_items:
- "file://{{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common"
- "file://{{ openstack_git_root }}/python-tripleoclient"
- "file://{{ openstack_git_root }}/tripleo-ansible"
- decorator
volume_mounts:
- "/etc/yum.repos.d:/etc/distro.repos.d:z"
- "/etc/pki/rpm-gpg:/etc/pki/rpm-gpg:z"
- "/etc/dnf/vars:/etc/dnf/vars:z"

View File

@ -1,26 +0,0 @@
---
tripleo_deps_from_package:
- "python3-tripleoclient"
upper_constraints_items:
- tripleo-common
- python-tripleoclient
- tripleo-ansible
requirements_items:
- openstack-tripleo-common
- python-tripleoclient
- tripleo-ansible
source_items:
- "file://{{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common"
- "file://{{ openstack_git_root }}/python-tripleoclient"
- "file://{{ openstack_git_root }}/tripleo-ansible"
- decorator
volume_mounts:
- "/etc/yum.repos.d:/etc/distro.repos.d:z"
- "/etc/pki/rpm-gpg:/etc/pki/rpm-gpg:z"
- "/etc/dnf/vars:/etc/dnf/vars:z"
containers_base_image: registry.access.redhat.com/ubi9:latest

View File

@ -1,63 +0,0 @@
---
workspace: "{{ ansible_user_dir }}/workspace"
# https://review.opendev.org/#/c/669471 - rhel8 kolla support
kolla_rhel8_patch:
master: 669471
"stable/train": 693159
# Current implementation assumes that any branch name not mentioned here
# would default to the excludes defined on master branch.
exclude_ppc_containers:
master:
centos8: &exclude_ppc_master_containers
- ironic-pxe
- neutron-mlnx-agent
exclude_containers:
master:
centos8: &exclude_master_containers
- neutron-mlnx-agent
centos9: &exclude_cs9_master_containers
- neutron-mlnx-agent
zed:
centos9: *exclude_cs9_master_containers
wallaby:
centos8: *exclude_master_containers
centos9: *exclude_cs9_master_containers
train:
centos7: &exclude_containers_train
- opendaylight
- neutron-server-opendaylight
- neutron-mlnx-agent
- nova-serialproxy
- sahara-api
- sahara-engine
- sensu-client
centos8:
- fluentd
- opendaylight
- neutron-server-opendaylight
- neutron-mlnx-agent
- nova-serialproxy
- sahara-api
- sahara-engine
- sensu-client
rhos-18:
redhat9: *exclude_cs9_master_containers
rhos-17.1:
redhat8: *exclude_master_containers
redhat9: *exclude_cs9_master_containers
rhos-17:
redhat8: *exclude_master_containers
redhat9: *exclude_cs9_master_containers
rhos-16.2:
redhat8:
- neutron-mlnx-agent
timestamper_cmd: >-
| awk '{ print strftime("%Y-%m-%d %H:%M:%S |"), $0; fflush(); }'
# used with component_ci_service in defaults/main by component-ci jobs
component_ci_configs:
compute: "$TRIPLEO_CI_PATH/roles/build-containers/templates/component_ci/compute_overcloud_containers.yaml"
keystone: "$TRIPLEO_CI_PATH/roles/build-containers/templates/component_ci/keystone_overcloud_containers.yaml"

View File

@ -1,23 +0,0 @@
---
tripleo_deps_from_package:
- "openstack-kolla"
- "python*-tripleoclient"
upper_constraints_items:
- tripleo-common
- python-tripleoclient
- tripleo-ansible
- kolla
requirements_items:
- openstack-tripleo-common
- python-tripleoclient
- tripleo-ansible
- kolla
source_items:
- "file://{{ openstack_git_root }}/kolla"
- "file://{{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common"
- "file://{{ openstack_git_root }}/python-tripleoclient"
- "file://{{ openstack_git_root }}/tripleo-ansible"
- decorator

View File

@ -1,22 +0,0 @@
---
tripleo_deps_from_package:
- "python3-tripleoclient"
upper_constraints_items:
- tripleo-common
- python-tripleoclient
- tripleo-ansible
requirements_items:
- openstack-tripleo-common
- python-tripleoclient
- tripleo-ansible
source_items:
- "file://{{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common"
- "file://{{ openstack_git_root }}/python-tripleoclient"
- "file://{{ openstack_git_root }}/tripleo-ansible"
- decorator
volume_mounts:
- "/etc/pki/ca-trust:/etc/pki/ca-trust:z"

View File

@ -1,22 +0,0 @@
---
tripleo_deps_from_package:
- "python3-tripleoclient"
upper_constraints_items:
- tripleo-common
- python-tripleoclient
- tripleo-ansible
requirements_items:
- openstack-tripleo-common
- python-tripleoclient
- tripleo-ansible
source_items:
- "file://{{ openstack_git_root }}/{% if zuul_internal is defined %}openstack-{% endif %}tripleo-common"
- "file://{{ openstack_git_root }}/python-tripleoclient"
- "file://{{ openstack_git_root }}/tripleo-ansible"
- decorator
volume_mounts:
- "/etc/pki/ca-trust:/etc/pki/ca-trust:z"

View File

@ -1,47 +0,0 @@
ceph-loop-device
================
This roles creates the /dev/loop3 and /dev/loop4 (default) loop
devices required when you have Ceph services in the deployment.
The first device is used for legacy jobs which use Ceph Filestore.
The second loop device has three logical volumes created on it for
use with Ceph Bluestore.
Role Variables
--------------
ceph_loop_device: /dev/loop4
ceph_loop_device_legacy: /dev/loop3
ceph_loop_device_file: /var/lib/ceph-osd.img
ceph_loop_device_file_legacy: /var/lib/ceph-osd-legacy.img
ceph_logical_volume_group: ceph_vg
ceph_logical_volume_wal: ceph_lv_wal
ceph_logical_volume_db: ceph_lv_db
ceph_logical_volume_data: ceph_lv_data
Requirements
------------
- ansible >= 2.4
- python >= 2.6
Dependencies
------------
None
Example Playbooks
-----------------
.. code-block::
- hosts: localhost
roles:
- ceph-loop-device
License
-------
Apache 2.0

View File

@ -1,7 +0,0 @@
---
ceph_loop_device: /dev/loop4
ceph_loop_device_legacy: /dev/loop3
ceph_loop_device_file: /var/lib/ceph-osd.img
ceph_loop_device_file_legacy: /var/lib/ceph-osd-legacy.img
ceph_logical_volume_group: ceph_vg
ceph_logical_volume_data: ceph_lv_data

View File

@ -1,38 +0,0 @@
---
- name: stat ceph_loop_device see if it already exists
stat:
path: "{{ ceph_loop_device }}"
register: dev_loop3_res
- name: log to syslog if ceph_loop_device exists
syslogger:
msg: "boostrap-subnodes - warning {{ ceph_loop_device }} already exists"
when: dev_loop3_res.stat.exists
- name: Make sure we have losetup installed/latest # noqa: package-latest
become: true
package:
name:
- util-linux
- lvm2
state: latest
- name: Use dd and losetup to create the loop devices
become: true
shell: |
dd if=/dev/zero of={{ item.0 }} bs=1 count=0 seek=14G
losetup {{ item.1 }} {{ item.0 }}
lsblk
changed_when: true
with_together:
- ["{{ ceph_loop_device_file }}", "{{ ceph_loop_device_file_legacy }}"]
- ["{{ ceph_loop_device }}", "{{ ceph_loop_device_legacy }}"]
- name: Use {pv,vg,lv}create to create logical volume on one loop device
become: true
shell: |
pvcreate {{ ceph_loop_device }}
vgcreate {{ ceph_logical_volume_group }} {{ ceph_loop_device }}
lvcreate -n {{ ceph_logical_volume_data }} -l +100%FREE {{ ceph_logical_volume_group }}
lvs
changed_when: true

View File

@ -1,6 +0,0 @@
---
# In ansible 2.7 should be enough to add the option public: true to the calling include_role
# for this role. This is the best workaround
- name: Include the vars to be available for the playbook
include_vars:
dir: vars

View File

@ -1,63 +0,0 @@
---
workspace: "{{ ansible_user_dir }}/workspace"
tripleo_root: "{{ ansible_user_dir }}/src/opendev.org/openstack"
tripleo_ci_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-ci'].src_dir }}"
tripleo_quickstart_dir: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-quickstart'].src_dir }}"
vxlan_vars: "-e toci_vxlan_networking='false' -e vxlan_networking='false'"
extra_vars: ""
role_vars: ""
job_featureset_file: >-
{% if featureset is defined -%}
{{ tripleo_quickstart_dir }}/config/general_config/featureset{{ featureset }}.yml{% endif -%}
skip_tags_list: >-
{% if environment_type == 'baremetal' -%}
tripleo-validations
{%- else -%}
tripleo-validations,teardown-all
{%- endif -%}
featureset_conf: >-
{% if common_featureset is defined and common_featureset -%}
--extra-vars @{{ tripleo_quickstart_dir }}/config/general_config/{{ common_featureset }} {% endif -%}
{% if job_featureset_file != '' -%}--extra-vars @{{ job_featureset_file }}{% endif -%}
# "force_non_periodic" - will force job to run as check job, no matter which pipeline it runs
# "force_periodic" - will force job to run as periodic (in terms of TripleO CI), no matter which pipeline it runs
periodic: >-
{% if ('periodic' in zuul.pipeline and not force_non_periodic|default(false)|bool) or (force_periodic|default(false)|bool) -%}
true
{%- else -%}
false
{%- endif %}
nodepool_provider: "{{ hostvars[inventory_hostname].nodepool.provider }}"
rhcloud: >-
{%- if 'rdo-cloud' in nodepool_provider -%}
rdocloud
{%- elif 'vexxhost-nodepool-tripleo' in nodepool_provider -%}
vexxhost
{%- elif 'psi-public-nodepool-tripleo' in nodepool_provider -%}
psi
{%- elif 'ibm-bm3-nodepool' in nodepool_provider -%}
ibm
{%- elif nodepool_provider == 'tripleo-ci' and environment_type == 'ovb' -%}
internal
{%- endif -%}
nodes_file: >-
{% if nodes is defined -%}
{{ tripleo_quickstart_dir }}/config/nodes/{{ nodes }}.yml
{%- endif %}
nodes_args: >-
{% if nodes is defined -%}
--extra-vars @{{ nodes_file }}
{%- endif %}
rdo_env_vars: >-
{% if rhcloud -%}
--extra-vars @{{ tripleo_ci_dir }}/toci-quickstart/config/testenv/{{ environment_type }}-{{ rhcloud }}.yml
{%- endif %}
env_vars: "--extra-vars @{{ tripleo_ci_dir }}/toci-quickstart/config/testenv/{{ environment_type }}.yml {{ rdo_env_vars }}"

View File

@ -1,76 +0,0 @@
---
oooci_image_build_archive_dest: "{{ ansible_user_dir }}"
tripleo_image_source: https://cloud.centos.org/centos/8-stream/x86_64/images/CentOS-Stream-GenericCloud-8-latest.x86_64.qcow2
workspace: "{{ ansible_user_dir }}/workspace"
openstack_git_root: "{{ ansible_user_dir }}/src/opendev.org/openstack"
dib_pin: ""
python_v: py3
base_image_config:
py2: overcloud-images.yaml
py3: overcloud-images-python3.yaml
hardened_image_config:
py2: overcloud-hardened-images.yaml
py3: overcloud-hardened-images-python3.yaml
tripleo_pip_projects:
- "git+file://{{ openstack_git_root }}/diskimage-builder{{ dib_pin }}"
- "file://{{ openstack_git_root }}/tripleo-ansible"
- "file://{{ openstack_git_root }}/tripleo-common"
- "file://{{ openstack_git_root }}/python-tripleoclient"
tripleo_common_path: "{{ openstack_git_root }}/tripleo-common"
tripleo_elements_path:
- "{{ openstack_git_root }}/tripleo-puppet-elements/elements"
- "{{ openstack_git_root }}/tripleo-image-elements/elements"
- "{{ openstack_git_root }}/heat-agents"
- "{{ openstack_git_root }}/ironic-python-agent-builder/dib/"
tripleo_shebang_path:
- "{{ openstack_git_root }}/tripleo-image-elements/elements/os-svc-install/bin/map-services-tripleo"
- "{{ openstack_git_root }}/diskimage-builder/diskimage_builder/lib/outfilter.py"
- "{{ openstack_git_root }}/diskimage-builder/diskimage_builder/elements/package-installs/bin/package-installs-squash"
- "{{ openstack_git_root }}/diskimage-builder/diskimage_builder/elements/svc-map/extra-data.d/10-merge-svc-map-files"
- "{{ openstack_git_root }}/diskimage-builder/diskimage_builder/elements/pypi/pre-install.d/04-configure-pypi-mirror"
- "{{ openstack_git_root }}/diskimage-builder/diskimage_builder/elements/deploy-targetcli/extra-data.d/module/targetcli-wrapper"
dib_yum_repo_conf: >-
{% if ansible_distribution == 'RedHat' and ansible_distribution_major_version is version(8, '>=') -%}
{{ dib_yum_repo_conf_rhel }}
{%- else -%}
{{ dib_yum_repo_conf_centos }}
{%- endif %}
centos_compose_dib_yum_repos: >-
{% if job is defined and
job.dependency is defined and
job.dependency == "centos-compose" or
dependency|default("") == "centos-compose" -%}
{{ true|bool }}
{%- else -%}
{{ false|bool }}
{%- endif -%}
dib_yum_repo_conf_centos:
- /etc/yum.repos.d/quickstart-centos*
- /etc/yum.repos.d/delorean*
- "{{ centos_compose_dib_yum_repos | ternary('/etc/yum.repos.d/CentOS-Stream-*','') }}"
dib_yum_repo_conf_rhel:
- /etc/yum.repos.d/rh-cloud.repo
- /etc/yum.repos.d/delorean*
dib_release: "8"
tripleo_image_os: centos8
build_all_images: false
# Vars for enabling specific streams
dib_dnf_module_streams: "container-tools:3.0"
# Vars for running Image sanity
# image_sanity_command var should in following format: <command_name > /tmp/output_file name>
# We need to dump the command output in /var/tmp directory.
image_sanity: true
image_sanity_command: "rpm -qa > /var/tmp/rpm_qa.txt; rpm -Va | grep missing > /var/tmp/rpm_va.txt"
image_sanity_files:
- /var/tmp/rpm_qa.txt
- /var/tmp/rpm_va.txt
# Referenced bugs linked to missing dirs
# - https://bugs.launchpad.net/tripleo/+bug/1879766
missing_dirs:
- /var/lib/pcs
- /etc/pki/tls/private
# discover-latest-images related params
tripleo_ci_discover_latest: false
tripleo_ci_discover_base_url: ''
tripleo_ci_discover_qcow_prefix: ''

View File

@ -1,69 +0,0 @@
---
- name: Check if cert exits
stat:
path: /etc/pki/ca-trust/source/anchors/rh.crt
register: cert_path
- name: Install neccessary rpm and customize image to push correct certs in Image.
when: cert_path.stat.exists|bool
block:
- name: Install libguestfs packages
include_tasks: guestfs.yaml
- name: Add cert if it exists
shell: >
virt-customize -a {{ tripleo_image_source | urlsplit('path') | basename }}
--upload /etc/pki/ca-trust/source/anchors/rh.crt:/etc/pki/ca-trust/source/anchors/rh.crt
--run-command 'update-ca-trust'
args:
chdir: "{{ workspace }}"
environment:
LIBGUESTFS_BACKEND_SETTINGS: force_tcg
LIBGUESTFS_BACKEND: direct
- name: Install downstream cert rpm
when:
- not cert_path.stat.exists|bool
- downstream_cert_install_command is defined
block:
- name: Install libguestfs packages
include_tasks: guestfs.yaml
- name: find the needed repos to pull deps
find:
paths: /etc/yum.repos.d
patterns: "rhos*.repo"
file_type: file
register: found_repos
- name: Upload repos to image
shell: >
virt-customize -a {{ tripleo_image_source | urlsplit('path') | basename }}
--upload {{ item.path }}:{{ item.path }}
args:
chdir: "{{ workspace }}"
environment:
LIBGUESTFS_BACKEND_SETTINGS: force_tcg
LIBGUESTFS_BACKEND: direct
with_items: "{{ found_repos.files }}"
- name: Install cert rpm
shell: >
virt-customize -a {{ tripleo_image_source | urlsplit('path') | basename }}
--run-command '{{ downstream_cert_install_command }}'
args:
chdir: "{{ workspace }}"
environment:
LIBGUESTFS_BACKEND_SETTINGS: force_tcg
LIBGUESTFS_BACKEND: direct
- name: Remove repos which we installed earlier
shell: >
virt-customize -a {{ tripleo_image_source | urlsplit('path') | basename }}
--run-command 'rm {{ item.path }}'
args:
chdir: "{{ workspace }}"
environment:
LIBGUESTFS_BACKEND_SETTINGS: force_tcg
LIBGUESTFS_BACKEND: direct
with_items: "{{ found_repos.files }}"

View File

@ -1,13 +0,0 @@
---
- name: Set python_v fact to py2 or py3 for use with base_image_config
set_fact:
python_v: "{{ ansible_facts['distribution_major_version'] is version('8', '>=') | ternary('py3', 'py2') }}"
cacheable: true
- name: distribution_major_version
debug:
msg: "{{ ansible_facts['distribution_major_version'] }}"
- name: python_v
debug:
msg: "{{ python_v }}"

View File

@ -1,8 +0,0 @@
---
- name: Install libguestfs packages
package:
name:
- libguestfs
- libguestfs-tools
- libguestfs-tools-c
state: present

View File

@ -1,42 +0,0 @@
---
- name: Install guestfs
include_tasks: guestfs.yaml
- name: Run sanity command on overcloud images
shell: |
virt-customize -vx --smp 2 -m 2048 -a overcloud-full.qcow2 --selinux-relabel \
--run-command '{{ image_sanity_command }}' > {{ ansible_user_dir }}/virt_customize.log
virt-copy-out -a overcloud-full.qcow2 {{ image_sanity_files | join(' ') }} {{ workspace }}
args:
chdir: "{{ workspace }}"
environment:
LIBGUESTFS_BACKEND_SETTINGS: force_tcg
LIBGUESTFS_BACKEND: direct
changed_when: true
- name: Look for missing directories
shell: |
! grep {{ item }} rpm_va.txt
args:
chdir: "{{ workspace }}"
register: files_missing
changed_when: false
ignore_errors: true
loop: "{{ missing_dirs }}"
- name: Show warning if missing files
debug:
msg: "WARNING: File(s) are missing on the overcloud image."
when: "item['rc'] == 1"
loop: "{{ files_missing.results }}"
- name: Fail if missing files (periodic only)
block:
- name: Ensure no missing files
assert:
that:
- "item['rc'] == 0"
loop: "{{ files_missing.results }}"
when: >
('periodic' in zuul.pipeline and not force_non_periodic|default(false)|bool) or
force_periodic|default(false)|bool

View File

@ -1,174 +0,0 @@
---
- name: Get python_v fact for py2 or py3 common vars
include_tasks: check_set_py3.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 is version('7', '==') or
ansible_distribution_major_version is version('9', '==')
- name: Make sure logs directory exists
file:
path: '{{ workspace }}/logs'
state: directory
- name: Get the latest image on demand
when:
- tripleo_ci_discover_latest | bool
block:
- name: Find latest image name
vars:
base_url: "{{ tripleo_ci_discover_base_url }}"
qcow_prefix: "{{ tripleo_ci_discover_qcow_prefix }}"
import_role:
name: discover-latest-image
- name: Set needed facts
set_fact:
cacheable: true
tripleo_image_source: "{{ discovered_image_url }}"
baseos_undercloud_image_url: "{{ discovered_image_url }}"
baseos_image: "{{ ansible_distribution | lower }}"
baseos_image_type: qcow2
baseos_md5sum: "{{ discovered_md5sum }} {{ discovered_image_name }}"
- name: Set dib related facts used by tripleo-ci build-image role build template
set_fact:
dib_local_image: "{{ workspace }}/{{ tripleo_image_source | urlsplit('path') | basename }}"
dib_node_dist: "{{ (ansible_distribution == 'RedHat') | ternary('rhel', 'centos') }}"
cacheable: true
when: tripleo_image_source is defined
- name: Install libselinux-python3
package:
name: libselinux-python3
state: present
become: true
- name: Download TripleO source image
get_url:
url: "{{ tripleo_image_source }}"
dest: "{{ dib_local_image }}"
timeout: 20
register: result
until: result is success
retries: 60
delay: 10
vars:
ansible_python_interpreter: /usr/bin/python3
- name: Install qemu-img for image build
package:
name: qemu-img
state: present
become: true
- name: virt-customize to add cert
include_tasks: add_cert.yaml
args:
apply:
become: true
when: ansible_distribution|lower == "redhat"
- name: Install python3-devel
package:
name: python3-devel # required for python-tripleoclient pip install
state: present
become: true
- name: Install python-tripleoclient for Image build
package:
name: "python*-tripleoclient"
state: present
become: true
- name: Generate build-images.sh script
template:
src: templates/build-images.sh.j2
dest: "{{ workspace }}/build_images.sh"
mode: 0777
force: true
- name: Run build-images.sh
args:
chdir: '{{ workspace }}'
shell: bash build_images.sh > {{ workspace }}/logs/script_build.log 2> {{ workspace }}/logs/script_build-err.log
changed_when: true
- when: tripleo_image_source is defined
block:
- name: check if overcloud images were built
stat:
path: "{{ workspace }}/overcloud-full.qcow2"
register: overcloud_stat_result
- name: check if overcloud-hardened-uefi-full images were built
stat:
path: "{{ workspace }}/overcloud-hardened-uefi-full.qcow2"
register: overcloud_hardened_uefi_stat_result
- name: check if ipa images were built
stat:
path: "{{ workspace }}/ironic-python-agent.kernel"
register: ipa_stat_result
- when: ipa_stat_result.stat.exists|bool
block:
- name: ironic-python-agent
archive:
path:
- "{{ workspace }}/ironic-python-agent.initramfs"
- "{{ workspace }}/ironic-python-agent.kernel"
dest: "{{ oooci_image_build_archive_dest }}/ironic-python-agent.tar"
format: tar
- name: Create md5sums
shell:
cmd: |
md5sum ironic-python-agent.tar > ironic-python-agent.tar.md5
args:
chdir: "{{ oooci_image_build_archive_dest }}"
- when: overcloud_stat_result.stat.exists|bool
block:
- name: overcloud-full
archive:
path:
- "{{ workspace }}/overcloud-full.qcow2"
- "{{ workspace }}/overcloud-full.initrd"
- "{{ workspace }}/overcloud-full.vmlinuz"
dest: "{{ oooci_image_build_archive_dest }}/overcloud-full.tar"
format: tar
- name: Create md5sums
shell:
cmd: |
md5sum overcloud-full.tar > overcloud-full.tar.md5
args:
chdir: "{{ oooci_image_build_archive_dest }}"
- when: overcloud_hardened_uefi_stat_result.stat.exists|bool
block:
- name: "Move image to {{ oooci_image_build_archive_dest }}"
command: "mv {{ workspace }}/overcloud-hardened-uefi-full.qcow2 {{ oooci_image_build_archive_dest }}"
when: workspace != oooci_image_build_archive_dest
- name: Create md5sums
shell:
cmd: |
md5sum overcloud-hardened-uefi-full.qcow2 > overcloud-hardened-uefi-full.qcow2.md5
args:
chdir: "{{ oooci_image_build_archive_dest }}"
- block:
- name: Run Image sanity on overcloud image
include_tasks: image_sanity.yaml
become: true
when:
- tripleo_image_type is search("overcloud-full")
- image_sanity | bool
- overcloud_stat_result.stat.exists|bool

View File

@ -1,41 +0,0 @@
---
- name: Copy files from {{ workspace }}/ on node
no_log: true
synchronize:
src: '{{ workspace }}/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/*.log
- --include=/*.sh
- --include=/*.txt
- --include=*/
- --exclude=*
- --prune-empty-dirs
- name: Copy files from /etc/yum.repos.d/ on node
synchronize:
src: '/etc/yum.repos.d'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/**
- --exclude=*
- name: Copy files from {{ workspace }}/ on node
no_log: true
synchronize:
src: '{{ workspace }}/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true
verify_host: true
rsync_opts:
- --include=/logs/**
- --include=*/
- --exclude=*
- --prune-empty-dirs

View File

@ -1,85 +0,0 @@
---
- name: Get python_v fact for py2 or py3 common vars
include_tasks: check_set_py3.yaml
- name: Make sure workspace exists
file:
path: '{{ workspace }}'
state: directory
- name: Install pip with ensure-pip role
include_role:
name: ensure-pip
- name: Install pyyaml from epel
yum:
name: "python36-PyYAML"
enablerepo: epel
state: present
become: true
when: ansible_distribution_major_version|int == 7
- name: Install PyYAML
package:
name: "python3-pyyaml"
state: present
become: true
when: ansible_distribution_major_version|int >= 8
- name: Install python3-devel with provides pathfix.py
package:
name: python3-devel
state: present
become: true
- name: Create a script that fixes shebang for python3
template:
src: pathfix_repos.sh.j2
dest: "{{ workspace }}/pathfix_repos.sh"
mode: u=rwx
- name: Fix shebang path for python3
command: bash {{ workspace }}/pathfix_repos.sh
changed_when: true
- name: Install python3-setuptools
package:
name: "python3-setuptools"
state: present
become: true
when: python_v == "py3"
- name: Install python-setuptools
package:
name: "python-setuptools"
state: present
become: true
when: python_v == "py2"
- name: Ensure a recent version of pip is installed
pip:
extra_args: '--upgrade'
name: "pip>=19.1.1"
virtualenv: "{{ workspace }}/venv"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
- name: Install deps from upper-constraints
when: ansible_distribution == 'CentOS'
pip:
extra_args: "--upgrade -c {{ openstack_git_root }}/requirements/upper-constraints.txt"
requirements: "{{ openstack_git_root }}/{{ item }}/requirements.txt"
virtualenv: "{{ workspace }}/venv"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"
with_items:
- diskimage-builder
- tripleo-common
- tripleo-ansible
- python-tripleoclient
- name: pip install tripleo items
pip:
name: "{{ tripleo_pip_projects }}"
extra_args: "--upgrade"
state: present
virtualenv: "{{ workspace }}/venv"
virtualenv_command: "{{ ensure_pip_virtualenv_command }}"

View File

@ -1,80 +0,0 @@
set -ex
# Activate virtualenv only if exists
{% if osp_release is not defined %}
if [ -d "{{ workspace }}/venv" ]; then
source {{ workspace }}/venv/bin/activate
fi
{% endif %}
# When python-tripleoclient is installed via packages
# elements_path are automatically setted.
{% if to_build is not defined %}
ELEMENTS="{{ tripleo_elements_path | join(':') }}"
if [ -d "{{ openstack_git_root }}/instack-undercloud/elements" ]; then
ELEMENTS="{{ openstack_git_root }}/instack-undercloud/elements:${ELEMENTS}"
fi
export ELEMENTS_PATH=$ELEMENTS
{% endif %}
# the tripleo_image_type is set and passed from the ci job definition
{% if tripleo_image_type == "overcloud-hardened-uefi-full" %}
CONFIG_FILES="--config-file \
{{ tripleo_common_path }}/image-yaml/overcloud-hardened-images-uefi-python3.yaml \
--config-file {{ tripleo_common_path }}/image-yaml/overcloud-hardened-images-uefi-{{ tripleo_image_os }}.yaml"
{% elif tripleo_image_type == "overcloud-hardened-full" %}
CONFIG_FILES="--config-file \
{{ tripleo_common_path }}/image-yaml/{{ hardened_image_config[python_v] }} \
--config-file {{ tripleo_common_path }}/image-yaml/overcloud-hardened-images-{{ tripleo_image_os }}.yaml"
{% else %}
CONFIG_FILES="--config-file \
{{ tripleo_common_path }}/image-yaml/{{ base_image_config[python_v] }} \
--config-file {{ tripleo_common_path }}/image-yaml/overcloud-images-{{ tripleo_image_os }}.yaml"
{% endif %}
{% if dib_local_image is defined %}
# this is only set in rhel/centos-8 jobs dib_rhel_image -> DIB_LOCAL_IMAGE
export DIB_LOCAL_IMAGE={{ dib_local_image }}
{% endif %}
{% if dib_node_dist is defined %}
export NODE_DIST={{ dib_node_dist }}
export DISTRO_NAME={{ dib_node_dist }}
{% endif %}
{% if dib_release is defined %}
export DIB_RELEASE={{ dib_release }}
{% endif %}
{% if dib_yum_repo_conf is defined %}
export DIB_YUM_REPO_CONF='{{ dib_yum_repo_conf | join(" ") }}'
{% else %}
export DIB_YUM_REPO_CONF="/etc/yum.repos.d/delorean*"
{% endif %}
{% if dib_dnf_module_streams is defined and dib_dnf_module_streams|length > 0 %}
export DIB_DNF_MODULE_STREAMS='{{ dib_dnf_module_streams }}'
{% endif %}
export DIB_DEBUG_TRACE=1
openstack --debug overcloud image build {% if not build_all_images|bool %}--image-name {{ tripleo_image_type }}{% endif %} \
$CONFIG_FILES > {{ workspace }}/build.log 2> {{ workspace }}/build-err.log
RESULT=$?
exit $RESULT

View File

@ -1,9 +0,0 @@
#!/usr/bin/bash
# In some of scripts we still have python shebang "#!/usr/bin/env python"
# which fails in python3 hosts.
# In packages it's fixed by adding pathfix.py tasks to spec files.
# Add the same behavior here as we build from source, not packages.
for python_file in "{{ tripleo_shebang_path | join(' ')}}"
do
/usr/bin/pathfix.py -pni /usr/bin/python3 $python_file
done

View File

@ -1,8 +0,0 @@
---
tripleo_image_source: https://images.rdoproject.org/CentOS-7-x86_64-GenericCloud.qcow2
dib_yum_repo_conf:
- /etc/yum.repos.d/CentOS*
- /etc/yum.repos.d/delorean*
dib_release: "7"
dib_dnf_module_streams: ""
tripleo_image_os: centos7

View File

@ -1,10 +0,0 @@
---
tripleo_image_source: http://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-GenericCloud-9-latest.x86_64.qcow2
dib_yum_repo_conf:
- /etc/yum.repos.d/quickstart-centos*
- /etc/yum.repos.d/delorean*
- /etc/yum.repos.d/centos.repo
- "{{ centos_compose_dib_yum_repos | ternary('/etc/yum.repos.d/CentOS-Stream-9*','') }}"
dib_release: "9-stream"
dib_dnf_module_streams: ""
tripleo_image_os: centos9

View File

@ -1,76 +0,0 @@
---
- name: Swap is essential as we are not meeting memory requirements
vars:
configure_swap_size: 8192
include_role:
name: configure-swap
- name: Set legacy log path
include_role:
name: set-zuul-log-path-fact
- name: Ensure legacy workspace directory
file:
path: '{{ workspace }}'
state: directory
- name: Ensure legacy logs directory
file:
path: '{{ workspace }}/logs'
state: directory
- name: Assure src folder has safe permissions
# Workaround for https://bugs.launchpad.net/tripleo/+bug/1807703
file:
path: "{{ ansible_user_dir }}/src/"
state: directory
mode: u=rwX,g=rX,o=rX
recurse: true
- name: "set zuul_dump"
set_fact:
zuul_dump: "{{ {'zuul': zuul} }}"
- name: Dump zuul variables on the host to pass it to inner ansible
copy:
content: "{{ zuul_dump|to_nice_yaml }}"
dest: "{{ workspace }}/logs/zuul-variables.yaml"
- name: Dump hostvars with job variables
set_fact:
local_hostvars: "{{ {'job': hostvars[inventory_hostname]} }}"
- name: Dump hostvars on the host to pass it to inner ansible
copy:
content: "{{ local_hostvars|to_nice_yaml }}"
dest: "{{ workspace }}/logs/hostvars-variables.yaml"
- name: Remove package exclusions from package manager
become: true
ini_file:
path: "{{ item }}"
section: main
option: exclude
state: absent
failed_when: false
with_items:
- /etc/yum.conf
- /etc/dnf/dnf.conf
- name: Workaround for LP1955792/RHBZ2030107
become: true
block:
- name: Set net.ipv4.ping_group_range
sysctl:
name: net.ipv4.ping_group_range
value: '0 2147483647'
state: present
sysctl_file: /etc/sysctl.d/99-workarounds.conf
# Reference: https://bugs.launchpad.net/tripleo/+bug/1998954
- name: Ensure CentOS runs with selinux permissive
become: true
selinux:
policy: targeted
state: permissive
when: ansible_distribution == 'CentOS'

View File

@ -1,165 +0,0 @@
---
- name: Set legacy log path
include_role:
name: set-zuul-log-path-fact
- when: featureset_override is defined and featureset_override
block:
- name: Check overridable settings
vars:
allowed_overrides:
- 'artg_repos_dir'
- 'baremetal_provision'
- 'cirros_image'
- 'dlrn_hash_tag'
- 'dlrn_hash_tag_newest'
- 'extra_args'
- 'enable_fips'
- 'promote_source'
- 'run_tempest'
- 'standalone_container_cli'
- 'standalone_environment_files'
- 'standalone_upgrade'
- 'standalone_virt_type'
- 'tempest_allowed_group'
- 'tempest_cloud_name'
- 'tempest_extra_config'
- 'tempest_format'
- 'tempest_plugins'
- 'tempest_private_net_provider_type'
- 'tempest_run_concurrency'
- 'tempest_run_skipped'
- 'tempest_services'
- 'tempest_tempest_conf_overrides'
- 'tempest_test_image_path'
- 'tempest_test_includelist'
- 'tempest_test_whitelist'
- 'tempest_use_skiplist'
- 'tempest_whitelist'
- 'tempest_workers'
- 'test_black_regex'
- 'test_white_regex'
- 'to_build'
- 'undercloud_enable_paunch'
- 'use_os_tempest'
- 'validate_ha_overcloud'
- 'validate_services'
- 'tempest_tempestconf_profile_overrides'
- 'composable_roles'
- 'overcloud_roles'
fail:
msg: "ERROR: {{ item }} is not overridable."
when: item not in allowed_overrides
with_items: "{{ featureset_override }}"
- name: Generate standalone_custom_env_files from standalone_environment_files
set_fact:
featureset_override: "{{ featureset_override | combine(custom_env, recursive=true) }}"
vars:
tht_dir: /usr/share/openstack-tripleo-heat-templates/
custom_env:
standalone_custom_env_files: |
{{ featureset_override.standalone_environment_files |
default([]) |
map('regex_replace', '^', tht_dir ) | list }}
when: featureset_override['standalone_environment_files'] is defined
- name: include role ceph-loop-device
include_role:
name: ceph-loop-device
when: standalone_ceph is defined and standalone_ceph
- name: Generate featureset overriding file
template:
src: templates/featureset-override.j2
dest: "{{ tripleo_root }}/tripleo-ci/featureset-override.yaml"
mode: 0755
force: true
- name: Include some extra for generating toci scripts
set_fact:
extra_vars: "--extra-vars @{{ tripleo_root }}/tripleo-ci/featureset-override.yaml"
- name: Generate role variable file
template:
src: templates/role-vars.j2
dest: "{{ workspace }}/logs/role-vars.yaml"
mode: 0755
force: true
- name: Include role variables to be passed to quickstart
set_fact:
role_vars: "--extra-vars @{{ workspace }}/logs/role-vars.yaml"
- name: render toci_gate_test script
template:
src: templates/toci_gate_test.sh.j2
dest: "{{ tripleo_root }}/tripleo-ci/toci_gate_test.sh"
mode: 0755
force: true
- name: render toci_quickstart script
template:
src: templates/toci_quickstart.sh.j2
dest: "{{ tripleo_root }}/tripleo-ci/toci_quickstart.sh"
mode: 0755
force: true
- name: render common_vars script
template:
src: templates/common_vars.bash.j2
dest: "{{ tripleo_root }}/tripleo-ci/scripts/common_vars.bash"
force: true
- name: render oooq_common_functions script
template:
src: templates/oooq_common_functions.sh.j2
dest: "{{ tripleo_root }}/tripleo-ci/scripts/oooq_common_functions.sh"
force: true
- name: render ready releases.sh file
copy:
content: "{{ ready_releases_file }}"
dest: "{{ workspace }}/logs/releases.sh"
mode: 0644
force: true
when: ready_releases_file is defined
- name: run toci_gate_test.sh
shell:
cmd: |
set -e
set -x
{% if nodes is defined %}
export TOCI_JOBTYPE={{ environment_type }}-{{ nodes }}-featureset{{ featureset }}
{% else %}
export TOCI_JOBTYPE={{ environment_type }}-featureset{{ featureset }}
{% endif %}
export DISTRIBUTION={{ ansible_distribution }}
export DISTRIBUTION_MAJOR_VERSION={{ ansible_distribution_major_version }}
{% if nodes is defined %}
export NODES_FILE={{ nodes_file }}
{% endif %}
# ZUUL does not set these for periodic jobs
export ZUUL_BRANCH=${ZUUL_BRANCH:-master}
export ZUUL_REF=${ZUUL_REF:-None}
# Compatibility with zuul v3 variables
export JOB_NAME={{ zuul.job }}
export LOG_PATH={{ zuul_log_path }}
export BRANCH_OVERRIDE="{{ branch_override | default('default') }}"
if [ "$BRANCH_OVERRIDE" != "default" ] ; then
export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE
if [[ $BRANCH_OVERRIDE =~ ^stable/ ]] ; then
export UPPER_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/${BRANCH_OVERRIDE#stable/}
export PIP_CONSTRAINT=https://releases.openstack.org/constraints/upper/${BRANCH_OVERRIDE#stable/}
fi
fi
export PYTHONUNBUFFERED=true
export TRIPLEO_ROOT={{ tripleo_root }}
# NOTE(trown) We can move this into the multinode environment file once we
# migrate the 2-node jobs over to zuulv3
bash -xe $TRIPLEO_ROOT/tripleo-ci/toci_gate_test.sh
executable: /bin/bash
chdir: '{{ tripleo_root }}'
environment: '{{ zuul | zuul_legacy_vars }}'
changed_when: true

View File

@ -1,85 +0,0 @@
# Periodic stable jobs set OVERRIDE_ZUUL_BRANCH, gate stable jobs
# just have the branch they're proposed to, e.g ZUUL_BRANCH, in both
# cases we need to set STABLE_RELEASE to match for tripleo.sh
export ZUUL_BRANCH=${ZUUL_BRANCH:-""}
# For OVB repo "stable/1.0" is feature branch
if [ "$ZUUL_BRANCH" = "stable/1.0" -o "$ZUUL_BRANCH" = "stable/2.0" -a "$ZUUL_PROJECT" = "openstack/openstack-virtual-baremetal" ]; then
export ZUUL_BRANCH="master"
fi
# Match puppet-pacemaker branches to respective releases
if [ "$ZUUL_BRANCH" = "stable/1.1.x" -a "$ZUUL_PROJECT" = "openstack/puppet-pacemaker" ]; then
export ZUUL_BRANCH="stable/wallaby"
export STABLE_RELEASE="wallaby"
fi
if [ "$ZUUL_BRANCH" = "stable/1.5.x" -a "$ZUUL_PROJECT" = "openstack/puppet-pacemaker" ]; then
export ZUUL_BRANCH="stable/zed"
export STABLE_RELEASE="zed"
fi
# For Ansible collection repo "stable/1.0.0" is a feature branch
if [ "$ZUUL_BRANCH" = "stable/1.0.0" -a "$ZUUL_PROJECT" = "openstack/ansible-collections-openstack" ]; then
export ZUUL_BRANCH="master"
fi
# For validations-libs repo "stable/1.6" is a support branch
if [ "$ZUUL_BRANCH" = "stable/1.6" -a "$ZUUL_PROJECT" = "openstack/validations-libs" ]; then
export ZUUL_BRANCH="stable/train"
export STABLE_RELEASE="train"
fi
# For validations-common repo "stable/1.6" is a support branch
if [ "$ZUUL_BRANCH" = "stable/1.6" -a "$ZUUL_PROJECT" = "openstack/validations-common" ]; then
export ZUUL_BRANCH="stable/train"
export STABLE_RELEASE="train"
fi
export OVERRIDE_ZUUL_BRANCH=${OVERRIDE_ZUUL_BRANCH:-""}
export STABLE_RELEASE=${STABLE_RELEASE:-""}
export FEATURE_BRANCH=${FEATURE_BRANCH:-""}
# In upgrade jobs STABLE_RELEASE is changed to point to the initial
# deployment branch but we need to keep the actual release for the review
# to be used in delorean-build phase.
export REVIEW_RELEASE=${REVIEW_RELEASE:-""}
if [[ -z $STABLE_RELEASE ]]; then
if [[ $ZUUL_BRANCH =~ ^stable/ ]]; then
export STABLE_RELEASE=${ZUUL_BRANCH#stable/}
export REVIEW_RELEASE=${ZUUL_BRANCH#stable/}
export UPPER_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/${STABLE_RELEASE}
export PIP_CONSTRAINT=https://releases.openstack.org/constraints/upper/${STABLE_RELEASE}
fi
if [[ $OVERRIDE_ZUUL_BRANCH =~ ^stable/ ]]; then
export STABLE_RELEASE=${OVERRIDE_ZUUL_BRANCH#stable/}
export REVIEW_RELEASE=${OVERRIDE_ZUUL_BRANCH#stable/}
export UPPER_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/${STABLE_RELEASE}
export PIP_CONSTRAINT=https://releases.openstack.org/constraints/upper/${STABLE_RELEASE}
fi
if [[ $OVERRIDE_ZUUL_BRANCH == stable/rhos* ]]; then
export UPPER_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/{{ release|default("master") }}
export PIP_CONSTRAINT=https://releases.openstack.org/constraints/upper/{{ release|default("master") }}
fi
if [[ $OVERRIDE_ZUUL_BRANCH =~ ^cloudsig/ ]]; then
export STABLE_RELEASE=${OVERRIDE_ZUUL_BRANCH}
export UPPER_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/${STABLE_RELEASE#cloudsig/}
export PIP_CONSTRAINT=https://releases.openstack.org/constraints/upper/${STABLE_RELEASE#cloudsig/}
fi
fi
# if we still don't have an stable branch, check if that
# is a feature branch
if [ -z "$STABLE_RELEASE" ] && [ "$ZUUL_BRANCH" != "master" ]; then
export FEATURE_BRANCH=$ZUUL_BRANCH
fi
export TRIPLEO_ROOT=${TRIPLEO_ROOT:-"/opt/stack/new"}
export WORKSPACE=${WORKSPACE:-"$TRIPLEO_ROOT/workspace"}
export PATH=/sbin:/usr/sbin:$PATH
export UNDERCLOUD_VM_NAME=instack
export NODEPOOL_DOCKER_REGISTRY_V2_PROXY=${NODEPOOL_DOCKER_REGISTRY_V2_PROXY:-""}
# post ci chores to run at the end of ci
SSH_OPTIONS='-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=Verbose -o PasswordAuthentication=no -o ConnectionAttempts=32'
# NOTE(pabelanger): this logic should be inverted to only include what developers need, not exclude things on the filesystem.
TARCMD="sudo XZ_OPT=-3 tar -cJf - --exclude=var/log/journal --exclude=udev/hwdb.bin --exclude=etc/puppet/modules --exclude=etc/project-config --exclude=etc/services --exclude=selinux/targeted --exclude=etc/services --exclude=etc/pki /var/log /etc"
JLOGCMD="sudo journalctl --output short-precise | sudo dd of=/var/log/journal-text.txt"

View File

@ -1 +0,0 @@
{{ featureset_override | to_nice_yaml( width=50) }}

View File

@ -1,229 +0,0 @@
function previous_release_from {
local release="${1:-master}"
local type="${2:-mixed_upgrade}"
local previous_version=""
case "${type}" in
'mixed_upgrade')
previous_version=$(previous_release_mixed_upgrade_case "${release}");;
'ffu_upgrade'|'ffu_undercloud_upgrade'|'ffu_standalone_upgrade')
previous_version=$(previous_release_ffu_upgrade_case "${release}");;
*)
echo "UNKNOWN_TYPE"
return 1
;;
esac
echo "${previous_version}"
}
function previous_release_mixed_upgrade_case {
local release="${1:-master}"
case "${release}" in
''|master|promotion-testing-hash-master)
echo "zed"
;;
zed|promotion-testing-hash-zed)
echo "wallaby"
;;
wallaby|promotion-testing-hash-wallaby)
echo "victoria"
;;
victoria|promotion-testing-hash-victoria)
echo "ussuri"
;;
ussuri|promotion-testing-hash-ussuri)
echo "train"
;;
*)
echo "UNKNOWN_RELEASE"
return 1
;;
esac
}
function previous_release_ffu_upgrade_case {
local release="${1:-master}"
case "${release}" in
''|master)
echo "wallaby"
;;
wallaby)
echo "train"
;;
*)
echo "INVALID_RELEASE_FOR_FFU"
return 1
;;
esac
}
function is_featureset {
local type="${1}"
local featureset_file="${2}"
[ $(shyaml get-value "${type}" "False"< "${featureset_file}") = "True" ]
}
function create_collect_logs_script {
cat > $LOGS_DIR/collect_logs.sh <<END
#!/bin/bash
set -x
export NODEPOOL_PROVIDER=${NODEPOOL_PROVIDER:-''}
export STATS_TESTENV=${STATS_TESTENV:-''}
export STATS_OOOQ=${STATS_OOOQ:-''}
export ZUUL_PIPELINE=${ZUUL_PIPELINE:-''}
export LOCAL_WORKING_DIR="$WORKSPACE/.quickstart"
export OPT_WORKDIR=$LOCAL_WORKING_DIR
export WORKING_DIR="$HOME"
export LOGS_DIR=$WORKSPACE/logs
export VIRTUAL_ENV_DISABLE_PROMPT=1
export ANSIBLE_CONFIG=$OOOQ_DIR/ansible.cfg
export ARA_DATABASE=sqlite:///${LOCAL_WORKING_DIR}/ara.sqlite
export ZUUL_CHANGES=${ZUUL_CHANGES:-''}
export NODES_FILE=${NODES_FILE:-''}
export TOCI_JOBTYPE=$TOCI_JOBTYPE
export STABLE_RELEASE=${STABLE_RELEASE:-''}
export QUICKSTART_RELEASE=${QUICKSTART_RELEASE:-''}
set +u
source $LOCAL_WORKING_DIR/bin/activate
set -u
source $OOOQ_DIR/ansible_ssh_env.sh
sudo unbound-control dump_cache > $LOGS_DIR/dns_cache.txt
mkdir -p $LOGS_DIR/quickstart_files
find $LOCAL_WORKING_DIR -maxdepth 1 -type f -not -name "*sqlite" | while read i; do cp -l \$i $LOGS_DIR/quickstart_files/\$(basename \$i); done
$QUICKSTART_COLLECTLOGS_CMD > $LOGS_DIR/quickstart_collect_logs.log || \
echo "WARNING: quickstart collect-logs failed, check quickstart_collectlogs.log for details"
cp $LOGS_DIR/undercloud/var/log/postci.txt.gz $LOGS_DIR/ || true
if [[ -e $LOGS_DIR/undercloud/home/$USER/tempest/testrepository.subunit.gz ]]; then
cp $LOGS_DIR/undercloud/home/$USER/tempest/testrepository.subunit.gz ${LOGS_DIR}/testrepository.subunit.gz
fi
# Copy tempest.html to root dir
if [ -f $LOGS_DIR/undercloud/home/$USER/tempest/tempest.html.gz ]; then
cp $LOGS_DIR/undercloud/home/$USER/tempest/tempest.html.gz ${LOGS_DIR}
fi
# Copy tempest and .testrepository directory to /opt/stack/new/tempest and
# unzip
sudo -s -- <<SUDO
mkdir -p /opt/stack/new
if [ -d $LOGS_DIR/undercloud/home/$USER/tempest ]; then
cp -Rf $LOGS_DIR/undercloud/home/$USER/tempest /opt/stack/new
fi
if [ -d /opt/stack/new/tempest/.testrepository ]; then
gzip -d -r /opt/stack/new/tempest/.testrepository
fi
SUDO
# clean up base log dir
if [[ -e $LOGS_DIR/releases.sh ]]; then
mv $LOGS_DIR/releases.sh $LOGS_DIR/quickstart_files/
fi
if [[ -e $LOGS_DIR/playbook_executions.log ]]; then
mv $LOGS_DIR/playbook_executions.log $LOGS_DIR/quickstart_files/
fi
if [[ -e $LOGS_DIR/emit_releases_file.log ]]; then
mv $LOGS_DIR/emit_releases_file.log $LOGS_DIR/quickstart_files/
fi
# record the size of the logs directory
# -L, --dereference dereference all symbolic links
# Note: tail -n +1 is to prevent the error 'Broken Pipe' e.g. 'sort: write failed: standard output: Broken pipe'
du -L -ch $LOGS_DIR/* | tail -n +1 | sort -rh | head -n 200 &> $LOGS_DIR/quickstart_files/log-size.txt || true
END
}
get_extra_vars_from_release()
{
local release_name=$1
local release_hash=$2
local newest_release_hash=${3:-""}
local release_file=$LOCAL_WORKING_DIR/config/release/tripleo-ci/${DISTRIBUTION:-CentOS}-${DISTRIBUTION_MAJOR_VERSION:-7}/$release_name.yml
echo "--extra-vars @$release_file -e dlrn_hash=$release_hash -e get_build_command=$release_hash ${newest_release_hash:+-e dlrn_hash_newest=$newest_release_hash}"
}
# Enclose IPv6 addresses in brackets.
# This is needed for scp command where the first column of IPv6 address gets
# interpreted as the separator between address and path otherwise.
# $1 : IP address to sanitize
function sanitize_ip_address {
ip=$1
if [[ $ip =~ .*:.* ]]; then
echo \[$ip\]
else
echo $ip
fi
}
function python_cmd() {
distribution=unknown
distribution_major_version=unknown
# we prefer python2 because on few systems python->python3
python_cmd=python3
if [ -f /etc/os-release ]; then
. /etc/os-release
distribution_major_version=${VERSION_ID%.*}
case $NAME in
"Red Hat"*) distribution="RedHat"
if [ "$distribution_major_version" -ge "8" ]; then
python_cmd=python3
fi
;;
"CentOS"*)
distribution="CentOS"
if [ "$distribution_major_version" -ge "8" ]; then
python_cmd=python3
fi
;;
"Fedora"*)
distribution="Fedora"
if [ "$distribution_major_version" -ge "28" ]; then
python_cmd=python3
fi
;;
"Ubuntu"*)
distribution="Ubuntu"
;;
"Debian"*)
distribution="Debian"
;;
esac
elif [ -f /etc/lsb-release ]; then
. /etc/lsb-release
distribution=${DISTRIB_ID}xx
distribution_major_version=${DISTRIB_RELEASE%.*}
elif [ -f /etc/debian_version ]; then
distribution="Debian"
distribution_major_version=$(cat /etc/debian_version | cut -d. -f1)
else
# Covers for FreeBSD and many others
distribution=$(uname -s)
if [ $distribution = Darwin ]; then
distribution="MacOSX"
distribution_major_version=$(sw_vers -productVersion | cut -d. -f1)
fi
which $python_cmd 2>&1 >/dev/null || {
python_cmd=/usr/local/bin/python2.7
}
fi
echo $python_cmd
}
function package_manager() {
PKG="$(command -v dnf || command -v yum)"
if [ "$(python_cmd)" == "python3" ]; then
echo "${PKG} -y --exclude=python2* $*"
else
echo "${PKG} -y --exclude=python3* $*"
fi
}

View File

@ -1 +0,0 @@
{{ run_test_role_vars | default({}) | to_nice_yaml( width=50) }}

View File

@ -1,219 +0,0 @@
#!/usr/bin/env bash
source $(dirname $0)/scripts/common_vars.bash
set -eux
export START_JOB_TIME=$(date +%s)
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'
source $TRIPLEO_ROOT/tripleo-ci/scripts/oooq_common_functions.sh
if [ -f /etc/nodepool/provider ] ; then
# this sets
# NODEPOOL_PROVIDER (e.g tripleo-test-cloud-rh1)
# NODEPOOL_CLOUD (e.g.tripleo-test-cloud-rh1)
# NODEPOOL_REGION (e.g. regionOne)
# NODEPOOL_AZ
source /etc/nodepool/provider
# source variables common across all the scripts.
if [ -e /etc/ci/mirror_info.sh ]; then
source /etc/ci/mirror_info.sh
fi
{% if rhcloud -%}
# In order to save space remove the cached git repositories, at this point in
# CI the ones we are interested in have been cloned to /opt/stack/new. We
# can also remove some distro images cached on the images.
sudo find /opt/git -delete || true
{% endif %}
fi
# default $NODEPOOL_PROVIDER if not already set as it's used later
export NODEPOOL_PROVIDER=${NODEPOOL_PROVIDER:-""}
# create logs dir (check if collect-logs doesn't already do this)
mkdir -p $WORKSPACE/logs
# Since python3 became default on some distros without even having a python/pip
# command installed due to PEP-0394, we can no longer rely on having
# unversioned commands available like python(2|3) or pip(2|3). We should only
# call pip using module approach which ensures we use the right version.
$(python_cmd) -m pip --version || \
(curl -s "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"; sudo $(python_cmd) get-pip.py)
if [ "$(python_cmd)" == "python3" ]; then
if [[ "$(package_manager)" == *"/usr/bin/yum"* ]]; then
sudo $(python_cmd) -m pip install requests
fi
sudo $(package_manager) install python3-setuptools python3-requests python3-urllib3 python3-PyYAML
else
sudo $(package_manager) install python2-setuptools python2-requests python-requests python-urllib3 PyYAML
fi
sudo $(python_cmd) -m pip install shyaml
# Sets whether or not this job will upload images.
export PERIODIC=0
# Sets which repositories to use in the job
export QUICKSTART_RELEASE="${STABLE_RELEASE:-master}"
# Stores OVB undercloud instance id
export UCINSTANCEID="null"
# Set the overcloud hosts for multinode
export OVERCLOUD_HOSTS=
export CONTROLLER_HOSTS=
export SUBNODES_SSH_KEY=
export EXTRA_VARS=${EXTRA_VARS:-""}
export VXLAN_VARS=${VXLAN_VARS:-""}
export EXTRANODE=""
export EMIT_RELEASES_EXTRA_ARGS=""
LOCAL_WORKING_DIR="$WORKSPACE/.quickstart"
LWD=$LOCAL_WORKING_DIR
export RELEASES_FILE_OUTPUT=$WORKSPACE/logs/releases.sh
export RELEASES_SCRIPT=$TRIPLEO_ROOT/tripleo-ci/scripts/emit_releases_file/emit_releases_file.py
export RELEASES_SCRIPT_LOGFILE=$WORKSPACE/logs/emit_releases_file.log
case {{ environment_type | default('standalone') }} in
ovb)
OVB=1
;;
multinode)
SUBNODES_SSH_KEY=/etc/nodepool/id_rsa
CONTROLLER_HOSTS=$(sed -n 1,1p /etc/nodepool/sub_nodes_private)
OVERCLOUD_HOSTS=$(cat /etc/nodepool/sub_nodes_private)
;;
esac
MIXED_UPGRADE_TYPE=''
# Order matters. ffu featureset has both mixed version and ffu_overcloud_upgrade.
if is_featureset ffu_overcloud_upgrade "{{ job_featureset_file }}"; then
MIXED_UPGRADE_TYPE='ffu_upgrade'
elif is_featureset ffu_undercloud_upgrade "{{ job_featureset_file }}" || is_featureset ffu_standalone_upgrade "{{ job_featureset_file }}" ; then
export UPGRADE_RELEASE=$QUICKSTART_RELEASE
export QUICKSTART_RELEASE=$(previous_release_from "${STABLE_RELEASE}" 'ffu_undercloud_upgrade')
{% if provider_dlrn_hash_tag_branch is defined %}
EMIT_RELEASES_EXTRA_ARGS="$EMIT_RELEASES_EXTRA_ARGS --content-provider-hashes={{ provider_dlrn_hash_tag_branch.keys()|zip(provider_dlrn_hash_tag_branch.values())|map('join',':')|join(';') }} --target-branch-override=$UPGRADE_RELEASE --install-branch-override=$QUICKSTART_RELEASE"
{% endif %}
elif is_featureset mixed_upgrade "{{ job_featureset_file }}"; then
MIXED_UPGRADE_TYPE='mixed_upgrade'
elif is_featureset undercloud_upgrade "{{ job_featureset_file }}"; then
export UPGRADE_RELEASE=$QUICKSTART_RELEASE
export QUICKSTART_RELEASE=$(previous_release_mixed_upgrade_case "${UPGRADE_RELEASE}")
{% if provider_dlrn_hash_tag_branch is defined %}
EMIT_RELEASES_EXTRA_ARGS="$EMIT_RELEASES_EXTRA_ARGS --content-provider-hashes={{ provider_dlrn_hash_tag_branch.keys()|zip(provider_dlrn_hash_tag_branch.values())|map('join',':')|join(';') }} --target-branch-override=$UPGRADE_RELEASE --install-branch-override=$QUICKSTART_RELEASE"
{% endif %}
# For minor_update we stay on the same branch, but we need to pass zuul information of 'current' content provider job in target-branch-override.
elif is_featureset minor_update "{{ job_featureset_file }}"; then
echo "minor update centos9/wallaby"
{% if provider_dlrn_hash_tag_branch is defined %}
EMIT_RELEASES_EXTRA_ARGS="$EMIT_RELEASES_EXTRA_ARGS --content-provider-hashes={{ provider_dlrn_hash_tag_branch.keys()|zip(provider_dlrn_hash_tag_branch.values())|map('join',':')|join(';') }} --target-branch-override=${QUICKSTART_RELEASE}-current --install-branch-override=$QUICKSTART_RELEASE"
{% endif %}
# This is a case for train branch, which uses featureset038. In featureset038 we test update workflow itself, no containers or rpms update happens.
# Target branch is overridden to be exactly the same as for deployment, because only containers used during deployment are in local container registry.
elif is_featureset overcloud_update "{{ job_featureset_file }}"; then
echo "minor update centos8/train"
{% if provider_dlrn_hash_tag_branch is defined %}
EMIT_RELEASES_EXTRA_ARGS="$EMIT_RELEASES_EXTRA_ARGS --content-provider-hashes={{ provider_dlrn_hash_tag_branch.keys()|zip(provider_dlrn_hash_tag_branch.values())|map('join',':')|join(';') }} --target-branch-override=$QUICKSTART_RELEASE"
{% endif %}
fi
# Set UPGRADE_RELEASE if applicable
if [ -n "${MIXED_UPGRADE_TYPE}" ]; then
export UPGRADE_RELEASE=$(previous_release_from "${STABLE_RELEASE}" "${MIXED_UPGRADE_TYPE}")
QUICKSTART_RELEASE="$QUICKSTART_RELEASE-undercloud-$UPGRADE_RELEASE-overcloud"
fi
{% if periodic|bool %}
PERIODIC=1
QUICKSTART_RELEASE="promotion-testing-hash-${QUICKSTART_RELEASE}"
EMIT_RELEASES_EXTRA_ARGS="$EMIT_RELEASES_EXTRA_ARGS --is-periodic"
{% if osp_release is defined %}
if is_featureset minor_update "{{ job_featureset_file }}"; then
# In downstream minor update job we use special, seperate promotion file
QUICKSTART_RELEASE="update-promotion-testing-hash-${STABLE_RELEASE:-master}"
fi
{% endif %}
{% endif %}
{% if osp_release is not defined %}
if [[ -f "$RELEASES_SCRIPT" ]] && [[ {{ featureset }} =~ 037|047|050|056|065|067|068 ]]; then
if [[ -f "$RELEASES_FILE_OUTPUT" ]]; then
echo "Importing ready releases.sh file - skipping releases.sh file generation."
else
$(python_cmd) $RELEASES_SCRIPT \
--stable-release ${STABLE_RELEASE:-"master"} \
--featureset-file $TRIPLEO_ROOT/tripleo-quickstart/config/general_config/$(basename {{ job_featureset_file }}) \
--output-file $RELEASES_FILE_OUTPUT \
--log-file $RELEASES_SCRIPT_LOGFILE \
--distro-name {{ ansible_distribution | lower }} \
--distro-version {{ ansible_distribution_major_version }} \
$EMIT_RELEASES_EXTRA_ARGS
fi
fi
{% endif %}
# Import gated tripleo-upgrade in oooq for upgrades/updates jobs
if [[ -d $TRIPLEO_ROOT/tripleo-upgrade ]]; then
echo "file://${TRIPLEO_ROOT}/tripleo-upgrade/#egg=tripleo-upgrade" >> ${TRIPLEO_ROOT}/tripleo-quickstart/quickstart-extras-requirements.txt
else
# Otherwise, if not importing it, oooq will fail when loading
# tripleo-upgrade role in the playbook.
echo "git+https://opendev.org/openstack/tripleo-upgrade.git@${ZUUL_BRANCH}#egg=tripleo-upgrade" >> ${TRIPLEO_ROOT}/tripleo-quickstart/quickstart-extras-requirements.txt
fi
# Import gated external repo in oooq - starting with browbeat, tripleo-ha-utils, openstack-ansible-os_tempest,
# ansible-config_template, ansible-role-python_venv_build, ansible-role-collect-logs
EXTERNAL_REPOS="x/browbeat openstack/tripleo-ha-utils openstack/tripleo-ci openstack/tripleo-quickstart-extras openstack/openstack-ansible-os_tempest \
openstack/ansible-config_template openstack/ansible-role-python_venv_build openstack/ansible-role-collect-logs \
openstack/tripleo-operator-ansible openstack/ansible-collections-openstack openstack/tripleo-ansible x/tripleo-ipa \
openstack/openstack-tempest-skiplist"
for EXTERNAL_REPO in $EXTERNAL_REPOS; do
if [[ -d ${TRIPLEO_ROOT%openstack}/$EXTERNAL_REPO ]]; then
sed -i "s#git+https://opendev.org/$EXTERNAL_REPO#file://${TRIPLEO_ROOT%openstack}/$EXTERNAL_REPO#1" ${TRIPLEO_ROOT}/tripleo-quickstart/quickstart-extras-requirements.txt
fi
done
# Start time tracking
export STATS_TESTENV=$(date +%s)
pushd $TRIPLEO_ROOT/tripleo-ci
if [ -e $WORKSPACE/instackenv.json -a "{{ environment_infra }}" = "ovb" ] ; then
echo "Running without te-broker"
export TE_DATAFILE=$WORKSPACE/instackenv.json
./toci_quickstart.sh
elif [ "{{ environment_infra }}" = "ovb" ] ; then
# We only support multi-nic at the moment
NETISO_ENV="multi-nic"
./toci_quickstart.sh
else
# Copy nodepool keys to current user
sudo cp /etc/nodepool/id_rsa* $HOME/.ssh/
sudo chown $USER:$USER $HOME/.ssh/id_rsa*
chmod 0600 $HOME/.ssh/id_rsa*
cat $HOME/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys
# pre-ansible requirement
sudo mkdir -p /root/.ssh/
# everything below here *MUST* be translated to a role ASAP
# empty image to fool overcloud deployment
# set no_proxy variable
export IP_DEVICE=${IP_DEVICE:-"eth0"}
MY_IP=$(ip addr show dev $IP_DEVICE | awk '/inet / {gsub("/.*", "") ; print $2}')
MY_IP_eth1=$(ip addr show dev eth1 | awk '/inet / {gsub("/.*", "") ; print $2}') || MY_IP_eth1=""
export http_proxy=""
undercloud_net_range="192.168.24."
undercloud_services_ip=$undercloud_net_range"1"
undercloud_haproxy_public_ip=$undercloud_net_range"2"
undercloud_haproxy_admin_ip=$undercloud_net_range"3"
export no_proxy=$undercloud_services_ip,$undercloud_haproxy_public_ip,$undercloud_haproxy_admin_ip,$MY_IP,$MY_IP_eth1
# finally, run quickstart
./toci_quickstart.sh
fi
echo "Run completed"

View File

@ -1,218 +0,0 @@
#!/usr/bin/env bash
set -eux
set -o pipefail
export ANSIBLE_NOCOLOR=1
LOCAL_WORKING_DIR="{{ workspace }}/.quickstart"
WORKING_DIR="$HOME"
LOGS_DIR={{ workspace }}/logs
source {{ tripleo_root }}/tripleo-ci/scripts/oooq_common_functions.sh
## Signal to toci_gate_test.sh we've started by
touch /tmp/toci.started
export DEFAULT_ARGS="--extra-vars local_working_dir=$LOCAL_WORKING_DIR \
--extra-vars virthost={{ undercloud }} \
--inventory $LOCAL_WORKING_DIR/hosts \
--extra-vars tripleo_root={{ tripleo_root }} \
--extra-vars working_dir=$WORKING_DIR \
--extra-vars tripleo_generate_scripts=true \
--skip-tags "{{ ','.join(skip_tags_list.split(',') + remove_tags|default([])) }}" \
"
# --install-deps arguments installs deps and then quits, no other arguments are
# processed.
QUICKSTART_PREPARE_CMD="
./quickstart.sh
--install-deps
"
QUICKSTART_VENV_CMD="
./quickstart.sh
{% if teardown|default(true)|bool %}
--bootstrap
{% endif %}
--no-clone
{% if environment_type == 'baremetal' -%}
{# It needs to be installed on zuul node to drive deployment #}
--url-requirements git+https://opendev.org/openstack/tripleo-operator-ansible/#egg=tripleo-operator-ansible
{% endif %}
--working-dir $LOCAL_WORKING_DIR
--playbook noop.yml
--retain-inventory
{{ undercloud }}
"
QUICKSTART_INSTALL_CMD="
$LOCAL_WORKING_DIR/bin/ansible-playbook
--tags {{ ','.join(tags + (extra_tags|default([]))) }}
"
export QUICKSTART_DEFAULT_RELEASE_ARG="--extra-vars @$LOCAL_WORKING_DIR/config/release/tripleo-ci/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}/$QUICKSTART_RELEASE.yml"
QUICKSTART_COLLECTLOGS_CMD="$LOCAL_WORKING_DIR/bin/ansible-playbook \
$LOCAL_WORKING_DIR/playbooks/collect-logs.yml \
-vvvv \
$QUICKSTART_DEFAULT_RELEASE_ARG \
{{ featureset_conf }} \
{{ env_vars }} \
{{ role_vars }} \
{{ extra_vars }} \
$DEFAULT_ARGS \
--extra-vars @{{ tripleo_root }}/tripleo-ci/toci-quickstart/config/collect-logs.yml \
--extra-vars artcl_collect_dir=$LOGS_DIR \
--extra-vars @{{ workspace }}/logs/zuul-variables.yaml \
--extra-vars @{{ workspace }}/logs/hostvars-variables.yaml \
--tags all \
"
declare -A RELEASE_ARGS=()
if [[ -f "$RELEASES_FILE_OUTPUT" ]]; then
source $RELEASES_FILE_OUTPUT
declare -A RELEASE_ARGS=(
["multinode-undercloud.yml"]=$(get_extra_vars_from_release \
$UNDERCLOUD_INSTALL_RELEASE $UNDERCLOUD_INSTALL_HASH)
["multinode-undercloud-upgrade.yml"]=$(get_extra_vars_from_release \
$UNDERCLOUD_TARGET_RELEASE $UNDERCLOUD_TARGET_HASH)
["multinode-overcloud-prep.yml"]=$(get_extra_vars_from_release \
$OVERCLOUD_DEPLOY_RELEASE $OVERCLOUD_DEPLOY_HASH)
["multinode-overcloud.yml"]=$(get_extra_vars_from_release \
$OVERCLOUD_DEPLOY_RELEASE $OVERCLOUD_DEPLOY_HASH)
["multinode-overcloud-update.yml"]=$(get_extra_vars_from_release \
$OVERCLOUD_TARGET_RELEASE $OVERCLOUD_TARGET_HASH)
["multinode-overcloud-upgrade.yml"]=$(get_extra_vars_from_release \
$OVERCLOUD_TARGET_RELEASE $OVERCLOUD_TARGET_HASH)
["multinode-validate.yml"]=$(get_extra_vars_from_release \
$OVERCLOUD_TARGET_RELEASE $OVERCLOUD_TARGET_HASH)
["multinode-standalone.yml"]=$(get_extra_vars_from_release \
$STANDALONE_DEPLOY_RELEASE $STANDALONE_DEPLOY_HASH \
$STANDALONE_DEPLOY_NEWEST_HASH)
["multinode-standalone-upgrade.yml"]=$(get_extra_vars_from_release \
$STANDALONE_TARGET_RELEASE $STANDALONE_TARGET_HASH \
$STANDALONE_TARGET_NEWEST_HASH)
)
fi
if is_featureset mixed_os "{{ job_featureset_file }}"; then
eight_release=$LOCAL_WORKING_DIR/config/release/tripleo-ci/${DISTRIBUTION:-CentOS}-8/$QUICKSTART_RELEASE.yml
RELEASE_ARGS=(
["multinode-overcloud-mixed-os-repos-compute.yml"]=" --extra-vars @$eight_release --extra-vars registry_distro=8 "
["multinode-undercloud-mixed-os.yml"]=" $QUICKSTART_DEFAULT_RELEASE_ARG --extra-vars registry_distro=9 --extra-vars registry_distro_lower=8 "
["multinode-overcloud-prep.yml"]=" $QUICKSTART_DEFAULT_RELEASE_ARG --extra-vars registry_distro=9 "
["multinode-overcloud-mixed-os-deploy.yml"]=" $QUICKSTART_DEFAULT_RELEASE_ARG --extra-vars registry_distro=9 --extra-vars registry_distro_lower=8 "
)
fi
declare -A PLAYBOOKS_ARGS=(
["baremetal-full-overcloud.yml"]=" --extra-vars validation_args='--validation-errors-nonfatal' "
["multinode-overcloud.yml"]=" --extra-vars validation_args='--validation-errors-nonfatal' "
["multinode.yml"]=" --extra-vars validation_args='--validation-errors-nonfatal' "
)
# minor_update variable is set to true only in featureset068
# In downstream we do not use content provider and we pull already created images, so we only need to override container images tag with newer one(override_docker_image_tag)
# In upstream we need to override container_registry_release to get ip of docker registry and dlrn hash from content provider which provides containers with 'current' tag
# Containers are required to be pulled both to undercloud and overcloud to run minor update on the same branch
# Also to trigger update of undercloud and overcloud from correct playbook, overcloud_update and undercloud_update extra-vars are set to false respectively
if is_featureset minor_update "{{ job_featureset_file }}"; then
{% if osp_release is defined %}
PLAYBOOKS_ARGS=(
["multinode-undercloud-upgrade.yml"]="--extra-vars overcloud_update='false' --extra-vars override_docker_image_tag='true' "
["multinode-overcloud-update.yml"]="--extra-vars undercloud_update='false' --extra-vars override_docker_image_tag='true'"
)
{% else %}
PLAYBOOKS_ARGS=(
["multinode-undercloud-upgrade.yml"]=" --extra-vars container_registry_release='${QUICKSTART_RELEASE}-current' --extra-vars promote_source='current' --extra-vars overcloud_update='false' "
["multinode-overcloud-update.yml"]=" --extra-vars container_registry_release='${QUICKSTART_RELEASE}-current' --extra-vars promote_source='current' --extra-vars undercloud_update='false' "
)
{% endif %}
fi
mkdir -p $LOCAL_WORKING_DIR
# TODO(gcerami) parametrize hosts
cp {{ tripleo_root }}/tripleo-ci/toci-quickstart/config/testenv/{{ environment_infra }}_hosts $LOCAL_WORKING_DIR/hosts
pushd {{ tripleo_root }}/tripleo-quickstart/
$QUICKSTART_PREPARE_CMD
$QUICKSTART_VENV_CMD
# Only ansible-playbook command will be used from this point forward, so we
# need some variables from quickstart.sh
OOOQ_DIR={{ tripleo_root }}/tripleo-quickstart/
export OPT_WORKDIR=$LOCAL_WORKING_DIR
export ANSIBLE_CONFIG=$OOOQ_DIR/ansible.cfg
export ANSIBLE_COLLECTIONS_PATHS="$OPT_WORKDIR/share/ansible/collections:~/.ansible/collections:/usr/share/ansible/collections"
export ARA_DATABASE="sqlite:///${LOCAL_WORKING_DIR}/ara.sqlite"
export VIRTUAL_ENV_DISABLE_PROMPT=1
# Workaround for virtualenv issue https://github.com/pypa/virtualenv/issues/1029
set +u
source $LOCAL_WORKING_DIR/bin/activate
set -u
source $OOOQ_DIR/ansible_ssh_env.sh
# Debug step capture env variables
{% if dryrun|default(false)|bool %}
echo "-- Capture Environment Variables Used ---------"
echo "$(env)" | tee -a $LOGS_DIR/toci_env_args_output.log
declare -p | tee -a $LOGS_DIR/toci_env_args_output.log
{% endif %}
echo "-- Playbooks Output --------------------------"
for playbook in {{ " ".join(playbooks) }}; do
echo "$QUICKSTART_INSTALL_CMD \
${RELEASE_ARGS[$playbook]:=$QUICKSTART_DEFAULT_RELEASE_ARG} \
{{ nodes_args }} \
{{ featureset_conf }} \
{{ env_vars }} \
{{ role_vars }} \
{{ extra_vars }} \
{{ vxlan_vars }} {{ quickstart_verbosity|default('') }} \
$DEFAULT_ARGS \
$LOCAL_WORKING_DIR/playbooks/$playbook ${PLAYBOOKS_ARGS[$playbook]:-}" \
--extra-vars @{{ workspace }}/logs/zuul-variables.yaml \
--extra-vars @{{ workspace }}/logs/hostvars-variables.yaml \
| sed 's/--/\n--/g' \
| tee -a $LOGS_DIR/playbook_executions.log
echo "# --------------------------------------- " \
| tee -a $LOGS_DIR/playbook_executions.log
done
{% if dryrun|default(false)|bool %}
# Bypassing execution, dryrun was set
exit_value=0
{% else %}
## LOGS COLLECTION PREPARE
create_collect_logs_script
for playbook in {{ " ".join(playbooks) }}; do
echo ${RELEASE_ARGS[$playbook]:=$QUICKSTART_DEFAULT_RELEASE_ARG}
$QUICKSTART_INSTALL_CMD \
${RELEASE_ARGS[$playbook]:=$QUICKSTART_DEFAULT_RELEASE_ARG} \
{{ nodes_args }} \
{{ featureset_conf }} \
{{ env_vars }} \
{{ role_vars }} \
{{ extra_vars }} \
{{ vxlan_vars }} {{ quickstart_verbosity|default('') }} \
$DEFAULT_ARGS \
--extra-vars @{{ workspace }}/logs/zuul-variables.yaml \
--extra-vars @{{ workspace }}/logs/hostvars-variables.yaml \
$LOCAL_WORKING_DIR/playbooks/$playbook ${PLAYBOOKS_ARGS[$playbook]:-} \
2>&1 | tee -a $LOGS_DIR/quickstart_install.log && exit_value=0 || exit_value=$?
# Print status of playbook run
[[ "$exit_value" == 0 ]] && echo "Playbook run of $playbook passed successfully"
[[ "$exit_value" != 0 ]] && echo "Playbook run of $playbook failed" && break
done
[[ "$exit_value" == 0 ]] && echo "Playbook run passed successfully" || echo "Playbook run failed"
{% endif %}
echo 'Quickstart completed.'
{% if force_job_failure|default(false) %}echo "Quickstart completed with exit code $exit_value but forcing failure with exit 1"
exit 1{% else %}
exit $exit_value{% endif %}

View File

@ -1,7 +0,0 @@
---
rpm_packages:
- git
- python3
- python3-libselinux
- python3-setuptools
# - python3-venv

View File

@ -1,44 +0,0 @@
---
- name: Set the ci_branch fact
include_role:
name: build-containers
tasks_from: set_ci_branch
- name: Get ci-common-vars
include_role:
name: ci-common-vars
- name: Set facts for release_file_name
set_fact:
release_file_name: "{{ 'promotion-testing-hash-' + ci_branch + '.yml' if 'periodic' in zuul.job else ci_branch + '.yml' }}"
t_q_release_dir: "{{ tripleo_quickstart_dir }}/config/release/tripleo-ci/{{ ansible_distribution }}-{{ ansible_distribution_major_version }}"
whole_disk_images: true
enable_opstools_repo: true # for collectd container build
cacheable: true
- name: "fetch {{ release_file_name }} into ansible executor work_root"
fetch:
src: "{{ t_q_release_dir }}/{{ release_file_name }}"
dest: "{{ zuul.executor.work_root }}/"
flat: true
- name: Load vars from release file
include_vars:
file: "{{ zuul.executor.work_root }}/{{ release_file_name }}"
- name: "Load dependency-ci vars when 'dependency' is defined"
block:
- name: Set dependency facts
set_fact:
t_q_dependency_dir: "{{ tripleo_quickstart_dir }}/config/release/dependency_ci/{{ job.dependency|default(dependency) }}"
- name: "fetch dependency {{ job.dependency }} file into ansible executor work_root"
fetch:
src: "{{ t_q_dependency_dir }}/repo_config.yaml"
dest: "{{ zuul.executor.work_root }}/"
flat: true
- name: Load vars from dependency file
include_vars:
file: "{{ zuul.executor.work_root }}/repo_config.yaml"
when: job.dependency is defined or dependency is defined

View File

@ -1,56 +0,0 @@
---
- 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
- name: Remove pip package if already installed
become: true
package:
name: python3-pip
state: absent
when: ansible_distribution_major_version is version('8', '>')
- name: Get pip needed for tripleo-repos installation
include_role:
name: ensure-pip
vars:
ensure_pip_from_packages: false
ensure_pip_from_upstream: true
- name: install tripleo-repos from git checkout
shell: |
pushd "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
python3 setup.py install --user
popd
failed_when: false
changed_when: true
- name: install tripleo-repos as superuser to be available for yum-config module
become: true
shell: |
pushd "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
python3 setup.py install
popd
failed_when: false
changed_when: true
when: use_yum_config_module is defined and use_yum_config_module|bool
- name: Include repo-setup role
include_role:
name: repo-setup
vars:
repo_setup_dir: "{{ workspace }}"
repo_setup_use_collections: false
- name: Install python3-tripleoclient python3-virtualenv
become: true
package:
name:
- python3-virtualenv
- python3-tripleoclient
state: latest

View File

@ -1,4 +0,0 @@
tripleo-ci-post
===============
A role to return Zuul job artifacts for Standalone and Multinode Job.

View File

@ -1,10 +0,0 @@
---
- import_tasks: post-artifact-mult.yml
when:
- environment_type is defined and environment_type == "multinode"
- ansible_distribution_major_version is version(8, '>=')
- import_tasks: post-artifact-sa.yml
when:
- environment_type is defined and environment_type == "standalone"
- ansible_distribution_major_version is version(8, '>=')

View File

@ -1,26 +0,0 @@
---
- name: Return artifact for Multinode Jobs
zuul_return:
data:
zuul:
artifacts:
- name: Undercloud deploy log
url: logs/undercloud/home/zuul/undercloud_install.log
- name: Overcloud deploy log
url: logs/undercloud/home/zuul/overcloud_deploy.log
- name: Tempest results
url: logs/stackviz/index.html#/testrepository.subunit
- name: All logs file in home dir
url: logs/undercloud/home/zuul/
- name: Extra logs
url: logs/undercloud/var/log/extra/index.html
- name: Errors file
url: logs/undercloud/var/log/extra/errors.txt
- name: Delorean build logs
url: logs/delorean_logs/
- name: System logs for each container
url: logs/undercloud/var/log/containers/
- name: Podman container setup configuration and setup logs
url: logs/undercloud/var/log/extra/podman/
- name: Container download, container update and provision log
url: logs/undercloud/var/log/tripleo-container-image-prepare.log

View File

@ -1,24 +0,0 @@
---
- name: Return artifacts for standalone jobs
zuul_return:
data:
zuul:
artifacts:
- name: Standalone deploy log
url: logs/undercloud/home/zuul/standalone_deploy.log
- name: All logs file in home dir
url: logs/undercloud/home/zuul/
- name: Tempest results
url: logs/stackviz/index.html#/testrepository.subunit
- name: Extra logs
url: logs/undercloud/var/log/extra/index.html
- name: Errors file
url: logs/undercloud/var/log/extra/errors.txt
- name: Delorean build logs
url: logs/delorean_logs/
- name: System logs for each container
url: logs/undercloud/var/log/containers/
- name: Podman container setup configuration and setup logs
url: logs/undercloud/var/log/extra/podman/
- name: Container download, container update and provision log
url: logs/undercloud/var/log/tripleo-container-image-prepare.log

View File

@ -1,54 +0,0 @@
tripleo-repos
=============
A role to install and run tripleo-repos to setup the CentOS and RDO yum
repositories.
Role Variables
--------------
.. list-table:: Variables used for chrony
:widths: auto
:header-rows: 1
* - Name
- Default Value
- Description
* - `tripleo_repos_repository`
- `git+https://opendev.org/openstack/tripleo-repos`
- Git repository to pip install tripleo-repos from
* - `workspace`
- `ansible_user_dir`
- Workspace directory to put the venv into
* - `centos_mirror_host`
- `http://mirror.centos.org`
- Mirror host for CentOS repositories
* - `rdo_mirror_host`
- `https://trunk.rdoproject.org`
- Mirror host for RDO repositories
Requirements
------------
- ansible >= 2.4
- python >= 2.6
Dependencies
------------
None
Example Playbooks
-----------------
.. code-block::
- hosts: localhost
become: true
roles:
- tripleo-repos
License
-------
Apache 2.0

View File

@ -1,14 +0,0 @@
---
# defaults file for tripleo-repos
tripleo_repos_repository: "git+https://opendev.org/openstack/tripleo-repos"
workspace: "{{ ansible_user_dir }}"
centos_mirror_host: "http://mirror.centos.org"
fedora_mirror_host: "https://mirrors.fedoraproject.org"
rdo_mirror_host: "https://trunk.rdoproject.org"
override_repos: ""
rpm_packages:
- git
- python3-libselinux
- python3-pip
- python3-setuptools
- python3-virtualenv

View File

@ -1,2 +0,0 @@
---
# handlers file for tripleo-repos

View File

@ -1,61 +0,0 @@
---
collections:
- community.general # for ini_file
galaxy_info:
author: Alex Schultz
description: Role to run tripleo-repos
role_name: tripleo_repos
namespace: tripleo
# If the issue tracker for your role is not on github, uncomment the
# next line and provide a value
# issue_tracker_url: http://example.com/issue/tracker
# Some suggested licenses:
# - BSD (default)
# - MIT
# - GPLv2
# - GPLv3
# - Apache
# - CC-BY
license: Apache
min_ansible_version: 2.4
# If this a Container Enabled role, provide the minimum Ansible Container version.
# min_ansible_container_version:
# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
# Galaxy will use this branch. During import Galaxy will access files on
# this branch. If Travis integration is configured, only notifications for this
# branch will be accepted. Otherwise, in all cases, the repo's default branch
# (usually master) will be used.
# github_branch:
#
# platforms is a list of platforms, and each platform has a name and a list of versions.
#
platforms:
- name: Fedora
# versions:
# - all
# - 25
- name: CentOS
# versions:
# - all
# - 1.0
# - 7
# - 99.99
galaxy_tags: []
# List tags for your role here, one per line. A tag is a keyword that describes
# and categorizes the role. Users find roles by searching for tags. Be sure to
# remove the '[]' above, if you add tags to this list.
#
# NOTE: A tag is limited to a single word comprised of alphanumeric characters.
# Maximum 20 tags per role.
dependencies: []
# List your role dependencies here, one per line. Be sure to remove the '[]' above,
# if you add dependencies to this list.

View File

@ -1,13 +0,0 @@
---
- name: Converge
hosts: all
tasks:
- name: import tripleo-repos role
include_role:
name: tripleo-repos
- name: validate that we can install openstack-tripleo-common # noqa package-latest
package:
name: openstack-tripleo-common
state: latest

View File

@ -1,18 +0,0 @@
---
# The MOLECULE_ vars used here are not officialy endorsed by molecule, but we
# hope a future version will add implicit support for them.
driver:
name: docker
log: true
platforms:
- name: stream8
hostname: stream8
# image below is based on official quay.io/centos/centos:stream8 but
# it has python preinstalled on it.
image: quay.io/pycontribs/centos:stream8
pre_build_image: true
# pull: true
provisioner:
name: ansible

View File

@ -1,15 +0,0 @@
---
- hosts: all
tasks:
- name: Remove EPEL repository (and clean up left-over metadata)
package:
name: epel-release
state: absent
notify: yum-clean-metadata
handlers:
- name: yum-clean-metadata
command: yum clean metadata
args:
warn: false

Some files were not shown because too many files have changed in this diff Show More