Commit Graph

88 Commits

Author SHA1 Message Date
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 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
Zuul ddcca32393 Merge "Bootstrap when running against last backend" 2022-09-24 19:19:53 +00: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
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 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 14a2bd072c Migrate ssl certificate generation to the PKI role
This is now common functionality in an ansible role, rather than
being implemented directly in openstack-ansible service roles.

This patch creates the apache server certificate and key using the
pki role when keystone_ssl is true.

A CA certificate and key are generated and installed when keystone
is configured to be an IDP, triggered by keystone_idp.certfile being
defined.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-pki/+/830794
Change-Id: Ie70aecc93b8acb7c1bbad02e98254b7c50c4c86f
2022-03-10 09:58:39 +00:00
Dmitriy Rabotyagov cb7eaa7ce3 Use uwsgi role for keystone
Instead of having own implementation of uwsgi, use common role.

This allows to reduce maintainable code and ease
providing fixes and features to uwsgi deployment code.

Change-Id: I2dc9c749c37e41959da2403fab7512ab17b859e4
2022-02-09 12:10:18 +02:00
Zuul 3b401d7610 Merge "Use common service setup tasks from a collection rather than in-role" 2022-01-14 10:30:21 +00:00
Jonathan Rosser 0985cfa47d Use common service setup tasks from a collection rather than in-role
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/824115
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/821093/7
Change-Id: I09f9fda3699ece3300a666d0c103da4e022d70e2
2022-01-13 11:26:37 +00:00
Jonathan Rosser a9c453bb64 Refactor use of include_vars
Use a first_found lookup instead of a with_first_found loop so that
the 'paths' parameter can be used.

This ensures that only vars from the role are included, and not vars
from a parent calling role. This can happen when a parent role has
a higher priority vars file available for inclusion than the role
it calls.

Change-Id: I51e629ad111b90877ce3ee3ee0353be687f41d35
2022-01-12 08:30:36 +00:00
Dmitriy Rabotyagov 4e27667dd2 Drop keystone_default_role_name
This variable has no effect and not really used anywhere.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-python_venv_build/+/822998
Change-Id: Ic46ee2a55c464be521ef79a781957633ccdae57b
2021-12-27 13:05:24 +02:00
Dmitriy Rabotyagov eb9a0c6cea Drop Nginx webserver support
There is no reason to support multiple web servers as a proxy for
keystone. Nginx is missing modules to support federation. With it's
removal we simplify code and reduce maintaining efforts needed.

Change-Id: Ib3f90a72dfc8f78cf304b0f130883befdeb09220
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/818674
2021-11-22 10:36:35 +00:00
Dmitriy Rabotyagov 700730dfd9 Use common name for service project description
Since `service` project is shared, it's confusing to have same naming as
for service_catalog. We add variable
`keystone_service_project_description` that will be used specifically
for `service` project description

Change-Id: I33a88f3782d7cf334ad878e57b07d09dcd77842c
2021-04-23 10:40:53 +03:00
Jonathan Rosser 489c169874 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I8721b4fa97b41fb0c92f9eb99b61d31634e9aac6
2021-02-23 18:06:10 +00:00
Zuul abb27c8d5c Merge "Move keystone sp_idp setup to it's own tasks file" 2020-12-04 22:40:03 +00:00
Zuul ae94a86230 Merge "Adding tags to federated openid support using auth_mod_openidc" 2020-12-01 18:02:34 +00:00
siavashsardari fc7d16879e Adding tags to federated openid support using auth_mod_openidc
Closes-Bug: 1906108
Change-Id: I233d79c8eb82553156880dc7e437e4833a306ac0
2020-11-28 17:52:13 +03:30
Jonathan Rosser dd231cc71c Move keystone sp_idp setup to it's own tasks file
This must be done after DB migrations are complete so the
role can be run a second time taking tasks_from this file.

Change-Id: I9f6161d8184d60a765fb72eb53d32664aa298441
2020-10-29 17:49:02 +00:00
Dmitriy Rabotyagov dcc16da7e2 Define condition for the first play host one time
We use the same condition, which defines against what host some "service"
tasks should run against, several times. It's hard to keep it the same
across the role and ansible spending additional resources to evaluate
it each time, so it's simpler and better for the maintenance to set
a boolean variable which will say for all tasks, that we want to run
only against signle host, if they should run or not now.

Change-Id: Iac06d3f02b1c9ee5e3bfbd28043fbb70d8b1d328
2020-09-08 18:20:43 +03:00
Jonathan Rosser 3e0b1ae0af Use the utility host for db setup tasks
Move it to the service setup host (defaults to utility[0]) instead
of the galera[0] host, and use galera_address (defaults to internal VIP)
as the endpoint instead of a local connection on the db host.

