Commit Graph

994 Commits

Author SHA1 Message Date
Andrew Bonney 47bd365532 Re-distribute fernet keys when re-building the primary
Currently when re-building the keystone primary node, a new set
of fernet keys will be created as none exists, despite keys
existing on the secondary nodes.

This patch uses a similar approach to the credential key
distribution where other nodes are checked for keys if none exist
on the first play host. In this case an rsync is performed to
distribute the keys correctly before proceeding.

Change-Id: I92434276aef54805e5cee56e1d22821e11245fe4
2024-02-01 09:36:14 +00:00
Dmitriy Rabotyagov 7dbec32273 Add quorum queues support for service
This change implements and enables by default quorum support
for rabbitmq as well as providing default variables to globally tune
it's behaviour.

In order to ensure upgrade path and ability to switch back to HA queues
we change vhost names with removing leading `/`, as enabling quorum
requires to remove exchange which is tricky thing to do with running
services.

Change-Id: I81216a7eabe6b99d08ab15a62c046108fcb2bfc5
2023-11-10 17:00:57 +01:00
Zuul e79507f44e Merge "Cleanup upgrade to ssh_keypairs step" 2023-10-26 09:59:35 +00:00
Andrew Bonney 2ed76dee5d oidc: fix overloading of redirect_uri for cli client
The redirect URI specified in the Apache config for OIDC
was unintentionally serving a dual purpose as a redirect
URI and a handler for command line auth.

As of mod_auth_openidc v2.4.9 this no longer works.
This change splits the paths for command line auth and
the redirect URI into two to work around this.

Change-Id: I27c612cf8537b401c1195ae0892bf5569e2f3858
2023-10-20 14:04:31 +01:00
Dmitriy Rabotyagov bb62cf36c6 Cleanup upgrade to ssh_keypairs step
We have migrated to usage of ssh_keypairs role a while ago and we
can remove old migration clean-up task.

Change-Id: I2c73f087b48fd3e664e0b339f2fb2b77b208f6c5
2023-10-19 10:43:21 +02:00
Andrew Bonney b54478e7e1 oidc: fix recognition of x forwarded headers from v2.4.11
The Apache mod_auth_openidc requires explicit configuration in
order to read the X-Forwarded-Proto from the reverse proxy as
of version v2.4.11 which comes in from Ubuntu Jammy.

Eventually this will need to become the default and the
variable added in this patch can be removed.

Change-Id: Ic9d37a8463d137508d20de20b10af806a223f852
2023-09-29 08:24:16 +00:00
Dmitriy Rabotyagov 6976701fc4 Fix example playbook linters
Example playbook was containing incorrect formatting which caused
linters job to fail

Change-Id: Ice1b49d31e81c19f3c40b4b7c1cd5ff85128eed3
2023-09-29 10:23:38 +02:00
Dmitriy Rabotyagov a51651213d Install distro_packages in pre-main
Main tasks are executed in a serial manner, so all keystone containers
except the first one end up not having rsync and sshd isntalled, while
we attempt to distribute fernet tokens once running against first host.

So we move installation of distro_packages to pre-main step
that is run in advance without serial approach.

This is alternative approach to [1].

[1] https://review.opendev.org/c/openstack/openstack-ansible-os_keystone/+/889936

Needed-By: https://review.opendev.org/c/openstack/openstack-ansible-lxc_hosts/+/889945
Change-Id: Ia53932f60d271b8f2843b880e024caacc7ae5c3f
2023-09-05 06:30:42 +00:00
Dmitriy Rabotyagov f66934de35 Fix docs jobs after sphinx update
Doc jobs for the role are failing now with line being too long. Adding
new line fix the issue as link is treated properly afterwards.

Change-Id: I4deeacd9d953e3bf1bde208a4011455f8dd6fbe0
2023-09-05 08:26:20 +02:00
Zuul 3956812d3d Merge "Stop reffering _member_ role" 2023-08-17 09:52:13 +00:00
Zuul fffdd962d6 Merge "Install libldap-common for keystone" 2023-08-15 21:52:19 +00:00
Dmitriy Rabotyagov 9ca29f5754 Stop reffering _member_ role
Keystone has stopped providing or reffering `_member_` role for a while,
thus role should not be refferenced anymore.

