Commit Graph

229 Commits

Author SHA1 Message Date
Zuul 3d6a3d812d Merge "Stop installing openssh and rsync to containers" 2023-10-13 09:51:09 +00:00
Dmitriy Rabotyagov d4d8114a11 Stop installing openssh and rsync to containers
With fixing keystone role there should be no need in explicitly
installing rsync and openssh everywhere.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-os_keystone/+/889934
Change-Id: I25729462fa6be7953e8ef0687ec4580509c21aaf
2023-10-12 08:01:57 +00:00
Jonathan Rosser d57f9a8f47 Remove lxc_cache_map variable
This has not had any practical use for several releases and mostly
carries copies of ansible facts. Remove the variable and use the
facts directly.

Change-Id: I1d2be9d07b38eaf2b737819c451a0d2339f723d0
2023-10-11 15:56:08 +00:00
Jonathan Rosser 03dc91fa85 Add ca-certificates into debian base image during debootstrap.
debootstrap uses http for it's apt config so can function without
the certificates from ca-certificates being installed.

The debian bookworm cloud image defaults to using https for the
apt repo urls, so unless the ca-certificates package is present
no more apt operations can be done once the apt configuration is
synchronised from the host to the container image.

Installing ca-certificates during the initial debootstrap avoids
the issue of not being able to install ca-certificates due to failed
SSL verification.

Change-Id: Ia78429eaf4bd71a8f3509c4e484f7dd02574c6b1
2023-09-29 12:44:05 +00:00
Jonathan Rosser 2506f0080a Sync additional apt config from the host to the container base image
Debian bookworm needs the sources.list.d and mirrors directory
syncing to the container image to result in a working apt config.

Change-Id: I0c62340e7868948d9c55c96559ddafadf8cb7db1
2023-09-29 12:43:58 +00:00
Jonathan Rosser 22b6df4193 Ensure systemd-resolved is present in debian container images
It is not present by default in the rootfs built by
debootstrap for debian bookworm

Change-Id: Ie7200d5c01948c885c3dd4e8103c8f0a65e26108
2023-09-28 09:19:18 +00:00
Jonathan Rosser 42cfa88bb5 Fix linter error
Split long line

Change-Id: I2466a9959bc93da754e11d8b9c6fb5d90f64163f
2023-09-28 10:00:13 +01:00
Dmitriy Rabotyagov a5589beb5f Fix linters issue and metadata
With update of ansible-lint to version >=6.0.0 a lot of new
linters were added, that enabled by default. In order to comply
with linter rules we're applying changes to the role.

With that we also update metdata to reflect current state.

Change-Id: If6171be3d649f6e7dd26decf1460d45775bd5f9e
2023-07-20 07:27:08 +00:00
Dmitriy Rabotyagov caebffe51e Cleanup old OS support
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/886517
Change-Id: I45c4126b30ddf1e552808667937692af1764c491
2023-06-21 12:14:06 +02:00
Zuul 5a36b5cd26 Merge "Ensure tar is installed on LXC host" 2022-12-19 16:59:28 +00:00
Dmitriy Rabotyagov 30b97f57c9 Ensure tar is installed on LXC host
Tar is required for LXC to create base container using lxc-create. When
it's absent lxc-create exits with code 1 without any output on this
task [1]

[1] ef721dbf13/tasks/lxc_cache_create.yml (L71)

Change-Id: Ic54d160c7329aebb7769c407d3af7b0f66145bcc
2022-12-12 15:57:37 +01:00
Jonathan Rosser ca12ef136a Add git and libxml2 to container base image
These are needed universally in the service container images so
install them into the base image to save build time later.

Change-Id: Ia51329110ffa2c634799544ac6c7b7f2016369a5
2022-12-12 09:49:44 +00:00
Dmitriy Rabotyagov 3d8e3690ba Replace ifupdown with native ip-link
We also leverage systemd-networkd for managing lxc-net and replace
using of custom service template for lxc-dnsmasq service with our
systemd-service role. These changes are quite tighten together, so
it's quite hard to split them in different patchsets.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/861350
Change-Id: I5ac99e2b6c6e6ccd9da18ae68e1f8801f95f4f4e
2022-11-11 09:57:56 +01:00
Dmitriy Rabotyagov d1fe9f7bec Cleanup CentOS 8 Stream
Change-Id: I48120976c48a8edcfdec29e651928f55ff92155a
2022-11-02 12:46:47 +01:00
Andrew Bonney 783076a508 Take account of lxc_apt_mirror in new debootstrap command
Without this change the mirror variable is ignored which can
cause issues on systems running behind a proxy.

Change-Id: I3e761c181c1bf3b736fff3bf9ac441e266bc4e2c
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/851233
2022-07-27 14:37:05 +00:00
Jonathan Rosser fd23eeedfc
Add centos-9 support
Remove installation of aria2 everywhere as we no longer download
lxc images but build them locally.

