Changes in Ansible require us to update our tests to ensure we're not
running workloads in a conflicting environment. The tox job has been
changed to openstack-tox-with-sudo to ensure we're not revoking sudo
when it is needed.
Change-Id: I86c2b78097431e2611efa1a2119e11d197cf393c
Signed-off-by: Kevin Carter <kecarter@redhat.com>
[0] enabled the execution of molecule tests to cover the tripleo-ansible
added modules. However, the job was removed due to the movement to
collections.
As currently, none of the molecule tests under ansible_plugins/tests are
being triggered by the CI any changes into the corresponding modules
might break their functionality and pass unnoticed.
This patch enables back the tripleo-ansible-centos-8-molecule-tripleo-modules
test which will get triggered when some of the corresponding modules
get modified.
[0]: 2d42082737
Change-Id: Id6f89dfa7075e59f17fe847e3d14024aaa287933
We were always using the upper-constraints when creating tox
environments, however there is currently an issue with molecule and
openstack upper-constraints that is preventing it from being used.
Until molecule can be fixed to work with openstack upper-constraints,
lets drop this configuration. We are already adding the constraints to
the doc and release notes jobs.
https://github.com/ansible-community/molecule/pull/3244
Change-Id: I91ebaa059dc2451bba739a0a2de917e2f3c2aa21
Related-Bug: #1942704
Also takes the opportunity to ignore "meta" directory from molecule
jobs. Since we apparently can't use "irrevelant_files" with "files",
we're using a negative look-ahead regexpi[1], to take all BUT "meta.*".
[1] https://www.regular-expressions.info/lookaround.html
NOTE: this patch also toggle tripleo-ansible-centos-8-role-addition to
non-voting in order to get this change merged. This job times out on a
regular basis, and prevents this needed patch to merge. Follow-up are
needed, for instance calling "pip-compile" as it's now done here:
https://review.opendev.org/c/openstack/tripleo-quickstart/+/807491
Closes-Bug: 1943965
Change-Id: I84d077c6daefdbeda4fda2d1f8fdd400c7437500
Signed-off-by: Kevin Carter <kecarter@redhat.com>
Instead of importing code from 2.9 Ansible modules, start import
it from Openstack Ansible collection.
It requires Openstack Ansible collection to be installed and will
work with both Ansible 2.9 and 2.11
Change-Id: I0f9f0d26a6b499c13af994edd1353b19620be14d
The tox option to skip source distribution building is skipsdist,
but this seems to be often misspelled skipdist instead, which gets
silently ignored and so does not take effect. Correct it
everywhere, in hopes that new projects will finally stop copying
this mistake around.
See https://tox.readthedocs.io/en/latest/config.html#conf-skipsdist
and https://github.com/tox-dev/tox/issues/1388 for details.
Change-Id: I75d7bebe855e62125e701fea89cf1527e3456535
1) Drop tripleo-common constraint
The new pip dependency resolver doesn't work well with links. See pip
issue #8253. Also we should require a release of tripleo-common for CI
to function. This is similar to what we do with tripleoclient. This
change also bumps the lower bound for tripleo-common to the latest for
master which is 13.0.0. This should be adjusted for backports.
2) Exclude reqs and tox files from modules job temporarly, will be
fixed in next patch
Change-Id: I1363d911a39e4072a706c61d83d113db6f85f71c
Closes-Bug: #1908079
Tox trying to install latest versions for building releasenotes,
doc which may not be supported by stable and lower branches,
so should be restricted by respective version's upper-constraints.txt
Change-Id: Ib430947bb840d403f1a492bd9c49a89ccdd8d4f4
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so will switch to the correct
upper-constraints list automatically when the requirements repository branches.
Change-Id: Iba09985b9ce0b5f6a528ef89bbe8f69a1aa173d7
Update the minversion parameter to use the python -m pip to install
python packages:
https://tox.readthedocs.io/en/latest/changelog.html#id185
It's recommend to use this. Remove the useless install_command
parameter.
Change-Id: I3d61db1767ad80995b5c3b8e1727b0655c79903d
By artificially setting the upper constraint file we ignore
global-requirements which then creates errors like the following:
role-addition run-test: commands[2] | pip check
setting PATH=/home/zuul/src/opendev.org/openstack/tripleo-ansible/.tox/role-addition/bin:/home/zuul/.local/bin:/home/zuul/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
[43268] /home/zuul/src/opendev.org/openstack/tripleo-ansible$ /home/zuul/src/opendev.org/openstack/tripleo-ansible/.tox/role-addition/bin/pip check
openstacksdk 0.48.0 has requirement decorator>=4.4.1, but you have decorator 4.2.1.
ERROR: InvocationError for command /home/zuul/src/opendev.org/openstack/tripleo-ansible/.tox/role-addition/bin/pip check (exited with code 1)
A job test that was failing previously with the above error, now passed
correctly:
- Before: https://zuul.opendev.org/t/openstack/build/8ad3a5951133418e8be132db218a4480
- After: https://zuul.opendev.org/t/openstack/build/01d33b85362d430cb30b619803814677
Closes-Bug: #1893734
Change-Id: I0e5f4692efe387d97f940b5323e593a94b6f833a
- fixes conflicts between virtualenv and pre-commit
- removes custom symlink detection that was not portable with
already existing symlink check.
- updated bashate config to not be verbose
- updated outdated ansible-lint hook calling method
Change-Id: I52cf07c0965c60d2b5149ccea136e53f261be42d
This change updates all uses of docker to podman and removes our docker
installation process from zuul and our local test process. Some container
based tests have been moved to "delegated" becuase they no longer make
sense to run in a container and the hacks needed to maintain the container
based testing are not worth maintaining for podman.
Change-Id: I02de94a1229bfa847f14ecf282eadbcfe6396875
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This adds a new module to upload templates to plan as a tar
file.
Change-Id: I7ac4c328ec7f4dd0fb4aa7495945fbc57feb4bbc
Depends-On: https://review.opendev.org/712599
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change fixes the docs job to ensure we have access to development
versions of tripleo-common. This is being done because we have more
modules coming in which are using tripleo-common which may require
unreleased versions of the package when running tests. This change
adds tripleo-common as an upstream constraint which is only used in
the docs and molecule test scenarios.
Change-Id: Ib64307defe4d5a0e06ad862ab9f51d1da3d23312
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change moves our role-addition jobs to using centos-8 because
pre-commit has dropped support for python2 as noted here [0]. Due
to this dropped support, the role-addition job needs to be executed
on a system that has access to py3.
[0] https://github.com/ansible/ansible-lint/issues/683#issuecomment-592084930
Signed-off-by: Kevin Carter <kecarter@redhat.com>
Change-Id: Iec83c9a3510ef000272dae446346996242cadc8c
This reverts the disabling of the ansible-lint test from
commit cffd4fc9d4 and updates
ansible-lint to the fixed version.
Included are fixes for ansible-lint test failures which
got merged as part of I2f88caa8e1c230dfe846a8a0dd9f939b98992cd5
while the lint test was disabled.
Change-Id: I37100f5e1764a5cd2cb8df82ae963e673ca0a8da
This change adds a test to find all broken symlinks. If any
link is found to be broken the lint check will return the
broken link in stdout and fail.
Change-Id: Iab137405d101e81f8ef9d086c5048108563a3fa7
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This basic role will provide an interface to TripleO so we can consume the
ansible-config_template action plugin to generate configuration files.
Change-Id: I4e28be86e28dd227a682362af56833fe97035a88
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change will ensure that local testing, with online roles installed
via galaxy, are not creating a dirty git tree. To build the separation
an empty directory "roles.galaxy" has been added which the galaxy command
will use to install external roles. All of the role path settings have
been updated to accomodate this new directory.
Change-Id: If68fa43231b2efbcdc046070a098bd49f47cfdb2
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change combines the docs and molecule requirements files. This is
being done because the zuul publishing job does not use tox to render
documentation so we're not able to combine the two requirements files
via the tox interface. To ensure we're not creating duplicate
requirements, which could be frustrating to maintain in the future,
we're linking doc/requirements.txt to molecule-requirements.txt and
combining the package lists.
Change-Id: If7977ad06bf0775834a15e6274ae6457e4601fa6
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change adds documentation for all of the plugins currently
found in the tripleo-ansible repo. This will provide for much
greater visability into what we're providing and will allow
users and developers to better understand how to consume
the available resources.
Change-Id: I2f5813095cbadd999bc68235278a9da1f883e01e
Signed-off-by: Kevin Carter <kecarter@redhat.com>
The role-addition tox job used to make the assumption it would install
docker and run a molecule test, however, due to the fact we're
transitioning away from tox jobs that can modify the underlying
system, the tox environment has been tweaked so that it no longers
makes the assumption docker will be installed via tox.
The tox job will now check for a valid connection to docker or podman
before attempting to run a molecule test against the pseudo role. In
the Zuul environment docker will be present when the resource is
provisioned via the tox-molecule job parent. In a local test
environments, a valid container runtime will need to be deployed,
which documented in the contributing guide. If the role-addition
tox environment is not able to connect to docker or podman a notice
will be displayed linking to the contributing documentation.
The job definition has been updated to ensure it runs anytime the
tox.ini file is changed. This was done because the tox.ini file
is the only mode of execution for this job.
Change-Id: I277edc265e7cd885af55bbf64bbc5e4fda058950
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change converts the TripleO-Ansible test process to using native zuul.
After a long discussion about the current test process [0] it has been
determined that most folks using tox do so on a local workstation and
would not expect the local system to be modified when envoked.
To ensure we're not creating a situation where a developer runs tox with a
job that may require modifications of the system the current test
structure has been replaced with a native zuul `base` job.
> This change opens the door for us to add tox jobs later which may be
added in support of the native jobs we're running now.
> The test_json_error role was updated to set required configuration
for that specific role, which was being passed in via tox before.
Documentation has been added to the contributing section to highlight
the role development process and how folks can test things locally using
a script which will mimic the zuul job runtime.
[0] - http://eavesdrop.openstack.org/irclogs/%23tripleo/latest.log.html#t2019-06-27T14:01:13
Change-Id: Ia1f3d479f3ac447d125169d08c78aaccfeacea3a
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change adds scenario tests for legacy variables across all roles
which use derived variables from legacy, un-namespaced, options.
Task: 34742
Story: 2006049
Related-Bug: #1834283
Change-Id: I18b6be271331e59ff66741a958b27d7f044f42ab
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change moves the environment parameters from the tox
config into the role specific molecule config. This is being
done for test clarity as the tox environment is obscuring the
required configuration for the plugin.
Change-Id: I115a3ba6fca5f989299136ec40da37f52b6cddef
Signed-off-by: Kevin Carter <kecarter@redhat.com>
The upstream OpenStack gate installs docker using the "install-docker"
from within the zuul-jobs repository. To ensure we're able to test role
consistently this change removes our internal docker install tasks
and simply uses the role as provided by zuul.
All of the requirements we were installing for molecule via built in
tox configuration have all been moved to the unmanaged requirements
file, "molecule-requirements.txt". This file will ensure anything we
install in a virtual-environment is consistent throughout our stack.
The `run-local-test` script has been added to the scripts directory
allowing local development to be setup and executed with minimal,
to no, pre-configuration or setup. This script and its usage has
been documented in the contributing guide.
Change-Id: If7d1ba7e59a1d6918d9606c9df8bfad21c0c47da
Signed-off-by: Kevin Carter <kecarter@redhat.com>
In order to have tripleo-ansible added to global requirements
the "ansible" requirement must be removed[0]. This change
transitions the requirement from an upstream maintained file
to our tox config, which we maintained outside of requirements
and is only ever used in local testing. With this package
removed we'll be able to have tripleo-ansible part of the
global requirements sync.
[0] - https://review.opendev.org/#/c/667413/1/projects.txt
Change-Id: Icf1e636bd1fbb73fd6d06a8e43fe55bcbe482122
Signed-off-by: Kevin Carter <kecarter@redhat.com>
The tripleo-transfer role from tripleo-common has been imported.
This role will now be tested with molecule running in containers
allowing us to validate the role functionality on CENT7 in a mock
multi-node setup.
Change-Id: If34709e5bd2f3a50ad673c1c6744379476c06d1c
Signed-off-by: Kevin Carter <kecarter@redhat.com>
The tripleo-image-serve role from tripleo-common has been imported.
This role will now be tested with molecule running in containers
allowing us to validate the role functionality on both CENT7 and
F28.
Change-Id: I56a390f05193c7c004b7c1254575bddbb9d027fc
Signed-off-by: Kevin Carter <kecarter@redhat.com>
The docker-rm role is a duplicate role from tripleo-common which provides
for the same things as the tripleo-container-rm. To ensure we're
developing a consistent user experience the docker-rm role was created
as a symlink to container-rm.
The container-rm role was updated drive consistency across roles by
changing the default "container_cli". Now all roles with the container_cli
variable will have the same default.
Because this role is a symlink no new zuul tests were added for this role.
The interface will be exercised via a new scenario in the container-rm role.
Change-Id: I33ecf735af5c5b0a9a0a9f0c650fc2a04f0864a2
Signed-off-by: Kevin Carter <kecarter@redhat.com>
Also add Molecule tests. The sudo test environment is required
to run tests with docker and podman.
Change-Id: I434a822ac071b8a2fb6f54ddf4c03ac7450fccc6
Signed-off-by: Luke Short <ekultails@gmail.com>
This change imports the tripleo-container-tag role and adds testing using
molecule. Tests within this role will be delegated to the host so that
it can natively control both docker and podman containers.
To test this role the "openstack-tox-with-sudo" job is being used which
will allow the job to locally execute against the target node.
Change-Id: I7b30561137cd78b5a3d297fa26115dbfe4458e06
Signed-off-by: Kevin Carter <kevin@cloudnull.com>
The tripleo-ssh-known-hosts from tripleo-common has been imported
into tripleo-ansible. Role tests have been added using molecule
testing the loading and unloading capbailities of this role.
Documentation hooks have been created showing how the role can
be used.
Change-Id: Id5809909b304860b25233e81bc7abeec3b0d8890
Signed-off-by: Kevin Carter <kevin@cloudnull.com>
The tripleo module-load-role from tripleo-common has been imported
into tripleo-ansible. Role tests have been added using molecule
testing the loading and unloading capbailities of this role.
Documentation hooks have been created showing how the role can
be used.
Change-Id: Icd788f12e78b0c7cf2545b133df1d0a4b8f80018
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change adds the "tripleo-create-admin" role from tripleo-common.
This change creates all of the molecule tests required to ensure that
the role is properly exercised using all of it's documented code
paths.
Documentation hooks have been added showing how the role can be
used.
Change-Id: I5649e5af6b18c411d7bbbe230556c04aeddf2795
Signed-off-by: Kevin Carter <kecarter@redhat.com>
Build dependency problems have been resolved with a change to the location where services are installed.
This reverts commit 8ebd012abc
DependsOn: Iedbf9d1034ee3396d6cb064c64169c21ebcf3e18
Change-Id: I8603f33ebddf9e032a43eec6192294f815d5591d
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change imports the tripleo-bootstrap role. Variables have been
broken-out into the new role structure which makes this role uniform
with other roles that have been created and imported.
* Molecule tests have been added to exercise this role on fed28 & cent7.
Change-Id: Ia9fe61d1793537796ff3fff8caf07ea7ea0a9dfd
Signed-off-by: Kevin Carter <kecarter@redhat.com>
This change updates the _skeleton_ role so that the files it generates are
properly formatted. When a new role is generated the resulting code will
now pass all linting checks by default. Before this change several files,
which were assumed to be needing modification by the developer, would fail
lint checks right after generation due to newline issues at the end of the
file.
A test has been added to ensure the role generation process produces
minimally functional role that is 100% compliant.
Change-Id: I28526b022b8c2b5281d2a536231ebcac3b0a7662
Signed-off-by: Kevin Carter <kecarter@redhat.com>