Moreover, with 2023.1 service policies have dropped `_member_`
which resulted in the role to be insufficient for basic operations.

Change-Id: I5732f9197902fccb96eb8537050849a1692d3725
Related-Bug: #2029486
2023-08-15 13:18:45 +02:00
Marc Gariepy 459da2f445 Install libldap-common for keystone
Is the package is not installed it's not possible to validate the
tls cert of the ldap-server.

This package went from depends to suggests in jammy release.

Change-Id: Ia9e2e35d3898727af67c4d07115bad6d0582dda4
2023-08-04 11:14:43 -04:00
Dmitriy Rabotyagov eea1a4853f Fix linters 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.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/888223
Change-Id: Id92330b3c709201a74612c8353cefa75778eac0c
2023-07-14 20:44:53 +02:00
Damian Dabrowski b73bcd9981 Fix SSL logic in keystone-httpd.conf.j2
Defining SSL parameters has nothing to do with
keystone_service_internaluri_proto. It should not be taken into
consideration there.
Theoretically speaking, environment can have TLS disabled on frontend
but enabled on backend.

Change-Id: I81b66a7388c335958badf7135f4289c3423cb229
2023-06-04 17:24:09 +02:00
Zuul 2378e452ad Merge "Rename keystone_ssl to keystone_backend_ssl" 2023-04-20 18:46:50 +00:00
Zuul 674c8a5434 Merge "Use chain cert file for apache" 2023-04-18 15:29:23 +00:00
Damian Dabrowski 59f04a63c5 Remove security.txt parts
Keystone is no longer responsible for storing and serving security.txt
file. It is now fully handled by haproxy.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/880110
Change-Id: Iefd090dce0441f81eb4d5b203f61a4587a5beedb
2023-04-11 21:09:57 +00:00
Damian Dabrowski 6661a9dab7 Rename keystone_ssl to keystone_backend_ssl
To standarize variable name across roles, this change renames
`keystone_ssl` to `keystone_backend_ssl`.
All other roles use `<service>_backend_ssl` format.
It also better describes what it does. With `keystone_ssl` it's unclear
whether it is about frontend or backend.

Backward compatibility will not be implemented because securing haproxy
traffic to its backends with TLS is currently not supported by OSA so
it is hard to leverage `keystone_ssl` variable anyway.

Change-Id: Ibf8607a4cf62ab518a09d64b1054ff7fbc580000
2023-04-08 12:53:10 +00:00
Damian Dabrowski 931695475c Use chain cert file for apache
Apache needs to respond with all intermediate CA certificates.
Otherwise, haproxy will not be able to validate backend certificate.
That is why -chain.crt file needs to be installed for keystone.

Change-Id: Ibc8267a1c27e1de7ed5bce716199f3264e8c136d
2023-04-08 14:52:34 +02:00
Jonathan Rosser a020ff87cd Test multiple keystone containers for os_keystone tests
Keystone has particular ordering requirements for setting up
multiple instances and distributing fernet keys.

Run the infra jobs for the os_keystone role as these test
three keystone containers simultaneously.

Change-Id: Ia454d95a48dff1fa1856137df74a548d9c7d8a11
2023-02-01 16:13:50 +00:00
OpenStack Release Bot d83b32adca Update master for stable/zed
Add file to the reno documentation build to show release notes for
stable/zed.

Use pbr instruction to increment the minor version number
automatically so that master versions are higher than the versions on
stable/zed.

Sem-Ver: feature
Change-Id: I83fbde781bbedd6e84f2ff1b1136b4558bf1da00
2022-12-13 13:15:56 +00:00
Dmitriy Rabotyagov 8017d4dd84 Define venv_tag as separate task for distro
We do define venv_tag locally using python_venv_build role so no need
to do the same as a separate task for source installs. Though this task
is still needed for distro path.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/862924
Needed-By: https://review.opendev.org/c/openstack/openstack-ansible/+/866126
Change-Id: I49a45e68bd6030d4bd0667c8384a01088819f260
2022-12-06 11:58:52 +00:00
Zuul 1add87ad2f Merge "Improve way of cache backend selection" 2022-10-05 12:44:25 +00:00
Zuul ddcca32393 Merge "Bootstrap when running against last backend" 2022-09-24 19:19:53 +00:00
Dmitriy Rabotyagov 0a24c61e3e Improve way of cache backend selection
At the moment we don't provide any option rather then use memcached
backend. With that we also hardocde list of packages that should be
installed inside virtualenv for selected backend.

