Commit Graph

213 Commits

Author SHA1 Message Date
Matt Crees c04b6ddf1b Support saving baremetal compute inspection data
Add the command ``kayobe baremetal introspection data save`` to save the
hardware introspection data gathered by ``kayobe baremetal compute
inspect``. This mirrors the functionality of ``kayobe overcloud
introspection data save``, but for use with the baremetal compute
Ironic, rather than Bifrost.

Change-Id: I654f7d6e923c442a8aa08f536cc2b82c5e5b69d1
2024-03-14 14:03:42 +00:00
Zuul 684a440bae Merge "Make hooks environment-aware" 2024-03-01 14:28:02 +00:00
Zuul f2b658ecb6 Merge "Generate KA config before ``kolla ansible run``" 2024-02-16 19:36:21 +00:00
Pierre Riteau 4337e78eea Add missing space in help output
Change-Id: I6834aa6a19a73efe807402fa767b9ceaf1170a20
2024-02-13 19:26:54 +00:00
Matt Crees bc98c494ae Generate KA config before ``kolla ansible run``
Supports calling custom Kolla Ansible commands directly after a
``kayobe control host bootstrap``.

Change-Id: I19f188cc002f8578618003e90c0a4a154b806e49
2024-02-02 13:25:58 +00:00
Mark Goddard 0055d384a6 Make hooks environment-aware
Previously it was only possible to define custom playbook hooks in the
base configuration, and not in environments. This could be limiting in
cases where different environments require different hooks.

With this change it is now possible to define hooks both in the base
configuration and in environments.

Change-Id: Ic003c18402177318ac1aa4c2d851263893bd4e9f
2023-12-21 14:45:30 +00:00
Zuul 63f9aa4ef1 Merge "Generate local Kolla Ansible config in check mode" 2023-11-08 18:26:14 +00:00
Michal Nasiadka 672d6fa24a bifrost: Populate bifrost host vars on deprovision
Closes-Bug: #2038889
Change-Id: I4609494d009c6e1f97d833a9a11529d107b3216f
2023-10-17 09:29:31 +02:00
Mark Goddard 2c0f705e7a Generate local Kolla Ansible config in check mode
If running a command in check mode such as

    kayobe overcloud service deploy --check

Kayobe does not generate the local configuration for Kolla Ansible. This
can lead to an inaccurate result when comparing with the remote
configuration, if there are changes in kayobe-config.

For example:

* Run kayobe overcloud service deploy
* Change a file in etc/kayobe/kolla
* Run kayobe overcloud service deploy --check --diff

We would expect that the changed file results in a diff against the
remote config. However there is no diff displayed.

This change fixes the issue by always generating the local Kolla Ansible
config, even in check mode.

Change-Id: Ic1dd075076ea186b0928bba1a235605c0cd2ec71
Story: 2010526
Task: 47132
2023-04-19 17:01:09 +01: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
Matt Crees 4af5fd172b Add command to run config validation
Adds the command ``kayobe overcloud service configuration validate`` to
run the ``oslo-config-validator`` on all hosts via Kolla-Ansible. The
output directory of the results is specified with the flag
``--output-dir``.

Change-Id: I5d5d16eeabe69e8659e33722165928df096b3559
2023-01-10 16:08:25 +00:00
Pierre Riteau f6660bbff8 Remove support for Monasca and its dependencies
This follows removal of support from Kolla Ansible. This also removes
support for configuring Grafana with overcloud post configure.

Change-Id: I8102fafb00db178f1ae6801d37c43a39033cbfe6
2022-12-13 14:32:33 +01:00
Alex-Welsh ce74a98b1d Add --add-known-hosts to control host bootstrap
Provide the option to add hosts to the SSH known hosts file when running
control host bootstrap.

Story: 2001670
Task: 6716
Change-Id: I512a343f875ee95194ab4fa98872e349f5a6dc7b
2022-11-09 11:26:15 +00:00
Zuul 64a76166b0 Merge "Fix comment in OvercloudPostConfigure" 2022-10-13 21:38:11 +00:00
Zuul 1120958133 Merge "Update comments for host configure commands" 2022-10-13 21:38:09 +00:00
Pierre Riteau 642486d821 Fix comment in OvercloudPostConfigure
Change-Id: I56a25a82ad696122a37ffb1a347d72f0722b5757
2022-10-07 16:07:20 +02:00
Pierre Riteau cd46e1524c Update comments for host configure commands
Change-Id: I249ec3e3417db31d1f0d880ac9b101f88cac2fe5
2022-10-07 16:03:55 +02:00
Alex-Welsh d7069283fd added option to skip hooks
adds the argument --skip-hooks/-sh which will stop the execution of
hooked ansible playbooks. Either a pattern can be specified to match
against or hook execution can be stopped altogether with "all"

