Commit Graph

22 Commits

Author SHA1 Message Date
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
Dmitriy Rabotyagov 59e879d28a Use config_template as a collection
Since we still use ceph-ansible that has their own implementation of
config_template module it's worth to use mentioned module as a collection
explicitly.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819814
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-tests/+/819897


Change-Id: I9c4caf10192e2a25b1819d47065163ec78356a91
2021-11-30 15:56:09 +00: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
Kevin Carter 56eadbfa76 Set the user argument in the cron module
This change sets the user argument in the cron module which is
required in future versions of ansible when the cron_file argument
is also used.

Filter deprecations for skipped items have also been fixed.

Change-Id: I803cd3c62707880e873662ea86590274b2766d21
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2019-02-22 02:12:23 +00:00
Kevin Carter 7fc3f62c73 Add tasks to remove legacy files
The change removes legacy files which conflict with new services being
deployed during a rolling upgrade. This change adds two tasks to remove
any legacy files should they be found and removes old cleanup handlers
that are no longer in service.

Change-Id: Ie593a80e0e6708c50f7809171fa47c7043a2e136
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2019-01-04 14:53:13 -06:00
Zuul 76e2010ad1 Merge "Avoid looping systemd_service role include" 2018-08-18 01:47:18 +00:00
Kevin Carter 240fe86831
Add systemd tags to include role
There are times when a deployer will need to reconfigure parts of
an environment and having a general purpose tag to run said operation
will be important especicially should the deployer be needing to
reconfigure systemd unit files in a downtime event. This change adds
a general purpose systemd tag where include_role and systemd is found
which will assit operators with day2 operational tasks.

Change-Id: I61cc22441229258b77577fdba9f32597d0889031
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-06-27 19:00:18 -05:00
Kevin Carter 1de3a5e795 correct typo in service setup
Change-Id: I5a01aae32d7c896b2f659eae452e50e657a5284b
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-06-27 18:10:25 -05:00
Jimmy McCrory ae78e9b6cb Avoid looping systemd_service role include
Tasks within the systemd_service role already handle looping over the
'systemd_services' list. The full list can be pre-created as passed as a
var so that the systemd_service role only needs to be included and run
once.

Change-Id: Ia46b5d61546252902b25933e8d5db4808c6de0b9
2018-06-09 12:16:00 -07:00
fpxie 593efa5561 Trivial: Fix the pep8 warning
The yaml should start with "---"

Change-Id: I702cdf43afb6dffb8b7653e8c173f09dc8227bdc
2018-05-08 17:27:57 +08:00
Kevin Carter fbf7ab1c4a Convert role to use a common systemd service role
This removes the systemd service templates and tasks from this role and
leverages a common systemd service role instead. This change removes a
lot of code duplication across all roles all without sacrificing features
or functionality. The intention of this change is to ensure uniformity and
reduce the maintenance burden on the community when sweeping changes are
needed.

In converting this role to use the common systemd_service role a
keystone_service dictionary was created in the defaults main.yml file.
This change follows the pattern of other services.

Change-Id: I65902f2483ef2f18ac2d229c5ebd9d090b6ae040
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-03-27 09:13:24 -05:00
Jesse Pretorius (odyssey4me) 30612195ab Revert "Convert role to use a common systemd init role"
Until all the roles are ready and have this new role in the
ansible-role-requirements, we should not be merging this. We
should also ensure that the integrated a-r-r includes this
role before merging this.

This reverts commit b42eef0dc4.

Change-Id: I8a944db87948ff783028240d3548016a52ab5af4
2018-03-13 11:54:18 +00:00
Kevin Carter b42eef0dc4 Convert role to use a common systemd init role
This removes the systemd service templates and tasks from this role and
leverages a common systemd service role instead. This change removes a
lot of code duplication across all roles all without sacrificing features
or functionality. The intention of this change is to ensure uniformity and
reduce the maintenance burden on the community when sweeping changes are
needed.