Depends-On: https://review.opendev.org/744453
Depends-On: https://review.opendev.org/744881
Change-Id: Ie52799cc2129b6e36b99ee65b237bb04a8edf18f
2020-08-05 10:39:46 +00:00
Georgina 47fe909d54 Federated openid support using auth_mod_openidc
This patch adds support for using mod_auth_openidc instead of shibboleth for
supporting users who have a preference to use oidc for federation. A new
variable called apache_mod is added to keystone_sp allowing the auth library
to be selected. If left undefined shibboleth auth module will continue to be
installed by default maintaining backward compatibility.

This patch does not support simultaneous use of shibboleth and mod_auth_openidc
primarily because shib2 depends on libcurl3 but mod_auth_openidc depends on
libcurl4 which cannot coexist on Ubuntu. This can be resolved when there is a
shib3 package available in a future release of Ubuntu.

Change-Id: I80031f7d3f0fcc2029cd6861dcb6687e8a9f0a2e
2020-01-31 11:28:38 +00:00
Dmitriy Rabotjagov ed1344cfdc service_setup: refactor service setup to a single file
This patch refactors the openstack user/service/endpoints creation to
service_setup.yml which will eventually be managed by
openstack-ansible-tests.

Change-Id: I4f6aa37a5290bd9fcdc732ab502ef66ea3df7ff7
2019-06-28 19:58:54 +01:00
Dmitriy Rabotjagov a2783e4e3f Convert dynamic includes to static imports
When task/role files are included using include_tasks, tags are not
passed to the included tasks. As a result, tags like neutron-config
do not have the intended effect. This patch changes include_tasks
to import_tasks for all cases where dynamic vars or loops are not used
so that tags are properly handled.

Reference -
https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse.html
https://bugs.launchpad.net/openstack-ansible/+bug/1815043

Depends-On: https://review.opendev.org/665244/
Change-Id: I99cf83ef6bf99f23cdbe9d141c6bcf921e81265f
2019-06-28 12:28:51 +03:00
Mohammed Naser 4ea410ffcd db_setup: refactor database setup to a common file
This patch refactors the database creation to db_setup.yml which
will eventually be managed by openstack-ansible-tests.

This also re-orders the mq_setup to be done earlier so these system
level dependencies are ready before service activation.

We have been using run_once only for keystone role. As we have a
keystone group in the inventory, we re replacing run_once for the
conditionals to match the pattern across all the other roles.

Change-Id: Idb5ea861a87fe077f7c716f1157acd8e39257c5b
2019-06-27 12:36:50 +00:00
Bjoern Teipel 3afb763c10 Execute the keystone db setup earlier in the process
As the keystone credential_migrate command can access
the keystone database in cases the os_keystone role
stopped prematurely, the db setup playbook is moved
in front of the `keystone_credential_create.yml` playbook
to prevent and race condition.

Change-Id: I8c89be0ffb4f23b79c0463bff2eb135b9769eb2a
Closed-Bug: #1829438
2019-05-26 06:43:26 +00:00
Mohammed Naser 23917bd69a ldap: include tasks only when configuration is provided
Instead of including the tasks and then skipping them all because
we have no LDAP configuration provided, we avoid including it at
all.

Change-Id: I1480045e9ecc5611fa1b97ae4c4ae3097a42eb9e
2018-12-29 14:57:53 -05:00
Jesse Pretorius 3a6a55b8d0 Ensure that LDAP config is deployed on all keystone hosts
In I66ed21cdcf42d0c2012062c8cf74305fecbec312 the condition meant
for the setup of the domain was mistakenly applied to all tasks
including laying down the template.

This patch moves the conditional which ensures the domain is setup
on the first host to the task in question to ensure that everything
is good and well with the world again.

Change-Id: Icb7c2556306d459534e6791f16c7013d0e9fcaf5
Closes-Bug: #1804827
2018-11-28 11:43:14 +00:00
Mohammed Naser c406a5cb24 Drop UUID token tasks
Fernet is the new standard and UUID tokens were removed in Rocky.

Change-Id: I6a5554dec3abfd148e3e8e3c74274a46239d16b4
2018-11-02 21:46:04 +01:00
Mohammed Naser 97f47677f4 Drop deprecated memcached settings
Change-Id: I25616c5575827425fe42e9265f492fd1fca68735
2018-11-02 21:41:14 +01:00
Zuul 87b26ee54f Merge "Implement LDAP domains using last keystone host" 2018-10-09 17:08:53 +00:00
Andy Smith cdf1c02364 Update messaging configuration
This patch removes  the conditional inclusion of messaging sections
of the service configuration.

