Commit Graph

19 Commits

Author SHA1 Message Date
Michal Nasiadka 65587cb279 Bump up Ansible supported versions to 5.x/6.x
This change bumps up the maximum supported Ansible version to 6.x
(ansible-core 2.13.x) and minimum to 5.x. This synchronises Kayobe with
Kolla Ansible.

Shebang has been removed from modules due to [1].

os_openstacksdk_version has been added as openstack cloud modules don't
support versions greater than 0.99.

[1]: https://github.com/ansible/ansible/pull/76677

Depends-On: https://review.opendev.org/c/openstack/kolla-ansible/+/867546
Change-Id: Ibb00f6d079442a8509411ae8a71d74fd7bd8cccd
2022-12-14 14:55:33 +00:00
Mark Goddard 388dfa369c Avoid fact gathering for group_by
There are a few places where we have a play with one task that uses the
group_by module to generate groups that are used in a subsequent play.
These plays do not need to gather facts for their target hosts.

In particular, the kolla-openstack.yml playbook should really be able to
operate without access to remote hosts.

This change also adds changed_when: false to all group_by tasks, since
they show as changed but haven't really made any changes outside of
Ansible.

TrivialFix

Change-Id: I18f67eda4e48058f3f402b9d0e692d6eeb02855f
2021-03-04 17:32:15 +00:00
Mark Goddard b9d76f6ef5 Remove support for CentOS 7 and Python 2
* Always use Python 3
* Drop code paths for CentOS 7
* Drop support for Yum
* Remove support for host NTP daemon, always use chrony
* Switch references from 'yum_install_epel' to 'dnf_install_epel'
* Remove overcloud host image workaround for tagged VLAN admin network
* Remove the kayobe.utils.yum_install function, which is unused

Change-Id: I368f6edafed9779658798fc342116b4c1b3ffd48
Story: 2006574
Task: 39481
2020-05-28 10:25:51 +01:00
Mark Goddard 2de3a2c578 Switch from shade to openstacksdk
Upstream Ansible OpenStack modules now use openstacksdk rather than shade.
Switch local Ansible modules to follow suit. Also switch to use the
stackhpc.os_openstacksdk role from stackhpc.os-shade.

The stackhpc.os-shade role is removed during 'kayobe control host upgrade'.

Change-Id: Id3894c3c36ef99f00ed463de6a3457e11733d6b7
Story: 2007294
Task: 38759
2020-02-20 15:28:56 +00:00
Kayobe deployment user 84d17b055e Use internal API endpoints in overcloud API interaction
Connections default to 'public' interface when attempting to run
openstack commands.  This breaks setups where the network hosts are
separate from the controllers.

This change adds an ``openstack_interface`` variable to select the
correct endpoint to use, which defaults to ``internal``.

Co-Authored-By: Michael Senizaiz <michael@r-hpc.com>

Change-Id: Ifa766d2cc3ed7077f03c571398072ad5117701c6
Story: 2006814
Task: 37374
2019-11-28 16:56:38 +00:00
Mark Goddard ddfd6b6202 Update packages in virtualenvs
Kayobe uses a number of virtual environments on the remote hosts for
python dependencies such as shade, python-openstackclient, docker, etc.
By default these are stored in /opt/kayobe/venvs/. Typically we do not
provide version restrictions when installing these packages, so over the
course of time they may become stale and incompatible.

This change installs the latest version of packages allowed by OpenStack
upper constraints.

It also adds a new variable, 'pip_upper_constraints_file', to set the
upper constraints file. The existing variable
'kolla_upper_constraints_file' now defaults to the value of
'pip_upper_constraints_file'.

Change-Id: I8d2956f95bbc44b5a9e88e7569372048a62f12f5
Story: 2005923
Task: 34193
2019-08-15 11:01:49 +00:00
Mark Goddard e83c57f233 Add support for CA certificate parameter
When using Ansible OpenStack modules, if OS_CACERT is defined, then this
will be passed as the cacert module argument.

This ensures that non-standard CA certificate paths can be used.

