Commit Graph

19 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 ce66289fed Fix more linter errors
Seems the files in the tests repo are not all covered by the tests repo
lint job

Change-Id: Ic3682690793d557305fa59c2d3fa8bc6536375de
2020-10-01 17:15:31 +01:00
zhulingjie 60e2d79c06 Remove the unnecessary space
Change-Id: Ib5ce3cbe9d946deb85ff171d3e7d5ee6fca7d17c
2018-07-11 23:18:55 -04:00
Jean-Philippe Evrard 2d924b773d Fix usage of "|" for tests
With the more recent versions of ansible, we should now use
"is" instead of the "|" sign for the tests.

This should fix it.

Change-Id: Ida90a5a717adaf07ebf2ee6f04136fe920cfe46b
2018-07-12 16:44:20 +02: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 f227693bf5 Fix ansible-lint test failures for ironic
With the merge of https://review.openstack.org/520177 in the
tests repo some ansible-lint failures which previously were
not being picked up are now detected.

Change-Id: I76157ccedfbcb8b0c2cba852bfa6b78ba6981c6c
2017-11-24 11:07:49 +00: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
Markos Chandras 6a401f3d92 test-setup-swifthosts: Explicitly set the package manager
Commit 01444b18c8 ("test-setup-swifthosts: Optimize xfsprogs
installation") switched from using distro specific package manager
modules to a simpler solution provided by the 'package' module. However,
this had unexpected consequences when the task is delegated. In this
case, the detection depends on hostvars['localhost']['ansible_pkg_mgr']
being populated. However, this may not always be true since it depends
on us having executed the 'setup' module on localhost during this
playbook. As such the following error may occur:

2017-07-13 15:40:15.895582 | fatal: [swift-storageB1 -> localhost]: FAILED! => {
2017-07-13 15:40:15.895647 |     "changed": false,
2017-07-13 15:40:15.895677 |     "failed": true,
2017-07-13 15:40:15.895742 |     "msg": "Could not detect which package manager to use. Try gathering facts or setting the \"use\" option."
2017-07-13 15:40:15.895771 | }

Fixes: 01444b18c8 ("test-setup-swifthosts: Optimize xfsprogs installation")
Change-Id: I96c02fb2ee26691f1d7dd449d7205baa231795fe
2017-07-14 10:23:50 +01:00
Markos Chandras d47f415fb2 test-setup-swifthosts: Add -K option to mkfs.xfs
The underlaying device is not a real hard disk so there is no
need to use the discard option.

Change-Id: I5b268c7a3d772e8207c3dc276731a0a7f12f04eb
2017-07-12 08:56:07 +01:00
Markos Chandras 01444b18c8 test-setup-swifthosts: Optimize xfsprogs installation
The 'xfsprogs' package is common across all distributions so improve
the playbook by using the 'package' Ansible module to install the
package on every distribution.

Change-Id: I86e5080e75b06f6252858978eaa62b5aa83cd87c
2017-07-11 18:30:52 +01:00
Jesse Pretorius 742a3f8e24 Fix missing vars for container connectivity test
Change-Id: I735ae5b59596a46bd0a1dcfe37d5418e79f5b53e
2017-04-28 17:34:09 +01:00
Jesse Pretorius b575dc7951 Use wait_for_connection instead of wait_for to check container
After configuring the bind mounts in the container, we used a
task to wait for SSH to respond on the container, using the
Ansible wait_for module trying to connect to port 22.

When managing containers in Ansible using other connection plugins
that use LXC commands on the physical host to execute modules,
there may not be an SSH daemon running within the container. In
these situations we can accomplish the same check without SSH by
using the wait_for_connection module (new in ansible 2.3) to verify
that Ansible has a working execution path into the container, but
not necessarily via SSH.

Change-Id: I25978a3043af1df1613f41e479b7f058d64f685d
2017-04-28 13:12:32 +01:00
Rick Box c8790db909 Bugfix for wait_for_ssh for waiting for connectivity
Bug: https://bugs.launchpad.net/openstack-ansible/+bug/1682481 this
causes issues when using an SSH gateway yet this is simply doing a basic
check for port 22 connectivity.

Change-Id: Ia3c82fcef553b6a53f66d22b9cfdcf5d69e8694d
2017-04-27 18:10:39 +01:00
Jimmy McCrory 18309b13da Add become to plays that delegate to localhost
'ansible_become' defined as a host_var or in the inventory for a host
has a higher precedence than 'become' defined within a playbook.

In change Id5b76a87809f03951c954fc3d752419a673403f7, 'become' was
defined explicitly for each play running against localhost. It will also
need to be defined in plays that delegate to localhost.

Change-Id: Ifb5e907594ca5fba459ee5a90b202e17db081f9a
2017-04-19 12:01:01 -07: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 1943251152 Address ansible_ssh_* var deprecation
Replacing usage of ansible_ssh_host, ansible_ssh_user,
ansible_ssh_port with ansible_host, ansible_user and ansible_port
Depends-On: I35371879a87c115f219cd181245fe59f6d7d3f77
Change-Id: I97c3958c406b44b271d361860516d0b903438a83
2016-09-19 11:06:48 +01:00
Qin Wang e356f24cc0 added ansible_pkg_mgr check for apt modules in test-setup-swifthosts.yml
it is necessary to check ansible_pkg_mgr = 'apt' when using apt modules

Change-Id: I2b09d3a38c1f6499fb93883fb9879206cdaff457
2016-08-12 18:37:03 +00:00
Andy McCrae 7f97581e0b Fix up syntax and dir structure 2016-05-19 16:37:18 +01:00