Adding bmemcached requirement to oslo_cache.memcache_pool [1] gives us
opportunity to refactor this bit of deployment and allow to be more
flexible in backend selection and requirements installation for it.

[1] https://review.opendev.org/c/openstack/oslo.cache/+/854628

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/858981/4
Change-Id: I2810208301fb31eeeabf31e4b38add7f8aa3e00b
2022-09-23 10:49:09 +02:00
Zuul 3b4fc2e9aa Merge "Add the option to deploy keystone without apache" 2022-09-20 20:52:18 +00:00
Dmitriy Rabotyagov 7868766202 Bootstrap when running against last backend
When deploying keystone for the first time, aliveness check inside
service_bootstrap can not succeed for multi-node setup, as playbook
will disable current backend. So we need to bootstrap host only
when running against last host in play. We also should make sure, that
following tasks will not fail when running against first ones.

Closes-Bug: #1990008
Related-Bug: #1989326
Change-Id: Ifa9a79c34265b225a5e24c30cae47d3f0fa0739f
2022-09-19 14:11:31 +00:00
Erik Berg f28a1cc0a2 Remove redundant vars line
This line was introduced by Ib339cd0657f7008fa48bf74f8d6ddd4b8add2ea1
for centos-7 support, and should already be covered by the
distribution_major_version line above.

Change-Id: I87dbc866f63cd1240dd0049b5b30a1339e1b1e34
2022-09-14 10:56:02 +02:00
Kevin Carter 3928511919 Add the option to deploy keystone without apache
This change gives the keystone role the ability to deploy keystone using
only uWSGI, which eliminates Apache and all of its dependencies from the
environment. While this capability is not as feature rich as the apache
based deployment, which is still the default, it does offer a signficant
reduction in process overhead targeting minimal deployment usec-ases,
for deployments which do not need or want advanced keystone features
this is a huge benefit.

Signed-off-by: Kevin Carter <kevin@cloudnull.com>
Change-Id: I5a8484082f6331d2c5a452af2760c8e79d44fab8
2022-09-08 14:35:49 -05:00
Zuul b9fc36753b Merge "Fix keystone_secure_proxy_ssl_header logic" 2022-08-12 19:15:45 +00:00
Zuul 056623431a Merge "Add PKCE method for OIDC" 2022-08-12 11:30:16 +00:00
Zuul c0c3f3ad77 Merge "tls1.2: update ciphers to latest recommendations" 2022-08-12 10:55:51 +00:00
Dmitriy Rabotyagov 33ee3fcb17 Fix keystone_secure_proxy_ssl_header logic
Previous commit [1] introduced logic that breaks proper service
discovery. Now we're fixing logic, following next rules/assumptiuons:
+----------+---------+---------------+
| HAProxy  | Apache  | RequestHeader |
+----------+---------+-- ------------+
| non-SSL  | non-SSL | http          |
| non-SSL  | SSL     | http          |
| SSL      | SSL     | https         |
| SSL      | non-SSL | https         |
+----------+---------+---------------+

[1] 6fae2bdade

Change-Id: Ibf7759eea63b7150aeae655c10eccc69cd3417ea
2022-08-12 09:13:34 +00:00
Jonathan Rosser 05c64f7651 Check the service status during bootstrap against the internal VIP
This change brings the keystone role into line with others such
as cinder which check the service status using the loadbalancer.

This is useful in environments using a proxy server where the
internal VIP can be included in "no_proxy" but the service IP
for the containers are too numerous to list in "no_proxy" and
stay within the 1024 character limit for pam_env.