Story: 2009241
Task: 43390

Change-Id: I4f2176aa056fec62e31d07140e3d05779480a93d
2022-10-04 14:40:31 +01:00
Mark Goddard d490367634 Fix IP allocation limit in overcloud inventory discover
After generating an inventory file in 'kayobe overcloud inventory
discover', the IP allocation playbook runs to allocate IP addresses for
the new hosts. Currently this runs without a limit, meaning it targets
all hosts. This change fixes it to use a limit of overcloud.

TrivialFix

Change-Id: Ic3a98fb9e741a2dea792b2e6cf6a6ff802d099a2
2022-08-26 14:19:14 +00:00
Mark Goddard 32a82ea039 Support authentication in Bifrost
* Switch from python-ironic-inspector-client to openstacksdk in
  ironic-inspector-rules. This allows us to use clouds.yaml to provide
  credentials.
* Enable authentication in Bifrost. Passwords are auto-generated by
  Bifrost, and stored files in /root/.config/bifrost/. This change
  depends on a Kolla Ansible patch that ensures that these credentials
  are persisted between recreations of the bifrost container.
* Copy clouds.yaml and (if present) a CA certificate from the Bifrost
  container to the seed host, under the Kayobe Ansible user (stack).
  This allows us to use the credentials to register introspection rules.
* This patch is needed by a Kolla Ansible patch that enables TLS in
  Bifrost, since we need the CA certificate on the host to register
  introspection rules when TLS is enabled.

Depends-On: https://review.opendev.org/c/openstack/kolla-ansible/+/851837
Needed-By: https://review.opendev.org/c/openstack/kolla-ansible/+/851838

Story: 2010206
Task: 45930

Change-Id: I757f1bb72afb01a4f1689bed292f5b71b9048fa0
2022-08-25 11:56:03 +02:00
Michal Nasiadka caa7cc54ee selinux: default to permissive
The disable-selinux role has been renamed to selinux and now supports
setting desired state.

Previously Kayobe was defaulting to disabling and rebooted the host - to
avoid audit logs filling up. This change allows operators to define
desired SELinux state and defaults to permissive - to adhere to those
site policies that require SELinux to be at least in permissive state.

Change-Id: I42933b0b7d55c69c9f6992e331fafb2e6c42d4d1
2022-06-17 09:24:27 +02:00
Mark Goddard c4b74f4801 libvirt: deploy libvirt on the host
In some cases it may be desirable to run libvirt daemon on the host. For
example, when mixing host and container OS distributions.

This change makes it possible to disable the nova_libvirt container, by
setting kolla_enable_nova_libvirt_container to false.

The stackhpc.libvirt-host role is used in order to install and configure
a libvirt daemon on compute hosts when
kolla_enable_nova_libvirt_container is false.

Depends-On: https://review.opendev.org/c/openstack/kolla-ansible/+/825357
Depends-On: https://review.opendev.org/c/openstack/kayobe-config-dev/+/829225
Depends-On: https://github.com/stackhpc/ansible-role-libvirt-host/pull/51

Story: 2009858
Task: 44495

Change-Id: I73fef63fb886a9d543d2f4231fb009523495edb3
2022-03-24 13:44:48 +00:00
Mark Goddard cb48f7e5d2 Refactor host configure commands to use a single playbook
Ansible failure handling is different when executing multiple top-level
playbooks (CLI arguments) vs. multiple plays within a top-level
playbook. If any hosts have failed or are unreachable at the end of a
top-level playbook, then ansible-playbook exits non-zero.

In contrast, execution will continue at the end of a mid-playbook play
if there are hosts that have not failed or become unreachable. This is
documented in [1].

Currently, Kayobe executes multiple top-level playbooks, most notably in
the host configure commands where there is a long list of them. This has
implications when working at scale, where failures are more common. If a
host fails at any point, then execution of the command will stop at the
end of the current playbook. This means that the command must be run
again for all hosts. Additionally, if any hosts are unreachable, then
the command is unable to progress at all without removing them from the
inventory.

This change refactors the host configure and host upgrade commands to
use a single top-level playbook.

[1] https://github.com/markgoddard/ansible-experiments/tree/master/14-error-handling