Change-Id: I5eba0b1f08cfe23998cf1116bb017e8a8ef0bb72
2022-05-19 17:23:09 -04:00
Zuul c679877aba Merge "Unify debian and ubuntu cache prep scripts" 2022-04-29 17:05:26 +00:00
Jonathan Rosser d72ed7e469 Unify debian and ubuntu cache prep scripts
These should be able to be common, with a dictionary added to select
the right libpython version to install based on the OS release.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-lxc_container_create/+/839167
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/838762
Change-Id: I2cb97a25237a0495ea8d9001d80d06b134b8e500
2022-04-27 08:35:00 +00:00
Zuul 01a8891afc Merge "systemd-resolved package is not available for redhat" 2022-04-26 13:11:31 +00:00
Jonathan Rosser 8626a26d9a Ensure systemd-udev is present in centos containers
This is needed to ensure that systemd-tmpfiles-setup service
is present, which is used to create /dev/fuse in centos containers
in other parts of the osa-gluster patch series.

Change-Id: I6a6401debad4937eb9f6a5be31c8cee42d7035cd
2022-04-19 11:07:20 +00:00
Jonathan Rosser e8e89c0b13 systemd-resolved package is not available for redhat
Change-Id: Ib6134264e1a1d3a19b343b3c503da1602b68bc00
2022-04-11 09:20:35 +00:00
Zuul f16e0c8112 Merge "Clean up bionic variables" 2022-02-21 16:12:37 +00:00
Dmitriy Rabotyagov 65311aec6d Clean up bionic variables
Since 18.04 is unsupported, we cleanup related variables and
preparation scripts.

Change-Id: I5d25d63a30f24ac5daf3268c03b3248415a42cc7
2022-02-18 15:33:11 +00:00
Jonathan Rosser b614fe16a4 Generalise redhat variables to handle any distro and major release
Change-Id: I14fc02983efd807af97efe5689152d6562deafb9
2022-02-14 16:38:21 +00:00
Zuul 94d2856291 Merge "Simplify installtion of libpython" 2022-02-14 11:19:18 +00:00
Jonathan Rosser 9a40041694 Ensure that the legacy network-scripts package is present
The lxc_hosts ansible role currently relies on the ifup / ifdown
commands.

Change-Id: I3adb4dd75198935c4656d0208043ad8051f29312
2022-02-07 11:31:52 +00:00
Jonathan Rosser bafac67172 Simplify installtion of libpython
We only support one version of Debian so can remove the logic that
supports older versions.

Change-Id: Icf3c21de86297c2de3fc043d4903452747710e39
2022-02-02 04:39:43 -05:00
Jonathan Rosser 2bb97a64ac Remove vars files for EOL version of centos-8
Change-Id: I57560b416b03afffe7498609490da04d1a851f11
2022-02-02 03:59:07 -05:00
Dmitriy Rabotyagov 8b596119a3 Add CentOS 8.5 support
Change-Id: Id5aba392fd7034cb05a7f7025a09fdd44a9af82c
2021-11-19 12:46:44 +02:00
Dmitriy Rabotyagov a640dd6f38 Add iproute to CentOS LXC
This package provides `ip` binary that is required for gathering network
facts and any net management.

Change-Id: Iac833ea63636be9e3dc2a804d890bcb6851be542
2021-07-07 13:02:11 +00:00
Dmitriy Rabotyagov 02727291af Add CentOS 8.4 support
Change-Id: I7cd5f8065b25a552859a3c1fba72363d149d3ae1
2021-06-07 16:04:55 +03:00
Dmitriy Rabotyagov a1ca102c33 Add debian bullseye support
Change-Id: Ie2d96c7661310d567870164d2745a3640cf8c624
2021-06-01 17:58:52 +00:00
Jonathan Rosser 786c4fcf18 Switch all base images to be built locally rather than downloaded
This patch switches the debian/ubuntu OS to build their lxc base
images locally using debootstrap rather than download a pre-built
lxc image. This unifies the approach with Centos-8 which is already
building a local image using dnf.

The LXC cache prestage tasks are removed, and all variables
associated with the download of the lxc image are removed from
defaults/main.yml.

A new variable lxc_apt_mirror is introduced, which is passed to
debootstrap to provide the apt source that the container rootfs
should be built from.

Depends-On: https://review.opendev.org/786396
Change-Id: Ia5a62cee7ab493857df16f7ae906796d22ba616c
2021-04-22 12:55:26 +03:00
Jonathan Rosser 791b9e813e Optionally build container image as a local chroot
This change uses dnf to build the container image for Centos-8
using dnf locally rather than rely on an external image that is
downloaded and unpacked.

The existing image prestage commands are made conditional, and
an operating system specific command can be provided via role
variables to build a chroot in /var/lib/machines.

During the transition from Centos-8 to Centos-8-Stream, the
vars files are separated, with vars/redhat.yml covering Stream,
and vars/centos-8.3.yml covering legcay Centos-8.

In addition, the systemd-logind service is masked from the base
image. This is masked in the previously downloaded container base
image, so we ensure that the same is done for locally built chroots.

