Commit Graph

37 Commits

Author SHA1 Message Date
Jonathan Rosser 6403dd594e Remove Centos-7 support
Ussuri is the last release that openstack-ansible supports Centos-7.
Remove support for Centos-7 for Victoria.

Depends-On: https://review.opendev.org/742166
Change-Id: I3e3cda925b9bf8361f2c3a8d6b2a226e50974001
2020-09-22 12:26:52 +00:00
Marc Gariepy 0a244ca090 auto-detect interpreter
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>
2020-06-11 14:43:02 -04:00
Jonathan Rosser 73c6096acd Add centos-8 non voting check jobs
Change-Id: I4c85be2308bc6c9a4091fecd35896a1838e41ef8
2020-04-30 10:12:13 -04:00
Jonathan Rosser 134753236a Use /tmp for ansible temporary directory
This defaults to $HOME/.ansible/tmp for the 'remote tmp dir' , and for
functional tests ~zuul does not exist inside containers.

Change-Id: If9b414c1d9e43b8183c68c7c3a6dff130cfcab34
2020-02-24 19:38:27 +02:00
Logan V 1495735a93 Add a note explaning why we disable yum repos
Change-Id: I0e156a793e77fcfd9f2f32bfb25dcabfc239d8a9
2019-05-22 07:33:23 -05:00
Mohammed Naser 2edd1d1c6e Remove dependency on EPEL
The EPEL repositories currently conflict with the RDO packages,
this commit drops it from openstack_hosts so new installs do not
get it.

Change-Id: I25d585c25d2b7a3e8bbf3d96060050f3426ed4a7
2018-06-07 13:59:05 -04:00
Major Hayden 391a951f70
Improve idempotency
These discovery tasks always show up as "changed" in the Ansible
output. This patch ensures that they are not labeled as changed
when they are run.

The patch also fixes the idempotency check grep so that it works
properly with multiple hosts. Previously, if *any* of the hosts
finished with no changes/failures, the entire job was marked as
passing the idempotency tests.

Depends-On: I17748b0dd2307fd9bee705140c67883140090298
Change-Id: Ie414d32d39fdeeedd77fe94b57a09ba344084ec1
Signed-off-by: Major Hayden <major@mhtx.net>
2018-03-07 16:02:33 -06:00
Zuul 498b43c103 Merge "Set SELinux to permissive mode for tests" 2018-02-22 23:07:00 +00:00
Major Hayden f24298c451
Use ARA instead of profile_tasks callback
Now that we have ARA, the profile tasks callback isn't needed.

Change-Id: I2549ddce36c27f04e8d3be5c6cde363e2a1ee4a9
2018-02-20 12:56:26 -06:00
Major Hayden 35c018a9be
Set SELinux to permissive mode for tests
The SELinux policy work for CentOS 7 is not yet done, and it is a
tricky process. The gate jobs ran with Permissive mode a couple of
months ago and gate jobs were more stable.

This patch changes the SELinux mode to Permissive for testing.

Change-Id: I861e20ebd74b3b0df92d5832db76de83a9d63398
2018-02-20 12:53:40 -06:00
Major Hayden aeb82835f0
Add a status line for SELinux status
Some gate jobs appear to have SELinux in enforcing mode occasionally.
SELinux support is improving but OSA is not ready to run in enforcing
more until some remaining bugs are fixed.

This patch adds a line that prints the current SELinux status during
testing.

Change-Id: I054c1849e5426801f6fdde761b7f64a2e8867af4
2018-02-07 11:57:27 -06:00
Markos Chandras 6b127cb2bc ARA: Prepare the ARA plugin for all the tests
Right now, ARA is being setup when we are running functional tests.
However, we could use it for other type of tests such as the upgrade
ones. As such, we can setup ARA by default as part of the environment
preparation steps.

Change-Id: I49052809c4970592c40a394a31a4d8eca12116e5
2018-01-24 11:51:07 +00:00
Zuul d3b0998f9f Merge "Use zuul v3 src location to install ARA" 2017-11-01 06:04:24 +00:00
Jesse Pretorius (odyssey4me) a27ea8cfda
Revert "Revert "Move log collection to 'post' stage""
This reverts commit af3a08a5b1
but adds the tests repository as a required repo to make sure that
it works properly across other repositories. This will be tested
through another review using depends-on so that it does not
break the role tests again.

Change-Id: If9bded9d60e2fe839c0ec8c49cc5102b5a541474
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-10-30 16:59:06 -05:00
Jean-Philippe Evrard af3a08a5b1 Revert "Move log collection to 'post' stage"
This reverts commit fd4db8ea90.
The playbook used here needs to be in every repo calling that job
(which is all our branches and all our repos).