Story: 2009854
Task: 44482

Change-Id: Ia63d66097b10b6ddda30ad693636143f8b1a85e0
2022-02-22 09:22:09 +00:00
Zuul 07094b8ccd Merge "Drop kolla-host.yml playbook" 2022-02-04 18:51:28 +00:00
Mark Goddard b273af0e89 Drop kolla-host.yml playbook
This playbook is no longer necessary following the removal of the iSCSI
deploy driver from Ironic.

Change-Id: I9e99c04173acb7adb0d0e367b6db388b86baf5f2
2022-01-18 17:03:28 +00:00
Mark Goddard b73e8250a0 Remove chrony cleanup from overcloud host configure
The chrony container removal was performed in the Xena cycle, so we no
longer require this in the 'overcloud host configure' command.

Change-Id: Ic6909bba42b07a5f3528e7507cb3b25199a72b43
2022-01-11 14:27:09 +00:00
Zuul 74d50525e6 Merge "Allow enable SNAT service on the seed hypervisor" 2022-01-07 12:45:44 +00:00
Zuul 30efba2b0a Merge "Generate kolla config when running database commands" 2022-01-06 17:02:12 +00:00
Zuul 4028a56fac Merge "Add support for configuring proxy settings" 2022-01-04 17:22:48 +00:00
Kayobe deployment user 4321471a13 Generate kolla config when running database commands
Change-Id: Ief9adfcff28d269fc80a073cdde536e8e803ca37
Story: 2009648
Task: 43807
2022-01-04 15:58:14 +00:00
Maksim Malchuk e10b52c588 Allow enable SNAT service on the seed hypervisor
Adds an ability to enable SNAT service on the seed hypervisor.

Depends-On: Ie42ab7a0dc9dd1ed1925b3a17134b3770ae8ba98
Change-Id: I0a2ff5caa01d54b1532d30d501b55ef23a6deff8
Signed-off-by: Maksim Malchuk <maksim.malchuk@gmail.com>
2021-12-10 07:47:30 +03:00
Pierre Riteau c35f112a14 Build overcloud host image directly with DIB
As a first step towards supporting multiple overcloud disk images, this
change introduces a new command to build a disk image directly with DIB:
`kayobe overcloud host image build`.

It also disables building a root disk image during Bifrost bootstrap if
overcloud_dib_build_host_images is set to true.

Change-Id: I93d242889e225b4e60254f6b9cc5eeb457294ac8
Story: 2002098
Task: 41693
2021-11-26 09:28:00 +01:00
Mark Goddard 49218b34db Remove stale config dump from seed hypervisor host configure
The config dump was removed from host configure commands in
I85670be7242bc436f73c689f027670b0938ba031, but somehow the seed
hypervisor was missed.

Change-Id: I4ae457a784423dcce96e51b4bb21219831acc854
2021-10-20 08:31:35 +02:00
Pierre Riteau e48960ecf2 Add support for configuring proxy settings
Change-Id: Ic5130a7512d4a26354bd292b0ab51ab4a9279f0a
2021-10-19 10:58:19 +02:00
Pierre Riteau e58a12534b Add missing apt playbook for infrastructure VMs
Change-Id: Id518acd289bc144dc01db819abaebbc8a1cde924
2021-10-14 20:21:32 +02:00
Michał Nasiadka 769c2efb97 Add support for configuring tuned profile
This is only supported on CentOS for now due to limitations of the
Ansible role used to configure tuned.

Change-Id: Ie07c5f467975f8da2f720e70c94cea6285981d72
Co-Authored-By: Pierre Riteau <pierre@stackhpc.com>
Story: 2007853
Task: 40155
2021-10-06 17:49:24 +02:00
Mark Goddard 4b31079fae firewalld: support infra VMs
Follow up to Id60e25e129e323f3c07e702bb81a11efc530fb3e, adds support for
firewalld configuration on Infra VMs.

Change-Id: Idd1ab982d4bca1cbdb0c4c6041cf3b6c17eae6cb
2021-10-06 14:30:58 +02:00
Zuul f11c73ff03 Merge "Support configuration of firewalld" 2021-10-05 17:25:06 +00:00
Will Szumski c583922c27 Add support for infrastructure VMs
This change allows you to define additional VMs to deploy
on the seed-hypervisor.

