Commit Graph

24 Commits

Author SHA1 Message Date
Will Szumski 280e84be82 Remove docker devicemapper support
This has now been removed from upstream docker-ce packages.

```
the devicemapper storage-driver has been deprecated and removed
```

and has shown deprecation warnings for some time.

This change also includes some fixes necessary for CI to pass:

* update the Zuul previous_release variable to 2023.2

Closes-Bug: #2051233
Depends-On: https://review.opendev.org/c/openstack/kolla-ansible/+/906858
Change-Id: I263f59ea77e39accffe4febe0d47e56b35d9800e
2024-02-01 14:10:09 +00:00
Mark Goddard c9f8d80ba6 Stop using kolla-ansible bootstrap-servers
The 'kayobe * host configure' commands no longer use the 'kolla-ansible
bootstrap-servers' command, and associated 'baremetal' role in Kolla
Ansible. The functionality provided by the 'baremetal' role has been
extracted into the openstack.kolla Ansible collection, and split
into separate roles. This allows Kayobe to use it directly, and only the
necessary parts.

This change improves failure handling in these Kayobe commands, and aims
to reduce confusion over which '--limit' and '--tags' arguments to
provide.  This ensures that if a host fails during a host configuration
command, other hosts are able to continue to completion. Previously, if
any host failed during the Kayobe playbooks, the 'kolla-ansible
bootstrap-servers' command would not run. This is useful at scale, where
host failures occur more frequently.

This change has implications for configuration of Kayobe, since some
variables that were previously in Kolla Ansible are now in Kayobe.

Several parts of the baremetal role have been split out and used here:

* apparmor-libvirt: disable AppArmor rules for libvirt on Ubuntu.
* docker: Docker installation & configuration. The docker role in
  openstack.kolla combines functionality from kolla-ansible and kayobe.
* etc-hosts: it proved difficult to generalise this, so we have some
  almost duplicated the code from kolla-ansible here. Requires delegated
  fact gathering for the case when --limit is used.
* firewall: support to disable UFW, for feature parity.
* kolla-packages: miscellaneous package installs & removals.

The addition of the stack user to the docker group has been moved to the
user bootstrapping playbook, and the docker SDK installation has been
moved to the virtualenv setup playbook.

Depends-On: https://review.opendev.org/c/openstack/ansible-collection-kolla/+/829587

Story: 2009854
Task: 44505

Change-Id: I61a61ca59652b13687c2247d5881012b51f666a7
2023-03-30 13:52:54 +00:00
Mark Goddard f639ad0b35 Use ansible_facts to reference facts
By default, Ansible injects a variable for every fact, prefixed with
ansible_. This can result in a large number of variables for each host,
which at scale can incur a performance penalty. Ansible provides a
configuration option [0] that can be set to False to prevent this
injection of facts. In this case, facts should be referenced via
ansible_facts.<fact>.

This change updates all references to Ansible facts within Kayobe
from using individual fact variables to using the items in the
ansible_facts dictionary. This allows users to disable fact variable
injection in their Ansible configuration, which may provide some
performance improvement.

This change disables fact variable injection in the ansible
configuration used in CI, to catch any attempts to use the injected
variables.

[0] https://docs.ansible.com/ansible/latest/reference_appendices/config.html#inject-facts-as-vars

Story: 2007993
Task: 42464
Depends-On: https://review.opendev.org/c/openstack/kolla-ansible/+/791276

Change-Id: I14db53ed6e57d37bbd28dd5819e432e3fe6628b2
2021-08-21 09:57:29 +02:00
Mark Goddard 6ca967e27f Use Ansible connection reset support in docker role
When configuring Docker we need to kill persistent SSH connections to
refresh the membership of the docker group for the stack user. Currently
we are using a fairly heavy handed method of removing all ControlPersist
sockets because the Ansible reset_connection meta module previously did
not work [1]. This issue is fixed since Ansible 2.5.6.

This change switches to the reset_connection meta module, which now
works as expected.

[1] https://github.com/ansible/ansible/issues/27520

Change-Id: Id4d951e447720e1d769491c0d34ad83099c030eb
2020-04-03 17:25:24 +01:00
Mark Goddard efb8b8bd27 Use docker_custom_config variable
In the Train cycle, Kolla Ansible added support for
docker_custom_config, and writes out configuration to
/etc/docker/daemon.json. This will conflict with Kayobe's configuration
of that file, and changes made by kayobe will be reversed when
kolla-ansible bootstrap-servers is run.

