Commit Graph

248 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 99c6fb2835 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: I6bbb97cd2f1daac42269a335014eb6cf7f28d24e
2023-07-17 11:45:20 +02:00
Damian Dabrowski 96a262b26b Add TLS support to swift backends
By overriding the variable `swift_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the swift 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: Idb7882775a90ada9bb9e1450168916c73bf8ae4b
2023-04-29 18:43:51 +02:00
Jonathan Rosser d179113919 Fix role as a result of ANSIBLE_INJECT_FACT_VARS=false
ansible_<variable> injection is now disabled by default in
openstack-ansible so the network interface information is now
accessed via ansible_facts['ifname'] rather than
ansible_facts['ansible_ifname'].

This patch also replaces the use of hostvars[inventory_hostname]
with the more correct access via ansible_facts.

Change-Id: Id2c59badb6767d62799ab51504444d935b68b4ce
2023-03-15 17:26:26 +00:00
Erik Berg b899b28880 Remove redundant vars line
This line snuck in with Ib586cfc978f1e5fa05f6ce4add8a337eb433f82f
probably to bring it in line with other OSA roles, but should already
be covered by the distribution_major_version line above.

Change-Id: I78e89768f077b1cf1562b91ae0066620eb226cc7
2022-09-14 14:52:05 +02:00
Dmitriy Rabotyagov 5139ecc233 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: If34e0170ea0e0f7727cfadba982f3c7dae6ae216
2022-06-15 19:52:02 +02:00
Dmitriy Rabotyagov 7b02afd3ce Sync rings to all swift hosts to build_files
In previous patch [1] I wrongly assumed that there's no reason to have
/etc/swift/ring_build_files/
on all hosts. However, there's another logic in the role, that assumes
having these files and verifying md5sum of them.

As an easy bugfix, we're returning sync to ring_build_files until we
change logic. It's also easily backportable.

[1] https://review.opendev.org/c/openstack/openstack-ansible-os_swift/+/765354

Change-Id: If0e686352e08379027508c2939fae00db6ae6cb8
Closes-Bug: #1973045
2022-05-25 16:04:40 +02:00
Zuul 4ca16593d8 Merge "Use common service setup tasks from a collection rather than in-role" 2022-01-13 13:15:00 +00:00
Jonathan Rosser 6202a5500a Use common service setup tasks from a collection rather than in-role
Change-Id: I04531583a731d02a011f72f6d79eced434a66eaa
2022-01-12 18:15:05 +00:00
Zuul 021d286b56 Merge "Refactor use of include_vars" 2022-01-12 14:59:15 +00:00
Jonathan Rosser 3cdb3b1bdd 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: Ib586cfc978f1e5fa05f6ce4add8a337eb433f82f
2022-01-12 08:10:47 +00:00
Damian Dabrowski d830128352 Enable recursion in combine() filter
Ansible's combine() filter needs recursive=True parameter in order to recursively merge nested hashes.

https: //docs.ansible.com/ansible/latest/user_guide/playbooks_filters.html#combining-hashes-dictionaries
Change-Id: I3f3048a7540ac04c749ccb99e20d6ba521175b99
2022-01-11 19:21:50 +01:00
OpenStack Proposal Bot 78ae470524 Updated from OpenStack Ansible Tests
Change-Id: Iedad8d79adc5f4f1df420bbc95cecc0f4244bf2f
2021-12-04 17:41:34 +00:00
Zuul 73c39cd9d6 Merge "Use config_template as a collection" 2021-12-01 19:28:50 +00:00
Dmitriy Rabotyagov 87c7b60d65 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: Iff0959a012d1875e01cd72bee3fb75906ef0983a
2021-11-30 15:17:27 +02:00
Dmitriy Rabotyagov 451678a6fd Refactor definition of lock path
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819300
Depends-On: https://review.opendev.org/c/openstack/ansible-role-systemd_service/+/819298
Change-Id: I6ce09e0e0b83e14fc9386fc4cb49921a21fcabd4
2021-11-30 12:42:47 +02:00
Dmitriy Rabotyagov 2ce00d6c69 Do not collect gnocchi project ID
Ceilometer middleware now accepts also project names,
so it's not required to gain project UUID [1].

We also switching gnocchi project name to `service` for all scenarios
as it's already whitelisted by default [2]

[1] e2bf485044
[2] 082dabb1b7/ceilometermiddleware/swift.py (L158)

Closes-Bug: #1879192
Change-Id: I40d3178d1b3bd1234ac34c6fa1d0d2bcb7160720
2021-05-13 14:39:43 +00:00
Zuul d425a94865 Merge "Updated from OpenStack Ansible Tests" 2021-04-19 15:43:46 +00:00
OpenStack Proposal Bot 155c2dd64f Updated from OpenStack Ansible Tests
Change-Id: I36cecfb184e2740a95558f2e890eb87aa2ef7a2e
2021-04-19 09:59:54 +00:00
Dmitriy Rabotyagov 24bbb72ac9 Revert "split templates to work around configparser bug"
This reverts commit 3e151d97ad.

Reason for revert: Upstream bug has been fixed

Change-Id: I5498030487677523ae71ae2f9a13074ab4552204
Related-Bug: #1872553
Closes-Bug: #1921354
2021-03-25 10:16:08 +00:00
Jonathan Rosser 440a53a4e6 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: Ia3c80d5c0e63ee9c38868c41c9235c51a2498971
2021-03-16 08:20:27 +00:00
Jonathan Rosser a1205ca3a9 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: I30e528914092c5c4df081031045e3d2f2e949bfd
2021-03-10 12:16:40 +00:00
Dmitriy Rabotyagov c2665d032c Use synchronize module for rings distribution
Instead of using rsync which do not respect ssh ports, we fetch rings
to the deploy host and distribute them back to swift hosts

Change-Id: I9f8bc0af9803d2a235b3da956b5618adfe195c00
Closes-Bug: #1904935
2020-12-03 19:31:58 +02:00
Dmitriy Rabotyagov 569c8cfb00 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: I4abb67271bd635c8cde5d4d65451e5fa0091868b
2020-12-02 13:01:15 +00:00
OpenStack Proposal Bot 524d4a8216 Updated from OpenStack Ansible Tests
Change-Id: I4129270e23e25e426a7af45934d360343c46125e
2020-11-10 10:10:31 +00:00
Zuul 96a474667f Merge "Updated from OpenStack Ansible Tests" 2020-10-06 11:20:01 +00:00
Jonathan Rosser b71665074d Fix linter errors
Depends-On: https://review.opendev.org/755585
Change-Id: I497f6c2c963a59eb5ff4101bd74b16fa9eecc4c0
2020-10-02 08:26:59 +01:00
OpenStack Proposal Bot 7d257fd602 Updated from OpenStack Ansible Tests
Change-Id: I19b942ff79abf4a35a93ff8de7d94ebdb764e840
2020-10-01 14:32:10 +00:00
Dmitriy Rabotyagov 5c1209e0ec Delegate gnocchi retrievement task to setup host
Since we don't have required libraries on the swift hosts,
we should delegate openstack collection tasks to the setup host.

Change-Id: Ib8a8875c1a355b1f67cdc2bc4f1d028fa7ae3496
2020-08-26 15:50:25 +03:00
OpenStack Proposal Bot 9924d36dfa Updated from OpenStack Ansible Tests
Change-Id: I5ae8285aaaca73ca9dacff18dcf31e4754b5742c
2020-08-12 11:35:23 +00:00
Zuul 9df5725865 Merge "Updated from OpenStack Ansible Tests" 2020-06-09 07:41:39 +00:00
OpenStack Proposal Bot 7644aaf055 Updated from OpenStack Ansible Tests
Change-Id: Ic7cfa8d6facd3bd0db5f7c08a293c3645a035fa1
2020-06-08 19:57:07 +00:00
Jonathan Rosser 144e357563 Use ansible openstack collection
Depends-On: https://review.opendev.org/718431
Depends-On: https://review.opendev.org/718362
Change-Id: I36ae46e16f70c764ddbefb2c05d6cbb0d767d46b
2020-05-20 14:02:44 +01:00
Zuul 51938eaf6a Merge "Replace usage of deprecated os_*_facts ansible modules" 2020-05-15 07:34:47 +00:00
Jonathan Rosser ac880484ba 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: I08ff502e23ff928884ae704b0e226379f17b4faf
2020-05-14 07:37:18 +01:00
Matthew Thode 3e151d97ad
split templates to work around configparser bug
Move the percent character to the template from the string to allow
setting either % or %% as needed to work around the bug linked below.
This requires each service 'family' to have two versions of it's config
file.

Bug: https://bugs.launchpad.net/swift/+bug/1872553

Change-Id: I68f276224c51d5682d77123eae697767fadf9b19
Signed-off-by: Matthew Thode <mthode@mthode.org>
2020-04-16 13:49:01 -05:00
Dmitriy Rabotyagov 34419fd92b Fix distro installs
Ubuntu distro packages change /etc/swift/ owner to root, which makes
swift_rings.py fail with Permission denied.
So we shouldt run swift_rings.py as root user for distro deployments.

Change-Id: I3eeec29de43a3fb80bafef104ac87348aca4853e
2020-04-14 21:12:17 +03:00
Dmitriy Rabotyagov 5037204fee Pass _service_region to service_setup tasks
This was missing so the default RegionOne would always be used.

Change-Id: I04a5972df758b4fb3ad0e504ba1b33e2d917f427
2019-12-08 07:03:41 +02:00
Kanishk Godha f52352a493 Replace Module
Modified the file to use the os_project module instead
of the keystone module

Change-Id: I4db1dfa9057b3ce48775f5519a843edbc5716d3e
2019-09-20 10:40:06 +00:00
Jonathan Rosser 119bc32454 Allow venv python interpreter to be overridden
Change-Id: I7d5cfc8f07b92a71150a189eb352b8a02051c0c9
2019-09-09 09:31:44 +01:00
OpenStack Proposal Bot 7754168dbb Updated from OpenStack Ansible Tests
Change-Id: I42bb1c7d4590ed88e2840f4b4a818d1e6763a6f2
2019-09-04 15:18:58 +00:00
OpenStack Proposal Bot 75bd155b57 Updated from OpenStack Ansible Tests
Change-Id: I75e3a290be42fc69bfd167a8a0ca30908f4fba3a
2019-08-20 03:06:55 +00:00
Zuul e90a9a4d8b Merge "service_setup: refactor service setup to a single file" 2019-07-29 22:20:22 +00:00
Dmitriy Rabotyagov 87304fb827 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.
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: Ibeb38f022174dc5b2ee449b7f5303bbc194fb238
2019-07-19 15:16:10 +03:00
Dmitriy Rabotyagov d0fac1b559 Use systemd-journald instead of log files
This patch aims to migrate service from usage of regular syslog files
to journald.
By this we mean dropping rsyslog client installation. log_address is set
by default to /dev/log, which is served by journald.

Change-Id: I6dd0d77004394bb1ad674b53538b0679b056bb0f
2019-07-19 15:10:49 +03:00
Dmitriy Rabotyagov 273895816b 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: I7553c3ef4d7620844f614da79b2cb1086eda23cb
2019-07-17 19:26:04 +03:00
OpenStack Proposal Bot afe60eb16f Updated from OpenStack Ansible Tests
Change-Id: Ide4deb696c3742073850586b2d83e18ec947ac61
2019-06-18 18:16:40 +00:00
OpenStack Proposal Bot 08f9e7823d Updated from OpenStack Ansible Tests
Change-Id: I9354f0cc362580874b7fcb873c744e83e05aa7d2
2019-06-11 22:19:24 +00:00
Zuul ca05c1e857 Merge "Updated from OpenStack Ansible Tests" 2019-05-21 00:14:49 +00:00
Dmitriy Rabotjagov a7acff5975 Drop private argument for include/import role
Since ansible 2.8 dropped private argument is not supported anymore:
https://github.com/ansible/ansible/issues/45038

Change-Id: I35ba5a711725e65e3d67782b0b29cd678cc43d49
2019-05-17 11:36:03 +03:00
OpenStack Proposal Bot b3b9f7bf3b Updated from OpenStack Ansible Tests
Change-Id: If095d6a935bb670b620aaa352f0c2979dcdba439
2019-05-09 11:35:32 +00:00