Change-Id: I1a4aec40618237aa23b4f40b335c141071a56f08
2022-08-08 19:07:57 +00:00
mroth26 ec9ffea3ca Add PKCE method for OIDC
Change-Id: Icb77fff4a2f823f4c2a84dc77c21e4ddf0c8e22c
2022-08-08 16:23:58 +02:00
Andrew Bonney 89bff18166 tls1.2: update ciphers to latest recommendations
Based upon usual recommendations from:
https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/

Change-Id: Iaf5e41417a5226c42ef742d0b6478895d9256769
2022-08-05 10:44:13 +01:00
Dmitriy Rabotyagov e26aabe440 Remove mention of haproxy-endpoints role
Keystone role was never migrated to usage of haproxy-endpoints role
and included task was used instead the whole time.
With that to reduce complexity and to have unified approach, all mention
of the role and handler are removed from the code.

Change-Id: Ib21a5f5caa590daa827e45d26015bf32abe39cf2
2022-06-14 14:42:36 +02:00
Zuul 235bc0d037 Merge "Remove old pre service setup tasks." 2022-05-30 21:42:02 +00:00
Dmitriy Rabotyagov ca382d2c03 Switch sphinx language to en
With sphinx release of 5.0.0, they changed default for language variable
to 'en' from None. With that current None valuable is not valid and should
not be used.


Change-Id: I7f03a145490529e703aced630c49d08b0e59a435
2022-05-30 16:01:30 +02:00
Jonathan Rosser d02d038e94 Remove old pre service setup tasks.
These are now in main_pre.yml and the role should be called seperatley
with tasks_from targetting all keystone hosts before being called
again with serial: settings appropraite for H/A deployments.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/843740
Change-Id: Iecb5567382d27ae6a875f8937f33aa7bb492252e
2022-05-29 16:14:13 +00:00
Jonathan Rosser 7ab6882066 Add a new main tasks file for pre-service setup
There are a number of tasks and use of the ssh keypair setup role
which must happen on all of the keystone hosts before the service
itself is deployed.

Previously, the keystone role ran with serial (1,100%), and the
pre-service setup tasks iterated over ansible_play_hosts
during the deployment of the first keystone host using delegate_to.
This makes the control flow of the role hard to understand and
causes issues when the pre-service tasks need to include further
roles which also use delegate_to, such as the ssh-keypairs role.

This change introduces a new 'main' tasks file for the pre-service
setup  which can be called independantly with no restriction on
serial:. This means that the pre-service setup can be completed
on all keystone hosts using normal ansible tasks without iteration
or delegate_to, and the role can be called a second time with the usual
main.yml and serial: settings to deploy the service itself and
maintain operation in a H/A deployment. In addition, the behaviour
of --limit will now be more obvious.

Change-Id: Ifcd2afe217205684b0ea3917a3776666d10ffae7
2022-05-29 16:14:07 +00:00
Zuul a0c419c9b8 Merge "Fix certificate installation for keystone" 2022-05-05 09:28:32 +00:00
Zuul ec14b0a728 Merge "Set pki_dir when keystone calls the pki role" 2022-05-05 09:22:33 +00:00
Jonathan Rosser 4f02985c43 Fix certificate installation for keystone
There are problems when keystone_idp has legitimately undefined keys,
and also variable name which should be templated.

Change-Id: Iabe61d63994e38cb3f99c8285deff60ef2e9ee55
2022-05-04 17:39:10 +01:00
Zuul 05f0cd9027 Merge "Handle host with unset ansible_host" 2022-05-04 13:12:10 +00:00
Jonathan Rosser e667befb70 Set pki_dir when keystone calls the pki role
This is needed to use the deployment wide location for the CA and
certificate store.

Change-Id: I1b9658a7ef4efc66c9ad5636474a19302589ecfb
2022-05-04 13:20:36 +01:00
Jonathan Rosser fcbf8ede8f Ensure that openstack_ssh_keyspairs_dir has a default value
This is otherwise undefined in functional tests

Change-Id: Ia57b67e5636690327264b1213c0eb491afd8750d
2022-05-04 07:59:17 +01:00
Zuul db823b6370 Merge "Tidy IDP setup task files" 2022-04-26 14:44:54 +00:00
Zuul fdcdf41e28 Merge "Migrate ssl certificate generation to the PKI role" 2022-04-26 14:32:25 +00:00