Commit Graph

13 Commits

Author SHA1 Message Date
Monty Taylor 1e6387b109 Name gate inventory file gate-hosts
To match the other gate-generated inventory files.

Change-Id: I90104f1b19a980ae1be0263cc4dc59c17125f41e
2020-06-04 16:27:05 -05:00
Monty Taylor fdbf19f0ce Install hosts and group files into service location
We need to pick up the host vars for this to work.

Change-Id: I6ae33919afdbeb5bc1693730d9b24fe4cefc7be5
2020-05-30 06:52:47 -05:00
Zuul 2c88fceeae Merge "Install puppet with ansible" 2019-05-15 23:09:33 +00:00
Clark Boylan cd8e7bdaa2 Install puppet with ansible
Do this so that we have one way to install puppet (the puppet-install
role) and not multiple ways (including install_puppet.sh). This has
become more important because we need to fix how we install puppet after
upstream deleted the package repos and rather than double account
everything we can do it once.

Change-Id: Iec86a5423b053d4d02f8e0a74fea883d328b1945
2019-05-15 15:30:23 -07:00
Monty Taylor f0eedbfbab Update for opendev
Change-Id: I3bb5204207ffceb31ee7296d29f08db02d330b4a
2019-04-20 14:12:51 +00:00
Monty Taylor 54ed0aa7a1
Add roles dir in system-config to roles path
This doesn't exist yet, but is coming in the needed-by patch. Add the
roles dir in system-config to the roles path.

Change-Id: If05f02e856598403d7f94edf5e6e52c5fa69e8e6
Needed-By: https://review.openstack.org/590753
2018-08-10 07:14:28 -05:00
Monty Taylor 2fa5458994
Run ansible base playbook for puppet tests
As we start to do things in the base playbook instead of in puppet, we
need for those things to happen before we run puppet, and before we test
final system state.

Install ansible into a virtualenv, then run the base playbook.

Change-Id: I88808dec9dd4ebdd3fb9081881d2ab69f9eed95e
2018-08-09 10:03:21 -05:00
Colleen Murphy 42cd1ef1ef Don't be overzealous with passing the environment
Without this change, the gem helper passes the entirely of the user's
environment through beaker's SSH connection. This causes problems with
puppet 4 because all of the ruby and bundler arguments confuse the ruby
interpreter and we see errors like this:

  /var/lib/gems/2.3.0/gems/bundler-1.16.2/lib/bundler/spec_set.rb:91:in `block in materialize'  :   Could not find rake-12.2.1 in any of the sources   (  Bundler::GemNotFound  )

The only important variable is PUPPET_VERSION so just pass that and
nothing else.

Change-Id: I678716890d0c749e755ec0526621d47fee44a4bb
2018-07-09 13:06:05 +02:00
Colleen Murphy 1226b84c9e Use system-config script to install puppet
Previously, we were using the helper methods provided by beaker to
install puppet. When we moved to Xenial but stayed on puppet 3, we
changed the spec helper to install puppet 3 from the Xenial repos. This
duplicates effort that we have already written into install_puppet.sh,
and it doesn't reflect how we really install puppet in production. This
patch changes the install_infra_puppet method to use the install script
in system-config, so that when we make changes to how we install puppet
or what version we install, we only have to do it in one place. This
passes the test environment to the install command so that any
environment variables we set in the job (for example, if we make the
puppet version configurable through environment variables) make it
through. Also add logic to support puppet 4 by adding the new bin path
to the environment and using the appropriate modulepath.

We also need to modernize this helper for Zuulv3. zuul-cloner doesn't
exist on CI nodes any more, but we can rely on Zuul installing the
system-config repo beforehand, so just use that.

Change-Id: Ifa95171e580da96456d76900092ba924da626def
2018-06-15 00:06:25 +02:00
Clark Boylan 6a6f5c85cc Check if we are running under Zuul v3
Update the Zuul conditional check to handle Zuul v3. Zuul v3 no longer
sets a URL or BRANCH env variable so we shouldn't rely on those for
checking if we are running under Zuul. Instead we can check if the
ZUUL_UUID is set which will be present for every job.

Depends-On: I83e7088c36b1b57279bb32e44c9f74730da582cf
Change-Id: Id4f6ae8cc4128083f0db72fb6e2dc81b9968e884
2017-11-29 15:33:02 -08:00
Colleen Murphy 2cc8cce5cf Refactor spec helper
The spec helper file has been cargocult-copied from puppetlabs and
puppet-openstack modules, adjusted slightly for Infra's particular
needs. It is hard to read which makes adjusting it hard to do and hard
to review. This refactor moves code into descriptively-named functions,
and condenses the main setup code so that there is only one loop over
the host list, and passes the entire environment into host commands
instead of crafting long bash commands with required environment
variables.

Change-Id: I572a5dc0d9987e8c90a27f300c8b4979e20c43a2
2017-07-09 17:12:37 +02:00
Colleen Murphy 0861447aaa Move spec_helper_acceptance into helper gem
Every puppet module contains the same file that prepares beaker tests.
Currently, when we need to make changes to it, we need to change it in
every puppet module. This is inefficient and causes a huge review
backlog for identical changes. This patch copies the
spec_helper_acceptance.rb file, with minor modifications to keep the
path logic correct, into the common helper gem. The modules already
depend on this gem for common gem dependencies. This way, modules can
simply `require
puppet-openstack_infra_spec_helper/spec_helper_acceptance` in their
tests and not bother keeping the spec_helper_acceptance module locally.

Change-Id: I18ed6cd2f8ee472a66cf580e3e183d14c00e6877
2017-06-25 19:19:54 +02:00
Spencer Krum 8fe0a33f15 Initial commit
This code came from
http://git.openstack.org/cgit/openstack/puppet-openstack_spec_helper/

and was modified for infra's use.

The gems specified in gemspec are current with what infra is currently
using.

Change-Id: I06e47d4af32f30e4504ee67257923a4596725d0f
2016-06-21 16:19:09 -07:00