Change-Id: I2a2575b1fb0f149cc13c44526fc0167e68e07aab
Story: 2004911
Task: 29261
2019-01-31 15:38:52 +00:00
Pierre Riteau ac79d0d09a Add note about LLDP workaround for switches on Dell OS 9.11
The Dell LLDP workaround is not necessary on switches running newer
versions of Dell Networking OS. Since version 9.11(2.0P1), the interface
description can be advertised by LLDP, at least for S6000 and S3048–ON
switches.

Change-Id: Iaccab56ba068d1ca9ab9c0351d5ffc32a2348787
2018-11-08 11:03:29 +00:00
Mark Goddard f349038b1d Make installation of epel-release optional
The epel-release package provides a yum repository configuration for
EPEL, and points to the upstream EPEL mirrors. In some cases this is
undesirable, such as when a local EPEL mirror is available, or access to
the public repositories is not possible.

This change makes it possible to skip installation of epel-release, by
setting 'yum_install_epel' to 'false'.

Change-Id: Ib685b0c3e21df01c4dd177771f019fae4bb90e66
Story: 2003277
Task: 24218
2018-08-02 15:30:33 +00:00
Mark Goddard bc5f3aba90 Fix use of tags with overcloud post configure
When specifying tags with 'kayobe overcloud post configure --tags <tags>', the
expected plays typically do not run. This seems to be due to an ansible bug,
where if a dynamically created group is referenced before creation, it will
remain empty. See https://github.com/ansible/ansible/issues/20360.

This change works around this issue by modifying the name of the dynamic groups
used in the post configure playbooks to be unique to each playbook.

Fixes: #138
(cherry picked from commit 77a41a9d0a37acd2d4c25bd7d969d965a9552428)

Change-Id: I7a884f538cfeba9d6b4b990ec445b5ad6f914193
2018-03-13 11:32:26 +00:00
Mark Goddard d8fe45b3d8 Tag all (well, some of) the things (plays)
Having tagged plays allows us to easily run a subset of the plays for a
command, and perform targeted operations with less risk of unintended
consequences.

The tags are typically named after the playbook, although some of the
overcloud playbooks have been tagged without an overcloud- prefix.
2017-12-19 16:58:21 +00:00
Mark Goddard 7f767b1b4e Convert variable to bool in group_by
We use the group_by module to create groups based on host variables.
When the variable is a boolean, we should convert it to a bool using the
bool filter, to ensure that the group name has a consistent format.
2017-11-24 15:34:54 +00:00
Mark Goddard c33d2a4e0e Don't run baremetal compute tasks when ironic is disabled
This includes:
* Building and registering IPA images
* Registering a provisioning network
* Registering ironic inspector introspection rules
* Creating an inspection store container
2017-11-13 19:15: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 2529d207ed Fix some 'issues' raised by ansible-lint 2017-09-14 14:43:42 +01:00
Mark Goddard 19ceec45cd Use virtualenv_path for all virtualenvs 2017-08-07 12:08:08 +00:00
Mark Goddard 4c9a6da3f1 Support interface name map for Dell LLDP switch port workaround
The current implementation only works if all compute nodes in the system
have the same interface name for their provisioning network. This change
adds a default value and a map for exceptions
2017-06-15 14:52:23 +01:00
Mark Goddard cd306f4cf3 Add validation of OpenStack auth parameters 2017-04-05 11:23:44 +01:00
Mark Goddard aa6e2e2514 Add inspector rules to workaround Dell switch LLDP issues
Some Dell switch OSs (including Dell Network OS 9.10(0.1)) do not support
sending interface port description TLVs correctly. Instead of sending the
interface description, they send the interface name (e.g. TenGigabitEthernet
1/1/1). This breaks the discovery process which relies on Ironic node
introspection data containing the node's name in the interface port
description. We work around this here by creating an introspection rule for
each ironic node that matches against the switch system and the relevant
interface name, then sets the node's name appropriately.
2017-03-27 16:26:45 +01:00