This change uses the new variable to pass daemon.json configuration
through to kolla ansible. Because the ordering has changed, we also need
to separate out the devicemapper setup and run this prior to starting
docker.

Change-Id: Idc3fa9fefd8242ef9db76d4d773885e3594b453a
Depends-On: https://review.opendev.org/691001
Story: 2006764
Task: 37277
2019-10-25 17:08:56 +01:00
Pierre Riteau 3993d89839 Try running `docker info` again if it fails
Docker sometimes fails to reply if it has just been started.

Change-Id: I5ae37b8f264437a9e49b09da459e604191f9ed3e
Story: 2006718
Task: 37089
2019-10-14 19:04:23 +02:00
Raimund Hook 6df6277096 Updating Jinja filters to conform to Ansible 2.5+
Since Ansible 2.5, the use of jinja tests as filters has been deprecated.

I've run the script provided by the ansible team to 'fix' the jinja filters
to conform to the newer syntax.

This fixes the deprecation warnings.

Change-Id: I775c849c944f82bdfc779c8c530346e7ebedbd2a
2019-06-28 16:34:24 +01:00
Mark Goddard c6425d0898 Support arbitrarily named Docker drivers
Currently we configure daemon.json to use either devicemapper or overlay
as the storage driver. We should simply pass through whatever is
configured for docker_storage_driver.

Change-Id: Id4423030b5483fe4ecd4f324bc25800e5444fd63
Story: 2005649
Task: 30932
2019-05-13 13:52:20 +01:00
zhulingjie 8be12b71d7 use include_tasks and import_playbook 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: Ia1b826ca08ae042eec80f8c495ab030a087d97ba
2019-01-18 12:22:38 +00:00
Mark Goddard e6cf6ca985 Remove tasks for Ansible <= 2.3
The minimum version of ansible is 2.4, so these tasks are no longer
required.

Change-Id: Ied933d18e438955c23ad3eeff80e3377b5633a7c
2018-11-29 15:50:35 +00:00
Doug Szumski f1f6a0b107 Don't specify -c flag to pip if no upper constraints 2018-02-22 14:59:55 +00:00
Doug Szumski 6ad2a698c4 User correct prefix for docker upper constraints variable 2018-02-22 14:05:23 +00:00
Doug Szumski 7dd01adae9 Respect Kolla upper constraints in virtual envs 2018-02-22 12:45:36 +00:00
Kevin TIBI 5c84047982 Fix storage config for docker-ce 2018-01-03 17:14:48 +01:00
Mark Goddard 3620be7c08 Support configuration of a remote virtualenv for kayobe 2017-12-19 16:32:48 +00:00
Mark Goddard ca284aea06 Fix ansible warnings for when clauses with curly braces 2017-10-20 12:14:35 +01:00
Mark Goddard ce60327b60 Fix SSH reconnection for docker role in Ansible 2.3
In ansible 2.3, the path to SSH persistent connection sockets was changed to use a SHA1
hash of the connection parameters, so the workaround to force a reconnection was broken.
This change removes all ControlPath sockets from the ansible control host.
2017-10-12 11:19:23 +01:00
Mark Goddard fe6c6a3ac6 Support docker overlay storage driver
This is configured via docker_storage_driver.
2017-08-07 20:07:50 +00:00
Mark Goddard d0acd84ef8 Fix issue with adding user to docker group
In order to activate the group membership for the user it is necessary
to log out and back in again. Ansible typically uses the SSH Control
Persist feature which will keep the user logged in between successive
tasks. This change stops the control persist connection when the user
has been added to the docker group.

The method for determining the path to the control socket is a little
more hard coded than it should be, but no other method could be found
for determining the socket's path.
2017-08-07 12:08:41 +00:00
Stig Telfer 01c3a83d38 Update main.yml 2017-03-22 09:52:20 +00:00
stack cf5db1d59c Second pass at Docker MTU assignment 2017-03-22 09:30:59 +00:00
stack a5fe4b7702 Introduce 1450 MTU for Docker-encapsulated networking 2017-03-20 22:02:45 +00:00
Mark Goddard 07a33c67df Configure Docker to use direct-lvm storage backend
The loopback configuration is not recommended for production, whereas
direct-lvm is.
2017-03-15 09:44:17 +00:00
Mark Goddard b654a70e65 Initial mega commit of Kayobe 2017-02-14 15:14:29 +00:00