The patch conidtionally selects the notifier driver.

Change-Id: If7b8ebe285614e7140b11631d8665bdfd1acece7
2018-09-22 10:12:30 -04:00
Jesse Pretorius 096ed19665 Implement LDAP domains using last keystone host
To ensure that the domains can be created, we only execute
the tasks on the last member of the keystone_all group so
that the load balancer has at least one other host to work
against.

We also replace the OSA keystone module in the task with
the standard Ansible module, and delegate the task to the
service setup host.

Change-Id: I66ed21cdcf42d0c2012062c8cf74305fecbec312
2018-09-18 17:44:48 +01:00
Jesse Pretorius 09ec0890a4 Allow tags to be used for MQ tasks
The use of 'include_tasks' and a loop of variables creates
a situation where a user is unable to use tags to scope the
inclusion of only the MQ tasks when running the playbooks.

The use-case this is important for is when the rabbitmq
containers are destroyed and rebuilt in order to resolve
an issue with them, and the user wishes to quickly recreate
all the vhosts/users.

Ansible's 'include_tasks' is a dynamic inclusion, and dynamic
inclusions are not included when using tags. The nice thing
about dynamic inclusions is that they completely skip all
tasks when the condition does not apply, cutting down deploy
time. However, given the use-case, we should rather take on
the extra deployment time.

This patch changes the dynamic inclusion to a static one,
adds a 'common-mq' tag to cover all MQ implementations,
and re-implements the 'common-rabbitmq' tag for the tasks
that relate to RabbitMQ specifically.

It also implements conditionals for each task set so that
the rpc/notify tasks can be skipped if a vhost/user is not
required for that purpose (eg: swift does not use RPC, and
most roles will not use notifications by default).

Depends-On: https://review.openstack.org/588191
Change-Id: I559062788264ed54b0a21b678f420f8d33d2c663
2018-08-07 14:24:27 +01:00
Jesse Pretorius cf37e8428f Use run_once instead of a group that does not exist
The var keystone_services['keystone-api']['group'] is not defined.
While I have no idea why the task wasn't failing outright due to
that, it was having some rather unwanted side-effects - like running
on all keystone containers.

Given that keystone only has one group, we can just use run_once
instead.

Change-Id: Iad494d503bb04741b3b0ea461d8a9ce1988b24c7
2018-07-24 18:42:55 +01:00
Jesse Pretorius be125ad03b Move MQ vhost/user creation into role
There is no record for why we implement the MQ vhost/user creation
outside of the role in the playbook, when we could do it inside the
role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we implement two new variables:
- keystone_oslomsg_rpc_setup_host
- keystone_oslomsg_notify_setup_host

These are used in the role to allow delegation of the MQ vhost/user
setup for each type to any host, but they default to using the first
member of the applicable oslomsg host group.

We also adjust some of the defaults to automatically inherit existing
vars set in group_vars form the integrated build so that we do not
need to do the wiring in the integrated build's group vars. We still
default them in the role too for independent role usage.

Change-Id: I62fb8fc1390402aaee2057833c510a9827fd5292
2018-07-17 22:05:29 +01:00
Jesse Pretorius 67bf87f330 Execute service setup against a delegated host using Ansible built-in modules
In order to reduce the packages required to pip install on to the hosts,
we allow the service setup to be delegated to a specific host, defaulting
to the deploy host. We also switch as many tasks as possible to using the
built-in Ansible modules which make use of the shade library.

The 'virtualenv' package is now installed appropriately by the openstack_hosts
role, so there's no need to install it any more. The 'httplib2' package is a
legacy Ansible requirement for the get_url/get_uri module which is no longer
needed. The keystone client library is not required any more now that we're
using the upstream modules. As there are no required packages left, the task
to install them is also removed.

With the dependent patches, the openstack_openrc role is now executed once
on the designated host, so it is no longer required as a meta-dependency for
the role.

Depends-On: https://review.openstack.org/579233
Depends-On: https://review.openstack.org/579959
Depends-On: https://review.openstack.org/580156
Change-Id: I8f193d5f6f1f6020b23a4c4eebf3ad537d61e0b7
2018-07-13 19:01:59 +00:00
Markos Chandras 1460a23423 Add support for using distribution packages for OpenStack services
Distributions provide packages for the OpenStack services so we add
support for using these instead of the pip ones.