Depends-On: I31880ca995735b737d33532eaa4c29be02523117
Depends-On: I74f02669b013b8580d3469a8ffe214d88cd0f525
Change-Id: I1ddfe36259610b25e86b69d64d1d7f32a56c0e4d
2021-04-20 08:56:20 +00:00
Jonathan Rosser df9a63ea98 Remove references to unsupported operating systems
All references to Gentoo, SUSE, Debian stretch and Centos-7  are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible

Change-Id: I79f68c467d48b9b50143fd3a11e176f91804e805
2021-03-18 17:01:48 +00:00
Jonathan Rosser 6de26d8519 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: If64c72dc2ffbf87459b4729b9c03928efbf5177c
2021-03-04 14:24:37 +00:00
Zuul aaa8f73807 Merge "Update Centos-8 LXC image to 8.3" 2021-02-24 11:13:09 +00:00
Zuul d81a9ff0e8 Merge "Remove support for gentoo" 2021-02-23 10:55:04 +00:00
Zuul 9e76dc945f Merge "Remove support for openSUSE" 2021-02-23 10:50:49 +00:00
Jonathan Rosser 59abc5a288 Remove support for gentoo
Openstack-Ansible does not maintain support for deploying on gentoo
so we can simplify this ansible role

Change-Id: If2a63a2743714745e0f0b0eea2ee3d5b8d4c9a35
2021-02-17 19:14:55 +00:00
Jonathan Rosser 1e8055c5bf Remove support for openSUSE
OpenStack-Ansible no longer supports openSUSE so we can simplify this
ansible role.

Change-Id: I4c53307d0d4f7a72010b878953f34ba0c8784922
2021-02-17 17:31:23 +00:00
Jonathan Rosser fb1a6e1b64 Ensure sysctl command is present in the lxc base image for centos
A minimally built chroot will not contain this package so
ensure it is present

Change-Id: Ie13b3af30a78d05edbf20fc8d36d848d3fe841e0
2021-02-17 10:55:49 +00:00
Jonathan Rosser 172e3e4bd0 Update Centos-8 LXC image to 8.3
This requires extra ansible tasks to unpack the nested tar file
structure of the 8.3 container image.

Depends-On: I31880ca995735b737d33532eaa4c29be02523117
Change-Id: I443f5b9ecef1c142dcbcac91a0f36cb28035f3f6
2021-02-16 13:30:38 +00:00
Jens Harbott 47df1aa669 Add trusted.gpg to the copy_from_host list for 20.04
Without this, installing containers on a host that uses a non-default repo
source will fail.

Change-Id: Ib50b8a85cddcfffcfa54dc39580f92f7305c7c4a
2020-12-23 14:37:15 +01:00
Dmitriy Rabotyagov b3bff3289a Install sysctl package in container for debian
procps package has been removed from installation by [1] but it is required
to have this package since it provides sysctl binary.

[1] https://review.opendev.org/c/openstack/openstack-ansible-lxc_hosts/+/613078

Change-Id: Ia545aba3cbc4c8a1ca79ee78ab14864cd2ca3ece
2020-12-04 19:37:16 +02:00
Dmitriy Rabotyagov 46e10d21f1 Determine latest base image available
Closes-Bug: #1900884
Closes-Bug: #1900975
Change-Id: I362a15397fee891d967ce7150819b02312200d2e
2020-10-22 15:53:01 +00:00
Jonathan Rosser fd0ba694b5 Add rsync to container base image
Keystone requires rsync to be already present in the container image
becasue it runs serial=1 and uses rsync between multiple keystone
hosts. rsync will not be present on the target host in this situation.

Change-Id: I730ea2b7e6d913af020a81993f0b0e37c90a1a59
2020-10-12 17:10:20 +01:00
Jonathan Rosser 676f309eb9 Include libpython and rsync for centos in lxc base image
Some but not all roles use ansible-role-uwsgi to install libpython.
Those which do not require libpython to be in the container base
image.

Some roles use rsync for copying rootwrap files (cinder as example) and
in the long term this should be added to the distro packages for those
roles. In the meantime we add it back to the container base for centos
to allow other patches to merge.

Change-Id: Iaf92e78758c159db7e969a89a889c4d897f5045c
2020-10-08 06:40:47 +00:00
Jonathan Rosser 93df10df61 Replace some base packages removed when minimising the base image
These packages are required for selinux on centos and /etc/hosts on
ubuntu.

Change-Id: I7a4598cf01b7eca123299d9b15202208e6373db5
2020-10-07 08:11:26 +01:00
Jonathan Rosser cdd6315a8b Minimise distro packages installed into the lxc image
This patch removes all packages from the lxc image cache preparation
which are not required to run the 'setup-hosts' playbook, or pass the
lxc_hosts role tests.

Additional packages should be installed by the ansible roles which
further customise the containers.

Depends-On: https://review.openstack.org/619040
Change-Id: I9bdc698e4c712a6fb3d7a3b76413b478e1e7e91a
2020-10-06 07:34:52 +01:00