Co-authored-by: Piotr Parczewski <piotr@stackhpc.com>
Co-authored-by: Will Szumski <will@stackhpc.com>
Co-authored-by: Mark Goddard <mark@stackhpc.com>
Story: 2008741
Task: 42095
Change-Id: I8055fc5eb0a9edadcb35767303c659922f2d07ca
2021-10-04 12:40:54 +01:00
Mark Goddard 7d15aa16f2 Support configuration of firewalld
Adds support for configuring firewalld for CentOS hosts managed by
Kayobe.

* create zones
* set default zone
* set zone for interfaces
* define rules

Change-Id: Id60e25e129e323f3c07e702bb81a11efc530fb3e
Story: 2008991
Task: 42644
2021-10-04 10:36:13 +01:00
Zuul 00f422c785 Merge "Add support for apt proxy setting" 2021-09-30 14:44:33 +00:00
Zuul 4e14f9e9c5 Merge "Support Ansible collections" 2021-09-29 18:19:44 +00:00
Mark Goddard 2648f48746 Make setup module arguments configurable
Ansible facts can have a large impact on the performance of the Ansible
control host. This patch introduces some control over which facts are
gathered (kayobe_ansible_setup_gather_subset) and which facts are stored
(kayobe_ansible_setup_filter). By default we do not change the default
values of these arguments to the setup module. The flexibility of these
arguments is limited, but they do provide enough for a large performance
improvement in a typical moderate to large OpenStack cloud.

In particular, the large complex dict fact for each interface has a
large effect, and on an OpenStack controller or hypervisor there may be
many virtual interfaces. We can use the kayobe_ansible_setup_filter
variable to help:

    kayobe_ansible_setup_filter: 'ansible_[!qt]*'

This causes Ansible to collect but not store facts matching that
pattern, which includes the virtual interface facts. Currently we are
not referencing other facts matching the pattern within Kayobe.
Note that including the 'ansible_' prefix causes meta facts module_setup
and gather_subset to be filtered, but this seems to be the only way to
get a good match on the interface facts. To work around this, we use
ansible_facts rather than module_setup to detect whether facts exist in
the cache.

The exact improvement will vary, but has been reported to be as large as
18x on systems with many virtual interfaces.

This change also introduces a new command to gather facts for Kayobe &
Kolla Ansible on demand, 'kayobe overcloud facts gather'. This can be
used to populate a fact cache.

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

Change-Id: I5ce3c734433e1682ee942867505468c57440e689
2021-09-27 09:31:09 +00:00
Mark Goddard 5535832c10 Support Ansible collections
This change adds support for installing Ansible collections via
requirements.yml in Kayobe or Kayobe config.

Story: 2008391
Task: 41315

Change-Id: I764ff019a18266b593add7ab80ee095d7d07a869
2021-09-27 09:10:50 +00:00
Skylar Kelty f24b3176eb Add support for apt proxy setting
Add support for configuring apt's proxy setting on Ubuntu hosts.

Change-Id: Iea1daff70fca5cf49f4e7f44af71a900678bb5c9
Story: 2009035
Task: 42782
2021-09-21 10:39:38 +02:00
Zuul 814a377471 Merge "Add kayobe overcloud service prechecks command" 2021-06-09 11:23:19 +00:00
Mark Goddard dc53d29eaa chrony: cleanup during overcloud host upgrade
The Kolla Ansible chrony container is disabled by default in the Wallaby
release. A new kolla-ansible chrony-cleanup command can be used to clean
up the container.

This change extends the 'kayobe overcloud host upgrade' command to cover
cleaning up the chrony container (if disabled) and deploying a host
chrony daemon.

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

Change-Id: I275102ec6b5bab6982577b52fd29654c874446ce
2021-05-24 10:55:38 +01:00
Mark Goddard b398e28dc5 Add kayobe overcloud service prechecks command
Runs 'kolla-ansible prechecks' without deploying services.

Change-Id: I3806b707593fc6ac9d7125e1b12d716ad40a2808
Story: 2008912
Task: 42503
2021-05-21 11:26:49 +01:00
Will Szumski 085cf7d175 Adds support for configuring chrony
Some hosts in the kayobe inventory might not be in the kolla-ansible
inventory so it makes sense for kayobe to manage NTP.

Change-Id: Iacb579a46b0e9769a4c404a858d17968f74dd7e0
Depends-On: https://review.opendev.org/c/openstack/kayobe-config-dev/+/786040
Story: 2007872
Task: 40240
2021-05-07 18:27:50 +02:00
Zuul f6433120ae Merge "Add --nocache option to container image build" 2021-04-08 17:57:18 +00:00