Commit Graph

27 Commits

Author SHA1 Message Date
Jonathan Rosser 84eea5b91d Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I9841e5b7f32f452b7da0c643cb6c3e0e30d9e413
2021-03-17 12:20:20 +00:00
Jonathan Rosser 4eac7fd2c1 Clean up code from unsupported operating systems
Remove SUSE, Gentoo, and references to yum package manager.

Change-Id: If591661b4145219f7837960f93bc9647b60d2a70
2021-03-11 23:08:21 +00: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 7c3e6d4b67 Connect to localhost as remote host for cinder/nova
Trying to dynamically switch connection types and become
just doesn't work, so instead we force all role tests to
setup a different inventory_hostname for the services on
localhost so that Ansible connects to it in a different
way and we don't have to try and fudge it.

Change-Id: Ibbbab05efb0170bd66bf829a5d6c2ce136cb120f
2018-07-19 18:28:31 +01:00
Jesse Pretorius 710b195bf0 Switch connection/become settings for nova
Typically nova_compute is on localhost, so in
https://review.openstack.org/582957 we made the
change to set connection/become accordingly, but
as it turns out ironic does not deploy compute
on to localhost so that patch broke the ironic
tests.

So, given this is much the same requirement as
cinder's, we implement the same hack as done in
https://review.openstack.org/582579

Change-Id: Icf50423576cd95a891da743f2b8b7c01e81ceb38
2018-07-18 03:09:11 +01:00
Jean-Philippe Evrard 68e5420af0 Use local connection and become for nova_compute
The nova_compute group contains localhost, but due to
the name being different, it was missed in [1].

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. We apply this change to
ensure this play also has the correct access to change
things on the host.

[1] https://review.openstack.org/582359
Change-Id: Ia87e02c3b965be6f384d2f64911f0af2e4c2d598
2018-07-16 13:52:22 +00: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 81d26d1845 Move database creation into role (nova)
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: Ie74023c542858f1017509689a3dc3b402614f3d4
Depends-On: https://review.openstack.org/571785
2018-06-01 18:49:07 +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
Jesse Pretorius e33000f1bc Remove placement_database related options/code
The placement_database config options were added in Newton
but the actual code to use the options was reverted and is
not used.

Change-Id: Idd2edec3e98dbcd3361cf38434027ad16066ac46
Depends-On: https://review.openstack.org/541685
Related-Reviews: I31293ac4689630e4113588ab2c6373cf572b8f38
Closes-Bug: #1670419
2018-02-07 12:02:09 +00: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
Jenkins 79e11d35d2 Merge "Implement any_errors_fatal for all test playbooks" 2017-07-17 17:32:51 +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 d5d1121f3c Remove redundant run_once task args
The included task set already uses run_once,
so the run_once on the include is unnecessary.

Change-Id: I1ec4151bb8f87bac5dd76ab37c1dc4ed53b1c7c9
2017-07-06 13:21:42 +01:00
Jesse Pretorius 1563215930 Update nova test playbook
This updates the test playbook to:

1. More efficiently execute the dependent package
   installation, while being flexible enough to
   cater for more package managers.
2. Splits the implementation of the nova
   control plane services from the compute service
   to allow the role to operate in a
   semi-serialised manner.
3. Adds the package list for openSUSE

Change-Id: I1ebda750eeab9c6344f39c7132b2c82622c6e0be
2017-07-05 09:40:24 +01: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 f27b652956 Add options for nova cell_v2
This patch adds the cell_v2 nova_cell0 database as part of the
test-install-nova.yml playbook. The var is required in test-vars for
this reason.

Additionally, we need to add permissions for the nova_api database user
to access the nova_cell0 database. This means we need to append
permissions for that user using the create-grant-db play. This defaults
to "omit" so is only used when "db_append_privs" is passed to the
include.

A work around is required for a bug in upstream nova - this should be
removed once https://review.openstack.org/#/c/428120/ merges.

Finally a fix was added to ensure the api_database is setup using the
appropriate address (although in this case it has no impact).

Change-Id: I082f37bb3ce61a900e06a58f21c7882f83671355
2017-02-02 14:29:41 +00:00
Andy McCrae 5128e40ca8 Add nova-placement API support for tests repository
Change-Id: Ifdd9121dc8f6d2e9ffaa5fc81cd53e5d3822d573
2017-01-24 16:46:28 +00:00
Marc Gariepy 32bcd744e4 Fix CentOS package installation
Add missing yum packages for neutron/nova/swifthost tests.

Change-Id: I4c954ca8517ae1d456eda4f841cf64da233a78cd
2016-10-03 10:22:39 -04: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
Jimmy McCrory 8593608e88 Include creation of nova-api database
Add task to test-install-nova playbook to create the nova-api database.

Change-Id: I9cbd5cb953fd906225c7907bf65e4a89908ca658
2016-08-30 10:56:54 -07: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
Jimmy McCrory fd8bf215c3 Add tasks and vars to create nova_api database
Change-Id: I2c20fec9f6b7c00a79dd04d699ede3aa4642cde6
2016-08-12 11:41:46 -05:00
Andy McCrae 7e95e72303 Add Nova vars/plays 2016-05-26 11:33:20 +01:00