Commit Graph

16 Commits

Author SHA1 Message Date
Jonathan Rosser 3458ee0ee1 Initialise ssh and ssl certificates
This is needed later by the keystone, nova and repo_server roles

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_keystone/+/840445
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_keystone/+/840514
Change-Id: I3a3e9ee62fde37c65fa182bf59f12031c390d968
2022-05-04 16:42:51 +00:00
Jonathan Rosser cef65a6390 Update ansible-lint==4.3.5, flake8==3.8.3, bashate>=0.5.1
Correct lint errors that arise from these version updates.

Change-Id: I3216032b0d383ca6d4f6304c92151ce12dc5e114
2020-09-30 11:24:29 +00:00
Dmitriy Rabotyagov 18a3067a4f Use buster jobs instead of stretch
As for U we don't support debian stretch, there is no need
in having stretch CI jobs. Buster ones should be used instead.

This also fixes ara report

Needed-by: https://review.opendev.org/706285
Change-Id: I554e512968718492ce6056b29b0612e450f0856b
2020-02-24 20:08:35 +02:00
Jesse Pretorius 85b51389cc Use local connection and become for localhost plays
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.

To ensure these plays have the correct access to change
things on the host, we apply this change to them all.

We also ensure that 'become: no' is explicitly set on
any local connection plays to make the intent more
obvious. Finally, we also use 'yes' and 'no' uniformly.

Change-Id: I6e4607dd4aaffa0bfcda254103697bf9b28eca1a
2018-07-14 14:37:06 +01:00
Major Hayden e3d4247b80 Always quote the filesystem permissions
Change-Id: I6427c5387cd6c951b4da4848c6012f426b36c817
2017-11-10 04:20:17 +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 53ef8879be test-prepare-keys: Use local connection for user's ssh key setup
Similar to commit 3393b887a89a("Setup initial key with connection:
local") we need to use local connection to configure the ssh keys for
the user as well.

Change-Id: I3d7adc78f565e7c7b69e9fecc880612157774b3b
2017-05-04 09:36:52 +01:00
Andy McCrae 3393b887a8 Setup initial key with connection: local
We need to use "connection: local" in order to setup the intial SSH keys
which will then allow remote connections to localhost.

Change-Id: I44997d6ca8ea2e5d15a2053cc2b00ad63c395db6
2017-05-03 16:55:14 +01:00
Jesse Pretorius fa4937e52e Remove connection: local usage
In Ansible 2.3 the local connection plugin overrides
the host vars for the ansible_python_interpreter,
causing tests to use the wrong interpreter and
install python packages into unexpected locations.
This is especially visible when using host
delegation to localhost instead of the targeting
localhost directly.

To ensure that the behaviour remains consistent with
our expectations all local connection usage for
localhost is removed and localhost is targeted as
a remote host.

Change-Id: Ifcccf3c25aa10085b35017b01644354e10eca15a
2017-05-02 15:39:36 +01:00
Markos Chandras d19ef44b7b test-prepare-keys: Use ansible_user_gid for user's group
Using ansible_user_id to determine the primary group for a user implies
that such a group exists in the first place. Unfortunately this is not
always the case. For example, openSUSE does not create a new group for
every user but places all of them in the 'users' group. As such, avoid
using ansible_user_id and switch to ansible_user_gid which provides a
numeric value for the user's primary group.

Change-Id: I4fcea3e9bc9fa34998ab1a07e2c6bf60738e1fc1
2017-04-25 17:03:51 +01:00
Jimmy McCrory b0be2e9327 Fix role gate tests for Ansible 2.3
In Ansible 2.3, 'ansible_user' seems to be undefined unless set within
the inventory for a host. 'ansible_user_id' contains the current user
running Ansible, but is only set after facts are gathered.

Change-Id: Id5b76a87809f03951c954fc3d752419a673403f7
2017-04-19 00:11:36 -07: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
Kevin Carter a9f1ea9a6f
Improve key prep for tests when not using root
The key prep playbook has been changed to ensure non-root
users are able to run tests in containers.

Change-Id: I5c008888f790a07f034bbe9b96e3df0694d67920
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-08-30 09:34:28 -05:00
Kevin Carter 7bccc59c6e Updated host prep tasks
Change so that local ssh is no longer assumed to be available. The
tasks for keyfile generation and insertion as root are now done
in the same place.

When running on an APT systems the backports repo will be made available
if its found within the sources list file.

Change-Id: I9c16378cee3862cd8ce2d87e8c5483533f98c94d
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-08-29 18:35:26 +00:00
Qin Wang 5c96332384 change pre_tasks to tasks in test-prepare-keys.yml
There are no tasks in the file. pre_tasks needs to be changed to
tasks.

Change-Id: I895be2cb3a8432e2b2d36c4063e05b022aaca6cf
2016-08-15 14:11:11 +00:00
Andy McCrae 7f97581e0b Fix up syntax and dir structure 2016-05-19 16:37:18 +01:00