I suggest we revert it until alll the other zuul v3 changes are settled.
We can then take a more organized approach.

Change-Id: I8ba967af69311fc0684635462d27cdc03728ca81
2017-10-27 07:09:08 +00:00
Jesse Pretorius fd4db8ea90 Move log collection to 'post' stage
To ensure that logs are collected regardless of whether
a job succeeds, fails or times out, we move the log
collection to the 'post' stage of the job definition.

As the job playbook only gets run in nodepool, we remove
the detection of nodepool in the log collection script
and also remove the trap which executes it so that it
is only ever run when executed in zuul.

Change-Id: I5ab31cc141804cbcb6d8721032a79d0c724fc0a2
2017-10-25 18:05:00 +01:00
Jesse Pretorius 5667c17b1b Use zuul v3 src location to install ARA
With zuul v3 the ARA git clone will be there if
the test is executed by the ARA repo, or if there
is a depends-on patch from ARA. This allows us to
simplify the conditional.

Change-Id: Id76b2084b1ba8df7bfddd4fbb4b0cbe9859fd849
2017-10-25 11:44:20 +01:00
Kevin Carter 98d4033c63 Constrain ansible when installing ARA
Change-Id: Id5097cd734240880a633f6d9887bbc467c26403e
Closes-Bug: #1723028
Related-Fix: I2443242f285381037a0351ceb4e6d997271dbd4b
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2017-10-19 16:10:48 +00:00
Jesse Pretorius ceee7c1be5 Only build ARA report when test fails
In order to reduce the quantity of unnecessary log content
being kept in OpenStack-Infra we only generate the ARA report
when the test result is a failure. The ARA sqlite database is
still available for self generation if desired for successful
tests.

Change-Id: I3ab9752650911bba0b8be5e73b65019e97bfef42
2017-10-13 12:27:06 +01:00
Major Hayden 761396c177
Hide yum-config-manager output
The yum-config-manager command has a ton of output and it's not
possible to make it more quiet with command line arguments. This
patch ensures that the output is removed.

Change-Id: I84fee9e76db638b2561152d60b17d45bbf60b3cf
2017-09-15 11:50:17 -06:00
Markos Chandras 6e7a0c8bc6 test-ansible-functional.sh: Only run yum-config-manager on CentOS
The existing conditional was wrong since it matched the Fedora
distribution which doesn't need to run yum-config-manager. As such,
we only run it if it's available and if it's a CentOS host.

This is similar to what is being proposed for the project-config
repository at https://review.openstack.org/#/c/493643
Change-Id: I0f321b9d5a6df64a9a0bc93c53738fa9a20b63dc
2017-08-15 05:44:39 +01:00
Major Hayden 354eb1ac81
Add dnf support
This patch adds dnf support for CentOS.

Implements: blueprint centos-and-dnf
Change-Id: I0609d79e98d773af8e431bd520b04a2c893211bc
2017-08-02 15:02:02 -05:00
Major Hayden a9e757485c
Disable unnecessary CentOS repos
The OpenStack CI image for CentOS has LOTS of repositories enabled
and downloading all of that metadata may be slowing CentOS jobs
down. This patch disables all CentOS repositories in the gate
except for base, epel, and updates.

Individual playbooks may enable other repositories, like RDO/MariaDB,
later on in the deployment.

Change-Id: I5a94aa5d46f65e0c52f90970b4c095e431ec73a8
2017-07-28 08:48:53 -05:00
Jesse Pretorius 91df4bb564 Remove verbose Ansible logging (use ARA instead)
Currently all role playbook executions use very verbose
logging in order to help with diagnosing problems in
their execution.

ARA provides the most useful information available in
the verbose log output, so instead of trawling very
large logs we should instead use ARA's easier to navigate
output.

Change-Id: Idea3c01f27b72c73fdbaf5ff96c24421f4d3fa28
2017-05-09 11:20:25 +01:00
Jesse Pretorius fb5b3612a3 Enable ARA cross-repo testing
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
2017-05-04 18:34:50 +01:00
Jesse Pretorius df9f5bc212 Fix problem with ARA execution for tox envs not named 'functional'
The ARA prep currently hard codes the tox environment name to
find pip/python in the tox env called 'functional', which does
not universally work.

This patch removes the strict path for pip/python as the script
only runs once the python venv has been activated and therefore
the correct binary path is used.

