setting ANSIBLE_PYTHON_INTERPRETER to auto will use the value from the
ansible/config/base.yml
debian gets a /usr/bin/python3 for now and need to revisit once we have
ansible 2.10.
Change-Id: I503c1b71c0d01eea668500c0125c752c0584a7ef
Co-Authored-By: Jonathan Rosser <jonathan.rosser@rd.bbc.co.uk>
Older ansible versions used match as a filter but this is no longer
valid, and match and search should be used as a test
Change-Id: I7017220f04fa98ea5d7f1f6e511a395963308b47
- Update ZUUL_TESTS_CLONE_LOCATION path to new OpenDev path
- Update location of clones repos
Co-Authored-By: Jonathan Rosser <jonathan.rosser@rd.bbc.co.uk>
Change-Id: I3968602b5ddf8a7d3f4292bbc8744d8d6daf1395
When targeting localhost with 'remote_user: root' and
using 'become: yes' we lose the environment variables
for the user running the playbook (eg: USER, HOME).
However, if we use 'connection: local' and 'become: yes'
together, it works properly.
To ensure these plays have the correct access to change
things on the host, we apply this change to them all.
We also ensure that 'become: no' is explicitly set on
any local connection plays to make the intent more
obvious. Finally, we also use 'yes' and 'no' uniformly.
Change-Id: I6e4607dd4aaffa0bfcda254103697bf9b28eca1a
This is a fixup for a6e2e511a47e("Use refspec to try Gerrit changes").
We also need to take the refspec parameter into consideration when
cloning repositories outside of OpenStack CI. This will facilitate
manual testing.
Change-Id: Ie96eb6dcd14cfec8c2b3813fbd67eef441178cdb
Without this patch, deployers have to mimic zuul structure
to locally test Gerrit patches in-depth, with their specific
references, before they are merged into the main tree.
This is a problem for people wanting to not change the location
of the openstack-ansible folder.
This patches solves the problem by using the refspec
parameter of the ansible git module: A user can then
edit its own ansible-role-requirements for testing
patches.
Change-Id: I6c0fa078da3f32b542d3a3492a0fb79c822a5f8d
When executing the clones outside of openstack-ci, we should
verify that we're not cloning the role repository for the role
we are testing because we already have it.
Change-Id: Ibc64fc5c97f0b711934eb3e297159b0d38587647
Now that we're using a broader range of repository names,
we need to adjust how we implement the role linking to
ensure that the new role names are catered for.
Change-Id: I43efc47dcacdfba31193f7f8a3159a1d0481c586
There is absolutely no chance that zuul will be reverted
back to v2, so let's remove the extra code.
Change-Id: Ia3e4c5ea6514f9caeeea936afd10fac9a54a09c8
In order to decouple changes in the roles repositories from changes
needed in other repositories due to the ansible-lint test, the roles
repositories will skip all dependent roles when executing the lint test.
The roles can be updated in time as patches are submitted to those
repositories. In order to do that, we need to stop symlinking the
role into the same directory where its dependent roles are and place
it to its own directory so we can ignore the dependent roles in
ansible-lint.
Change-Id: I49c01fb63054e45bae5ae45a89cce986579959de
Closes-Bug: #1737310
Currently the ansible-syntax and ansible-lint tests
assume the playbook to be tested against, the role
requirements file location and a single path for all
roles. This patch allows these to be modified so that
the tests can be used for the integrated repo which
does not have the same structure as the roles.
Various lint failures are no being picked up with
these modifications, so they're resolved using quick
hacks.
Change-Id: I8bea90082dbde7de49c5e2e86d298c017b16591d
There have been several failures due to git clone TLS handshake
fails.
This patch implement the use of clone depth in order to reduce
the amount of data being cloned. This will not always work as
depth only works when the clone is from a ref, but it will help
in those circumstances.
This patch also implements retries with a delay between each
retry in order to try and improve the success rate.
Change-Id: I72a7d39218c307fc1c6f108b81f35d2cd5bb5c66
This patch implements an initial set of jobs intended to match
the current job execution method. It does not intend to improve
how the jobs are executed - only to replicate what is currently
in openstack-infra/openstack-zuul-jobs and provide the platform
to iterate on.
Change-Id: Iafe9f3622037d7ba71f9ba8b73217f9e2070f246
In order to be able to simultaneously work with the
differing implementations of zuul-cloner in zuul v2
and zuul v3 we implement a detection routine to
behave appropriately for each version.
This is very much a band-aid just to help us transition
because once the transition to zuul v3 is complete we
should be able to ditch this whole playbook for
something built into zuul v3, and use something very
simple for executing tests when not using zuul.
Change-Id: Ic824e7ca7c564d5de7a27c77a79014ad274afade
In order to facilitate upgrade testing of more
than just openstack roles, we use the previous_
prefix and need zuul to ignore those.
Change-Id: Ic881bf3acf6fb6daf71611c26322f02fb8b0b9be
When executing tests in OpenStack-CI, this patch
enables the use of 'Depends-On: <change-id>' in
the commit message to execute the test using a
patch that is still in review for the openstack/ara
repository.
This patch also lays the ground for similar testing
to be done with other openstack repositories, but
that will no work just yet as it will take quite a
bit more machinery to make the cloned repositories
be used to build the venvs. That work will be
submitted in subsequent patches.
Change-Id: I7bc665bc7f8dd1759f521622e7607c089696a546
In Ansible 2.3 the local connection plugin overrides
the host vars for the ansible_python_interpreter,
causing tests to use the wrong interpreter and
install python packages into unexpected locations.
This is especially visible when using host
delegation to localhost instead of the targeting
localhost directly.
To ensure that the behaviour remains consistent with
our expectations all local connection usage for
localhost is removed and localhost is targeted as
a remote host.
Change-Id: Ifcccf3c25aa10085b35017b01644354e10eca15a
When including a patch from the tests repo, it's not
cloned to the right place. This should ensure that
it is.
Change-Id: Ia1edf6454823880554f9beeb20e821e9d15413af
During upgrade tests a static source is used for the role
that is being upgraded from and it uses a special name.
In this patch we ensure that zuul-cloner does not try to
do anything clever with it.
Change-Id: I0760597a218cd6fe4d6cd3a81b0b437c89b48b40
There is no need to spend time gathering facts since we are not using
any of them so avoid that in order to speed up the role fetching
process.
Change-Id: Ib7a13e180eff41d67052378ecec204a620c4e8d8
When zuul cloner is used, the git clone task skips all the
openstack repositories and generates a lot of log noise.
This patch filters the list prior to giving it to the task
so that the noise is reduced.
Change-Id: Ia51b6c0899611fe92c8232a252b07c985aef923d
Commit cf6bea2acc ("Enable cross-repo testing for OSA role tests")
added the ability to test patchsets along with their dependencies.
However, it also modified the get-ansible-role-requirements.yml
playbook leading to repositories being cloned as root. This breaks
regular user testing as follows:
ln -s /vagrant /home/vagrant/.ansible/roles/<role>
ln: failed to create symbolic link ‘/home/vagrant/.ansible/roles/<role>’: Permission denied
The reason for that is that the $HOME/.ansible/roles is created as
'root' in the get-ansible-role-requirements.yml playbook so any attempt
to make modifications as regular user results to failure. It appears
that nothing in that playbook needs 'root' privileges so we run the
whole playbook as a regular user. Moreover, the playbook clears the
/etc/ansible/roles/* directories but the cloning happens in the $HOME
directory so we fix that as well.
Fixes: cf6bea2acc ("Enable cross-repo testing for OSA role tests")
Change-Id: I20c668108aea7404006247c9ba6abb1f5899735a
When 'Depends-On: <change-id>' is used in a patch,
Zuul cloner must be used in order to ensure that
both patches are actually used for the gate test.
This patch implements the use of zuul-cloner [1]
for gate tests and falls back to using git if
zuul-cloner is not present.
Additionally the playbook execution requires the
file based inventory to be used instead of the
CLI string so that the python interpreter is set.
This is required in order to ensure that the copy
module can act against CentOS with access to the
libselinux-python library on the host. See [2] for
more details.
[1] http://docs.openstack.org/infra/zuul/cloner.html
[2] https://goo.gl/VCKKfp
Change-Id: I8cf4d7d30284e5ef1e70897f2ecfe1da0b11c0c7
Added get-ansible-role-requirements.yml to a testing repo that
uses git clone to download the roles instead of downloading the
roles using ansible-galaxy.
Closes-Bug: 1626113
Change-Id: I241de348310a7a3beba6181a271f5351c9460318