Depends-On: I5a78e2120e596d36629b4ba978b2b5df76b149b0
Depends-On: Ib64dcbc960df7d369d202ce8cf7bdc29b3ee0e0a
Depends-On: Id9dd2dea146709414ab9ce8d439f1587e6776fd4
Depends-On: I2ba89e25c0010c9a5b515a3d0c9c731b30876e74
Depends-On: I0442b0aa94c3d0882d1118ad0c824d123bd21c88
Change-Id: I26848678dd07a409ef3e159cffb4ba6f0a228ab4
Implements: blueprint openstack-distribution-packages
2018-05-14 13:13:41 +01:00
Major Hayden b7b9db7bb4
Change include: to include_tasks:
This removes warnings in Ansible 2.4+.

The patch also removes "static:" from the playbooks since that
argument is no longer used by Ansible.

Change-Id: I6e5fcbccd4239db73de20e640a3423d1a2333bbe
2018-02-15 10:24:39 -06:00
Jean-Philippe Evrard ab66ca247e Fix memcache caching w/ multiple cache servers
We found a bug recently where either oslo.cache or python-memcached
aren't using the `backend_argument` properly with more than one
memcached server defined. Until we get the memcached client libraries
figured out, `memcache_servers` works just the same for a single
memcached instance and it works defined with a ring of memcached
instances.

The current variable used for the directive memcache_servers was
pointing to localhost servers, that were historically used for
UUID token cache. Only the ``keystone_cache_backend_argument``
has the right list of servers, but the variable's content is
already formatted to match the cache_backend_argument directive,
and therefore needs editing to be used in ``memcache_servers``.

This is far too fragile, and simplification was needed. This
patch moves to a new variable (with a graceful deprecation
cycle), ``keystone_cache_servers``, a simple list containing the
servers.

The variable ``keystone_memcached_max_compare_and_set_retry``
wasn't used and was therefore removed too.

Related-Bug: 1743036
Closes-Bug: 1681695
Co-Authored-By: Lance Bragstad <lbragstad@gmail.com>

Change-Id: I85ebce8b41dd440e1866a08aa1329b3df798c04f
2018-01-29 09:40:12 +00:00
Jesse Pretorius c2c328279b Correct keystone-doctor tag name
Running keystone-doctor should only be done in the
config stage. It makes no sense to run when using
any other tag in isolation.

Change-Id: I782d8a9529ca32ccd413504b13c34cf1f972260d
2018-01-16 12:37:25 +00:00
Zuul ac278ff6ed Merge "Remove keystone_token_driver variable" 2017-12-04 14:47:48 +00:00
Jimmy McCrory 8019b5c190 Remove keystone_token_driver variable
The memcache token driver was removed in Ocata and the only valid option
is sql, which is only used when keystone_token_provider is uuid.

Change-Id: I1db15e2553893b74d3f7d57d4d50ca2052be04e4
2017-11-28 10:35:03 -08:00
Jimmy McCrory 3e4fe9d4ce Remove old fact cleanup tasks
The old fact and fact file were removed in the initial release of Pike
so these tasks shouldn't be necessary in upgrades to or new deployments
of Queens.

Change-Id: Id1e725e21c93f5b0efa734b2cddb6b22423d983a
2017-11-28 09:21:45 -08:00
Jesse Pretorius 84af640aa0 Switch to using Nginx/uWSGI by default
This patch implements the use of uWSGI exclusively,
always with a web server acting as a reverse proxy.
It removes the option of using uWSGI with Apache
and mod_wsgi.

In the case of Keystone being used in a Federated
Service Provider configuration, it will use Apache
as the web server but for all other environments
it will use Nginx instead.

Change-Id: If6e95fc0d3f7d34780db1aed2b8cedca87499934
2017-06-29 16:42:36 +00:00
Jesse Pretorius 2076de5b49 Use run_once instead of inventory scoping
By using run_once we avoid skipped tasks and
instead the tasks are filtered way earlier.
For situations where we absolutely need to
execute something on a particular host, we
delegate to that host instead.

This works better when using limits and is
more efficient.

Change-Id: Id2034562b3e26da56c36dd88badddf1a3b623e20
2017-06-24 17:27:35 +00:00
Jesse Pretorius aad8144bfb Implement serialisable rolling upgrade
The current rolling upgrade implementation
relies on the role to orchestrate the rolling
upgrade. When the role is executed using
playbook serialisation, the db sync contract
is executed before all hosts are upgraded,
potentially resulting in data corruption.

This patch returns the role to the simpler,
best practice model of expecting that the role
is applied to a single host and that the
playbook handles orchestration. This method
can be used with any form of serialisation.

Depends-On: Ie90cdcbf9e73082a2074c8832b7490d188e178af
Change-Id: I5650f16b9a115bd392012b743788057a94d09226
2017-06-19 19:32:45 +00:00