Commit Graph

23 Commits

Author SHA1 Message Date
Jonathan Rosser 2c762b5daa Run main_pre.yml tasks as initial keystone installation step
Change-Id: I0b03f25a4682f1f084fb9405f3f09bc01fb09e10
2022-05-31 16:54:30 +01:00
ZhijunWei b2bce755e0 use include_tasks instead of include
include is marked as deprecated since ansible 2.4[0]

Switch to include_tasks or import_playbook as necessary

[0] https://docs.ansible.com/ansible/2.4/include_module.html#deprecated

Change-Id: I55394d053218016be20fa9b2c92cefc1473d5c64
2018-09-09 08:04:47 +00:00
Jesse Pretorius 3e595367db Remove all MQ vhost/user creation tasks/vars
There is no record for why we implement the MQ vhost/user creation
outside of the role in the playbook, when we could do it inside the
role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we remove the test-vars which were duplicated from the
role, and remove the MQ setup tasks as they are no longer required.

Change-Id: Ib515630c8fbf793258b40f15a4c9f2c18c4c7531
2018-07-27 13:19:10 +01:00
Jesse Pretorius 839aec5abe Ensure remote_user and become are consistently implemented
It makes no sense to use become when you're connecting to a
host via the root remote_user. As such, we remove all uses of
'become: true' from the test plays with the exception of the
'test-prepare-keys.yml' playbook which uses a local connection
rather than a remote one and it therefore needs to use become.

We also transition all plays to use 'remote_user' which is the
correct parameter to replace 'user' (since ansible 1.4).

Finally, we switch the horizon nova service setup to its own
playbook using a local connection and the upstream keystone
modules.

Change-Id: I20517c22f07b1bb811a51d8c63741604360fe7f8
2018-07-06 09:45:29 +01:00
Jesse Pretorius 0f3b90c23e Move database creation into role (keystone)
There is no record for why we implement the database creation outside
of the role in the playbook, when we could do it inside the role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we remove the test-vars which were duplicated from the
role, and remove the DB setup tasks as they are no longer required.

Change-Id: I2d313410fa79184f77e6f8331e27cacc498878ba
Depends-On: https://review.openstack.org/571774
2018-06-01 17:27:18 +01:00
Jesse Pretorius b869d59953 Only setup rabbitmq when the inventory group is present
With the merge of https://review.openstack.org/569061 the
roles which do not have the rabbitmq_all group are failing
with messages like:

'dict object' has no attribute 'rabbitmq_all'

This patch ensures that the tasks are only activated if the
inventory group is present and populated.

Change-Id: I8f9004147753bb7f8121e344379417a6d6e2e807
2018-05-30 13:17:27 +01:00
Jesse Pretorius d1d0d21564 Optionally use the old rabbitmq setup tasks
With the merge of https://review.openstack.org/559127 the roles
which do not yet have the oslomsg_rpc_all/oslomsg_notify_all
groups are failing with messages like:

'dict object' has no attribute 'oslomsg_rpc_all'
'dict object' has no attribute 'oslomsg_notify_all'

This patch puts the old ensure-rabbitmq.yml task include back
and activates it when these groups are not defined.

Change-Id: I90dcd122fbc96f7737363dd353b50a516122667a
2018-05-17 10:25:18 +01:00
Andrew Smith 7c756b1f91 Update to use oslo.messaging services for RPC and Notify
This commit contains updates to introduced oslo.messaging
service in place of rabbitmq server.

This patch:
* Add ensure oslo.messaging vhost and user for backend
* Update service role installs
* Add oslo.messaging settings to test-vars

Change-Id: Ie69d522ee2df4282ce4fc69c2b3f81f4df1da77d
2018-04-30 16:35:22 -04:00
Markos Chandras 81f832aef2 test-install-keystone: Do not hardcode path for keystone-manage binary
When using the keystone distribution packages, the keystone binaries are
no longer installed in a virtual environment so we shouldn't hardcode
the paths to these binaries. It's preferred to set the PATH env variable
with all the possible paths and just call the binaries directly.

Change-Id: I1f5431bacc308b007b992a8b41bd4bd19635d551
Implements: blueprint openstack-distribution-packages
2018-04-11 17:03:06 +01:00
Major Hayden 22cabb1848
Remove jinja delimiters in when
Change-Id: Ifd84b28614a4f7aaf470a3e42dcf6b7cd602d54c
2018-02-14 17:15:23 -06:00
Jesse Pretorius d861c3902d Improve lint test flexibility
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
2017-11-17 15:38:43 +00:00
Jesse Pretorius dad9515c35 Implement any_errors_fatal for all test playbooks
Sometimes a test will result in a failure, but it
takes more time than necessary to find the failure
due to Ansible continuing to execute on other hosts
after removing one from the play execution.