In converting this role to use the common systemd_service role a
keystone_service dictionary was created in the defaults main.yml file.
This change follows the pattern of other services.

Change-Id: I70e1f6007d9f88f05ccdc737b210415274580a46
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-03-12 01:45:07 +00: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
Logan V 5e23c765b3 Add external LB management handler hook interface
Based on conversation on an ansible issue[1], I implemented
a LB orchestration role[2] similar to the POC here[3].

This will allow external loadbalancer management roles to hook
into a universal notify listener "Manage LB" to perform before/
after endpoint management actions when the service is being
restarted.

[1]: https://github.com/ansible/ansible/issues/27813
[2]: https://github.com/Logan2211/ansible-haproxy-endpoints
[3]: https://github.com/Logan2211/tmp-ansible-27813

Change-Id: Ide9efbc79e4fd2c761a3ee4f463f501181da1df2
2017-09-16 13:41:28 -05:00
Jimmy McCrory 1b8a085b79 Include init_systemd taskfile once
Instead of providing vars to and including the keystone_init_systemd for
each keystone uwsgi program, loop over those program names within the
tasks.

This also prevents the /etc/tmpfiles.d/keystone.conf file from being
overwritten twice on every run.

Change-Id: I00dc80db7f6672fb26af0ec2301b3a4ea451844d
2017-07-05 17:12:07 -07: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
Jesse Pretorius 94293c86c2 Perform an atomic policy file change
The policy.json file is currently read continually by the
services and is not only read on service start. We therefore
cannot template directly to the file read by the service
(if the service is already running) because the new policies
may not be valid until the service restarts. This is
particularly important during a major upgrade. We therefore
only put the policy file in place after the service restart.

This patch also tidies up the handlers and some of the install
tasks to simplify them and reduce the tasks/code a little.

Change-Id: Ie913e5eb75f3601107b53bab7bda4a02ab1c1024
2017-04-04 10:49:52 +01:00
Jimmy McCrory 04737f5dbd Implement zero downtime upgrades
This patch implements upgrading keystone with zero downtime as the
default installation process. Handlers have been modified to ensure that
the first keystone node is stopped, facilitates the database migrations,
and that it is started and available before restarting any other keystone
nodes. Migrations also now only occur when there is a change within the
installed keystone venv.

This process is documented at
http://docs.openstack.org/developer/keystone/upgrading.html#upgrading-without-downtime

A new test scenario has been added for testing basic upgradability
between releases.

Implements: blueprint upgrade-testing
Change-Id: I0d3cfcb80b64d005d60f4c8445f991855f844796
2016-11-17 08:10:57 -08:00
Marc Gariepy 94114142d6 Fix depreciation "Using bare variables"
add full variable syntax

Change-Id: Ic945ffb3c321a93db14776d5b1892d790c146ca4
2016-09-12 11:51:14 -04:00
Steve Lewis 3b47fc7ef5 Allow Uwsgi configuration overrides
Release note is updated to describe this functionality as well as
general improvments for clarity.

Change-Id: I41838010fc4b6e892bec08035798f096aff5af8f
Related: blueprint keystone-uwsgi
2016-09-01 07:20:12 +01:00
Steve Lewis 9082c793cc Install and configure uWSGI
When an Apache + mod_wsgi configuration is not selected, configure
the two Keystone services with uWSGI service profiles.

Two arbitrary ports are selected for uWSGI to listen on, so that it
may be proxied for by a dedicated web server. This is in preparation
for laying down Nginx in a future patch.

Notify events are updated to restart the Keystone uWSGI services
where Keystone's configuration is modified only. Because federation
concerns will be isolated within the dedicated web server, changes
to federation configuration of Shiboleth do not trigger restarts of
uWSGI. Similarly, SSL certificate changes do not trigger restarts.

Change-Id: I99e16a999c496e68fb25fa2630d9b211c9755ea4
Related: blueprint keystone-uwsgi
2016-08-22 11:04:55 -07:00