Commit Graph

130 Commits

Author SHA1 Message Date
Andrew Bonney 151043d7f0 Fix designate upgrades when internal RPC version changes
When upgrading from 2023.1 to 2023.2 in a HA environment,
the Designate pool update command failed as it ran using
an upgraded client, but made RPC calls against instances
which had not been upgraded yet.

This commit moves the pool update to the last play host
in order to ensure that in an upgrade situation, all
virtualenvs have been upgraded first to ensure no client/
server version conflicts.

Change-Id: I93af581696de0913710592f9033545b87547b78a
2024-04-02 08:17:15 +01:00
Dmitriy Rabotyagov d41ac57fe4 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: I6ca96cd72600e59c2e6616880d7cd9155a26c5bb
2023-07-14 12:56:46 +00:00
Damian Dabrowski 3464966868 Add TLS support to designate backends
By overriding the variable `designate_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the designate backend api.

The ansible-role-pki is used to generate the required TLS
certificates if this functionality is enabled.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/879085
Change-Id: Id5c18a7305c744a2b0252f62debb1b5654e4abd7
2023-04-29 18:36:33 +02:00
Dmitriy Rabotyagov 94b04bffe1 Adopt project_info fetch to collection 2.0
With ansible-collection version 2.0 return of project_info module
has changed. We need to adopt usage of module return to the new format.

Change-Id: I90c80baef9ec57b08cb586c2b884aac852a74419
2023-04-10 18:28:18 +02:00
Dmitriy Rabotyagov aab80f8524 Fix race condition during designate setup
Right now when designate is being installed for the first time, role
tries to run pool update before database is being populated. That
happens due to flushing handlers early as db sync requires service
to run with relevant config. This regression has been implemented
with [1].

To resolve it we move copy of pools.yaml after handlers are flushed
first time and after db sync process.
We also move service_setup before first flush as otherwise service
won't be able to start properly anyway.

There's no need to copy pools.yaml to each designate container and run
pool update multiple times - it's enough to do that once.

[1] 87eb5d46cd

Change-Id: I3b3aaf48f990e229ba5ca3ec5127780fa70228d0
2022-11-25 18:20:06 +01:00
Erik Berg f5936a486c Remove redundant vars line
This line snuck in with I299aa04729790d0c194032a36c7b50a3306990c1
probably to bring it in line with other OSA roles, but should already
be covered by the distribution_major_version line above.

Change-Id: I420c2e5620c607168402a88eee7192e69f5fdf97
2022-09-14 13:10:52 +02:00
Dmitriy Rabotyagov 50ee7fe8a9 Support service tokens
Implement support for service_tokens. For that we convert
role_name to be a list along with renaming corresponding variable.

Additionally service_type is defined now for keystone_authtoken which
enables to validate tokens with restricted access rules

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/845690
Change-Id: I7eafa6b989a2fd726369b3959b5e6ba024b82274
2022-06-15 18:19:27 +02:00
Zuul 731fb73388 Merge "Refactor use of include_vars" 2022-02-11 21:31:28 +00:00
Jonathan Rosser 859de5f930 Use common service setup tasks from a collection rather than in-role
Change-Id: I58a0edd3890ac7ef3d3aaed342bf44cb4a169a35
2022-01-12 18:35:53 +00:00
Jonathan Rosser 2d2b7d7b50 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: I299aa04729790d0c194032a36c7b50a3306990c1
2022-01-12 08:36:35 +00:00
OpenStack Proposal Bot fcf02aaffe Updated from OpenStack Ansible Tests
Change-Id: I16bf8339d4aa79427a4a863bc9bf3b19851210cc
2021-12-04 17:39:53 +00:00
Dmitriy Rabotyagov 4d4366ed16 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



Change-Id: I276113c0a46dcb6766237189c661644b69453a7a
2021-11-30 15:17:16 +02:00
OpenStack Proposal Bot 0e1b577934 Updated from OpenStack Ansible Tests
Change-Id: I608348fae892b547f7043021c1460642c37e1831
2021-04-19 09:57:32 +00:00
Zuul e9177110fa Merge "[goal] Deprecate the JSON formatted policy file" 2021-04-06 12:33:11 +00:00
Dmitriy Rabotyagov f51605df76 [goal] Deprecate the JSON formatted policy file
As per the community goal of migrating the policy file
the format from JSON to YAML[1], we need to replace policy.json to
policy.yaml and remove deprecated policy.json.

[1]https://governance.openstack.org/tc/goals/selected/wallaby/migrate-policy-format-from-json-to-yaml.html

Change-Id: I71d9f02360e10fe45d1e956e3a59326e8ba1263a
2021-03-30 16:42:38 +00:00
Dmitriy Rabotyagov 87eb5d46cd Update pool when pools.yaml is changed
Move designate-mange pool update command to handlers
since we need to run it only when pools.yaml is changed.
We also don't need to restart designate service, when pools.yaml is
updated.

Change-Id: I7f3d6bd777ce5a6e0f3372f0f6e29cb5499d5419
2021-03-19 17:03:34 +00:00
Jonathan Rosser 1b6f3273fb Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I40b37608f65ec57b26fb10528da63ad54f9a1496
2021-03-16 08:02:26 +00:00
Jonathan Rosser e0afffd98c Remove references to unsupported operating systems
All references to Gentoo, SUSE, Debian stretch and Centos-7  are removed.
Conditional tasks, ternary operators and variables are simplified where possible
OS specific variables files are generalised where possible

Change-Id: I96a9757621eab69e7bc16a2e31ab28d0eb8a23be
2021-03-10 12:16:38 +00:00
Dmitriy Rabotyagov fb3b350f58 Use new openstack.cloud collection names
os_ prefixed module names are deprecated for a while and will be removed
Current usage generates a warning for users.

Change-Id: I22af42d7668615cd4f76366abdc3972da4846a6d
2021-02-16 21:38:37 +02:00
OpenStack Proposal Bot a84cf43c74 Updated from OpenStack Ansible Tests
Change-Id: Ief96a00267e52d644c6f411c177de72fe085cbbb
2020-10-19 09:19:51 +00:00
OpenStack Proposal Bot a06d75b7ea Updated from OpenStack Ansible Tests
Change-Id: I9d99593b03913a09fe20082c39d3bbd044f07acc
2020-10-01 14:30:01 +00:00
Zuul 9591efc5cb Merge "Define condition for the first play host one time" 2020-09-21 08:56:29 +00:00
Dmitriy Rabotyagov 59621889cc 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: I63e9f830f086763f3dcb90cd54dbdebcfc679b1c
2020-09-16 11:55:26 +00:00
Dmitriy Rabotyagov 05de02c9b7 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.

Change-Id: Ia09330b907387f70db5f553f83d5a23a4f7f8a98
2020-08-20 17:34:11 +03:00
OpenStack Proposal Bot 32031f6c13 Updated from OpenStack Ansible Tests
Change-Id: I8b3265e1a9a1cd93f6473dd38179a87cbdbbdc47
2020-08-14 11:46:03 +00:00
root d16298c411 Add CentOS-8 support
referencing ansible_python_interpreter to main.yml file to fix it.

Depends-On: https://review.opendev.org/710849
Change-Id: I196c263c7fb017a1d8386e8e9fb339af70165c51
2020-08-12 07:27:35 +00:00
Zuul dc0a9588b1 Merge "Updated from OpenStack Ansible Tests" 2020-06-17 23:56:06 +00:00
OpenStack Proposal Bot 4eeb53bad9 Updated from OpenStack Ansible Tests
Change-Id: I98cf44744f46bea1392d8f35b19c97c3be51bbfe
2020-06-08 19:54:32 +00:00
Jonathan Rosser 8c7231532d Use ansible openstack collection
Depends-On: https://review.opendev.org/718431
Depends-On: https://review.opendev.org/718362
Change-Id: Id42bc08dd5de945f6f6267091c77f2c7539e41eb
2020-05-20 14:06:33 +01:00
Jonathan Rosser 76b6051a86 Replace usage of deprecated os_*_facts ansible modules
These are changed to os_*_info modules which return their data
not as facts but via ansible registered variables.

Change-Id: I38a10f8c648c350a709b900a6aabaf446550600e
2020-05-14 09:26:23 +00:00
Jonathan Rosser 7ebd966ec6 Allow venv python interpreter to be overridden
Change-Id: I68b4c56e7c3ebf2f2520e63b22e86268e8c062e5
2019-09-11 18:54:22 +00:00
OpenStack Proposal Bot b366705ff3 Updated from OpenStack Ansible Tests
Change-Id: I6fa4aeab66390bf1a291949848c71b2e3aec330a
2019-09-04 15:13:25 +00:00
Dmitriy Rabotyagov af1cd0ac8f 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 swift-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

Change-Id: I230a6b46d91b71881c91b1f4f93d03676a3a0afa
2019-08-07 18:55:14 +03:00
Dmitriy Rabotyagov 0ac2ef7a6a 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: Id9e94865467a9076ee15a9caebcc2cc97847d079
2019-08-01 17:29:33 +03:00
OpenStack Proposal Bot edbf74abe6 Updated from OpenStack Ansible Tests
Change-Id: I601bf4a68c1491253dfc90f36dca247ab092fa39
2019-06-18 18:15:39 +00:00
OpenStack Proposal Bot e161e28b84 Updated from OpenStack Ansible Tests
Change-Id: Ia0226bfdd85d5f316ae3ee1b16de921838357cd7
2019-06-11 22:17:35 +00:00
Jimmy McCrory a4de037651 Fix distro installs on Ubuntu
Install the python3-designate package and rely on the OSA provided
service configs instead of installing each of the individual designate
service packages. The 'Mask any conflicting units' task can also be
removed since the installation of unwanted services will no longer be an
issue.

Change-Id: I40a596803df656f5e6f75996660fe9ace685c2ed
2019-06-06 15:38:35 -07:00
Guilherme Steinmüller 7e5a171d2e 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.

Change-Id: I51d103ef054a5018b5c2e3dd2c1f34cd1a4f9cc2
2019-06-04 02:19:26 +00:00
OpenStack Proposal Bot 5bf11d06fd Updated from OpenStack Ansible Tests
Change-Id: Ie0f2e2fe0d53b0f7bf491f68b31e9f1832e83aa5
2019-05-09 11:34:27 +00:00
OpenStack Proposal Bot 5ffd9144a2 Updated from OpenStack Ansible Tests
Change-Id: I2d99c5b0819555a17abec95b3f1729ecaf01b6d2
2019-04-17 19:11:31 +00:00
OpenStack Proposal Bot 9c5a8534bf Updated from OpenStack Ansible Tests
Change-Id: I3fe829c177ddc956087fbc6d476df7ff8a2ff4cf
2019-04-17 07:25:18 +00:00
OpenStack Proposal Bot 55f4c50983 Updated from OpenStack Ansible Tests
Change-Id: I8f4e412ef3ec1c120ab6d82a53cdf8825c65b848
2019-04-13 20:22:05 +00:00
OpenStack Proposal Bot 8617c16d87 Updated from OpenStack Ansible Tests
Change-Id: I0b79cf953cbcfdb13f6bd812548811622b366ff7
2019-04-12 08:49:55 +00:00
Jonathan Rosser ca45d5117c Fix designate venv build constraints
These were missing entirely from the venv build, and typo in defaults.

Change-Id: Icc254aedb41b4090500c20103383681a17852171
2019-04-11 14:30:02 +01:00
Mohammed Naser ddc9c0fdf9 Update role for new source build process
The variables barbican_developer_mode and barbican_venv_download
no longer carry any meaning. This review changes glance to
do the equivalent of what developer_mode was all the time,
meaning that it always builds the venv and never requires
the repo server, but it will use a repo server when available.

As part of this, we move the source build out of its own file
because it's now a single task to include the venv build role.
This is just to make it easier to follow the code.

Change-Id: Ifd7d4d0a314834165141019dbacb82bbc1c4176d
2019-03-26 19:17:48 -04:00
Kevin Carter 98ef1fa530 Remove the private option from include_role
The private option on include role was never implemented and
will no longer be developed. This change removes the option
so ansible no longer raises a deprecation warning.

Change-Id: Idbdf22251060dcd7e9852551a895b928ad415ce6
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2019-02-22 00:39:36 +00:00
Mohammed Naser 4435615a43 venv: use inventory_hostname instead of ansible_hostname
It is possible that the hostname of the system does not match the
one in the inventory which means that the delegate_to or the
comparision to inventory_hostname will fail in the tasks later.

Change-Id: I9ec04c1ceb1036fcf2b830a372d6fb927b3040ac
2019-01-31 17:03:24 -05:00
Mohammed Naser 3c9e9beaf2 Only implement policy.json if an override is configured
With changes inside Designate merged about policy-incode, there
is no longer a default policy.json file in the venv, so we
need to change how we implement the file, and should only do
so if there is a config override configured for it.

If there is no policy override configured, but a policy.json
file is present, then it's likely left over from a previous
build. To ensure that we do not carry legacy configuration
files which override the policy-in-code we remove the legacy
file. This is done on restart to ensure that the policy still
applies until the code is updated.

Change-Id: Iea4d2029723529444b93d7deca58824e592d0e0f
2019-01-31 15:24:27 -05:00
Zuul ef51958940 Merge "Enable overriding the service setup host python interpreter" 2019-01-22 14:12:33 +00:00
Damian Cikowski 8facdee36c Set project that owns managed resources
This change allow deployer to set project that will be owner of managed
resources like auto-created records and zones.
The owner is specified using project name and defaults to service
tenant.

Depends-On: https://review.openstack.org/628979
Change-Id: I620be82d890aaa547decc59f81f55345f7177900
2019-01-08 23:29:44 +01:00