This patch ensures that any error will result in
an immediate failure so that the fatal error is
easier to find.

Change-Id: I4e89bfdb1e48d0ac65f9fb8549e55a19ab773f9f
2017-07-17 10:09:11 +00:00
Jesse Pretorius 23c64c549a Add keystone db contract
Once all keystone containers are at the current
software level, the contract action needs to be
done to finalise the database. If this is not
done, then sometimes there may be triggers left
on database tables which protect the tables from
being written to during the migrations.

Needed-By: I5650f16b9a115bd392012b743788057a94d09226
Change-Id: Ie90cdcbf9e73082a2074c8832b7490d188e178af
2017-06-20 10:16:57 +00:00
Jesse Pretorius 0a500c1abe Add haproxy install playbook
In order to effectively test rolling upgrades, haproxy
will need to be installed to facilitate the services
being online while the upgrades are happening.

The common task to manage the backend when doing
rolling upgrades is included.

The keystone install playbook makes use of them both
in order to facilitate the rolling upgrades.

Change-Id: I5cbb3824430dc09b36476f81e0cdfd4f0a15f497
2017-06-19 11:12:22 +00:00
Jimmy McCrory 84ebca7228 Add become to all plays
The swift role includes tasks that delegate to the physical host of
containers (localhost in gate tests). Since ansible_become was removed
from localhost's vars, set become in this play to fix tests that install
swift.

Also add the become option to all other plays to avoid this issue for
any other roles that may now or in the future delegate tasks to localhost.

Change-Id: I08cada62636a1a7a1e2c1b15e0052876437e24aa
2017-04-23 02:17:55 +00:00
Andy McCrae 1baac63b0f Modularize networking
In order for the test repo to work for CentOS properly, we need to be
able to create multiple networks in a more modular way. Additionally, we
should be able to specify a dict of networks to configure and have them
configured.

To allow this to be extended we setup a network interface "type" which
defaults to "default". This should cover all current requirements but
could be extended if needed.

For CentOS/Red Hat specifically, we need to drop down post-up/pre-up
scripts for specific networks - this requires an additional loop task to
ensure the appropriate configuration is dropped down.

This is a precursor for moving Swift and Nova to use the
openstack-ansible-tests repository, both require custom networking which
is not serviced by the current configuration. This is also a precursor
for adding CentOS/RedHat support for openstack-ansible projects.

Change-Id: I5f2446d87ff88f5143b311fd27ab64b476877a1e
2016-09-16 17:07:15 +01:00
Travis Truman 1869a67440 Remove unused hostname var from test playbooks
Neither the rabbit, nor galera common tasks use
the hostname var that was defined, so we can remove
the var from all test playbooks.

Change-Id: I92c85c2c5c53f4e3d028debcfe925c26ad84284b
2016-09-12 09:08:38 -04:00
root 7f03b7fdc4 Added tasks in nova and neutron test yml files
Moved Rabbitmq and DB tasks to generic files.
This patch removes the redundant behaviour of the tasks such
as Ensuring Rabbitmq hosts and user, creating db, granting access
to db in the testing yml files. The patch  makes it more generic
and shifted the common tasks to separate files create-grant-db.yml
 and ensure-rabbitmq.yml

Change-Id: Ibd94e1ebdce45b782ab447ca3db5068588a1e368
2016-08-24 16:35:18 +00:00
Jean-Philippe Evrard 408d44e428 Add vhost and users for roles depending on keystone
If a role depends of keystone, its testing generally needs to
have a fully working keystone. In this commit, we make sure
keystone properly has its rabbitmq vhost and users defined.

Change-Id: Iaaeb8d69b87184f9aa4e8ea16795b7487ad75547
2016-08-12 15:24:24 +00:00
Andy McCrae ec28d2a6e2 Genericize rolenames 2016-05-23 15:45:17 +01:00
Andy McCrae 8f8b4eaf86 Role names should change from basename 2016-05-23 15:09:07 +01:00
Andy McCrae 6875e9e681 Set keystone messaging based on inventory 2016-05-23 13:47:07 +01:00
Andy McCrae 7f97581e0b Fix up syntax and dir structure 2016-05-19 16:37:18 +01:00