Change-Id: Ibd8957a85092a48089a6d9d336f27ccab36f009c
2017-02-20 13:25:54 -05:00
Jenkins 70aef2d772 Merge "Install ARA with zuul-cloner if we're running inside the ARA gate" 2017-02-20 14:45:03 +00:00
Jesse Pretorius 515bfab6be Revert Trusty CI test bypass
With https://review.openstack.org/431501 merged the Trusty
jobs should no longer be running on master or stable/ocata
so this test bypass is no longer required.

Reverts:
https://review.openstack.org/431538
https://review.openstack.org/431633

Change-Id: I486280ad4e57abb5366f707e12509d1b0481a17c
2017-02-18 09:37:41 +00:00
David Moreau-Simard c928b5774a Install ARA with zuul-cloner if we're running inside the ARA gate
This commit mutually benefits both OSA and ARA: it allows ARA to
leverage the func jobs of OSA as a mean to test itself in it's
own gate and make sure one of it's patches does not break OSA.

It also moves the ARA callback setup from env-prep to functional
which is the only place where it makes sense to set up ARA in the
first place.

Change-Id: Ia7b46424740da94b82c57b828b53c7993fdaa76b
2017-02-17 12:49:31 -05:00
Jesse Pretorius cede471b7f Ensure that Trusty checks run for the security role
Change-Id: I310ea2687bf1e1873f6918aab6b08b3489303ab2
2017-02-09 16:29:22 +00:00
Jesse Pretorius 7698aebf69 Temporarily bypass tests for Ubuntu Trusty
Ubuntu Trusty is not a supported platform for Ocata onwards.
Currently the CI system is executing jobs against Trusty
unintentionally and it's taking some time to unwind it.

This bypasses all tests if the platform detected is Trusty
so that development can continue while we work out the CI
configuration issue.

Change-Id: I236cf4aa748c22ad0249c1eb62e7fc64736f7f7f
2017-02-09 13:40:28 +00:00
Major Hayden c567022e25 Ensure test repo uses upstream profile_tasks
This patch ensures that the test repo uses the upstream
profile_tasks callback plugin.

Change-Id: I16c0a10581e622db6b75dc29ce52dbdef24f2ac6
2017-02-06 11:15:22 -06:00
Jesse Pretorius ddaca7c29a Add more diagnostic info to Ansible playbook execution
This information is useful when trying to understand what's
been passed to the playbook execution.

Change-Id: I386b184068dbcd2ec83ee0286c80ddfc6e59b459
2016-10-13 17:48:10 +01:00
Major Hayden a385e45193 Move ANSIBLE_CLI_PARAMETERS after playbook path
Some playbook parameters, like --extra-vars, aren't interpreted
properly if they come before the playbook YAML file. This patch moves
the parameters to the end of the ansible-playbook command to ensure
they will be parsed properly.

Change-Id: I0ec6eb0692e67ebdfdf81b3cbfa89e8c51d88d10
2016-10-12 09:58:29 -05:00
Jesse Pretorius 5f3cd37d12 Fix idempotency check and add debug logging
The current idempotency check is broken because Ansible
does not produce a log output without the environment
variable being exported.

This patch ensures that each playbook run produces an
individual log, and ensures that the idempotency check
uses the correct log output.

The following are also included:
- The script outputs the full CLI used to execute the test
  playbook. This is useful for debugging purposes.
- The parameters are re-ordered in alphabetical order to
  make them easier to find.
- The log collection now also collects the Ansible logs.
- Instead of repeating the rsync command in the log collection
  a variable is used, reducing the line length and making it
  easier to change/re-use.

Change-Id: Ie379de765c6ebba958ce8e7f9dc27b7a3af74ff8
2016-10-06 11:46:00 +01:00
Jesse Pretorius 9942b6799f Fix idempotence test log file name
Change-Id: I5c1f2f0949d6b7ad7bfc4151257b081728ba956f
2016-10-05 11:32:46 +01:00
Jesse Pretorius 90d76c59f8 Implement centralised Ansible test scripts
This patch implements test scripts intended for use by all
OpenStack-Ansible role tests.

The intent is to simplify the role tox.ini configuration
and ensure that as many changes to role testing configuration
can be managed from the centralised tests repo instead of
individually in each repository.

This patch implements the scripts to centralise the
ansible-lint, ansible-syntax, and functional Ansible tests.

Functionality included:

- For a simple functional test, the defaults will be allow
  the execution of the test without any parameters set.
- For a scenario test the scripts allow the inventory,
  extra vars and any other CLI parameters for Ansible to be
  set via environment variables.
- Both check mode and an idempotence test.

In addition to this functionality, the bash scripts are all
set to fail on error to ensure that tox shows a failure.

Change-Id: I23c24146485da340d4f046f80e4814652e6e3876
2016-10-05 09:56:12 +01:00