Commit Graph

168 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 59606f0957 Adopt for usage openstack_resources role
With efforts to create a resources in same, unified way,
we convert tempest role to use openstack_resources
for creating and managing openstack resources, like projects, flavors,
networks, images, etc. This should reduce maintenance costs
in case of futher collection updates and unify approach.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/878794
Change-Id: I762ded9b6099ea55e8a19bfb82473b950155eaa4
2024-02-01 10:15:56 +00:00
Dmitriy Rabotyagov ce5c701ab4 Add security rule for octavia healthmanager
Amphora does report back it's status to Octavia healthmanager through
octavia_health_manager_port. This outgoing traffic from Amphora must be
allowed to show LB stats and operational_status.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/896017
Change-Id: Ib6b8547b69949f7af0ba0f7f436b4286d3baccb7
2023-10-05 07:01:19 +00:00
Dmitriy Rabotyagov d94e57f17b 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.

Change-Id: Id8215882ee528d4c3055479e770c7432616649ba
2023-07-17 15:38:00 +02:00
Zuul 048f9d548e Merge "Add TLS support to octavia backends" 2023-05-08 11:51:23 +00:00
Damian Dabrowski ee554649bd Add TLS support to octavia backends
By overriding the variable `octavia_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the octavia 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: Id6c187cad4e444fb83ca1f938bd13bb9b73652b3
2023-04-29 18:43:06 +02:00
Dmitriy Rabotyagov 7c46b9460d Do not limit IP prefix for DHCP rule
In case it's needed to limit access to DHCP servers, rules must be
way more complex then this one, since DHCP uses broadcast.

To avoid complexity, let's just avoid defining remote_ip_prefix
that allows egress traffic for DHCP.

Change-Id: I280c064b4d93bcd78092f02a928d5d6dfb4fda68
2023-04-19 11:50:46 +02:00
Dmitriy Rabotyagov aeebb5bdd4 Adopt info modules 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.

We also add security group rule for dhcp, since in case DHCP is enabled
for the network, it won't be provided in metadata on config-drive anymore.

Change-Id: I861797fdddbf2c82ef7b1409df577475e7424414
2023-04-14 21:20:16 +02:00
Zuul 21e174c25b Merge "Add coordination to octavia" 2022-12-12 15:34:04 +00:00
Dmitriy Rabotyagov aeb1dbf1dd Add coordination to octavia
This also enables usage of amphorav2 when coordination is
available.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-zookeeper/+/867049
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/867052
Change-Id: I1234d36c58da3f6754cda1951ee4cc49f979ae0c
2022-12-08 20:47:00 +00:00
Zuul a148ecf90e Merge "Remove redundant vars line" 2022-12-01 14:54:40 +00:00
Erik Berg 2aed05ce6c Remove redundant vars line
This line snuck in with I5cc0b1bde814abb0a4afe1567b9b23230a57f275
probably to bring it in line with other OSA roles, but should already
be covered by the distribution_major_version line above.

Change-Id: I7f719b3fbd7e89ce96b84c9080049888aeda7ee6
2022-11-25 16:32:35 +00:00
Bjoern Teipel 2f1a3b4db1 Adding octavia_provider_network_mtu-parameter parameter
The `octavia_provider_network_mtu-parameter` defaults to 1500
to not accidentially use `global_physnet_mtu` on deployment with
large MTU settings

Change-Id: I9fa33c5ee76197191f1e66b7a70a4c1c0a5fa394
2022-11-25 16:32:24 +00:00
Dmitriy Rabotyagov c31bbc215c Adopt output structure to new collections version
With commit [1] to collection output structure of networks_info module
has been changed. With that we adpot to the new format.

Return values for keypair have also changed

[1] 9272146cf7

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/864553
Change-Id: Ic22ec379983e43aa5f2b55fd4543b4aa70762354
2022-11-25 11:57:49 +00:00
Dmitriy Rabotyagov 87e78ee34c 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: I8cd6c47c64601089173671652a463ecc291d8ca1
2022-06-17 13:40:17 +00:00
Dmitriy Rabotyagov 757aecd58b Use PKI role for certificate generation
This patch replaces usage of role-specific tasks for managing
certificates to PKI role.

This will allow to unify certificates management with other services
along with simplify management of code.

However, this patch does not contain migration path, which should
be handled separately.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-pki/+/838713
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/843711
Change-Id: I96c6030722661eb7ffdb31ac75e09785871179d5
2022-06-02 08:31:07 +00:00
Dmitriy Rabotyagov f23ca9737d Move installation variables collection to beginning
We need to collect installation method variables as early as we can as
we rely on them later on in the play.

Change-Id: I0fa1b7b25a4b6ced5606018410825e7cf2eac54a
2022-05-28 08:05:04 +02:00
Jonathan Rosser 9d999d0bae Fix condition for deleting old amp images
Change-Id: Ic5c9b809f90dae415ccc72233342ea3242c0b78f
Closes-Bug: 1967270
2022-05-17 16:49:09 +01:00
Zuul 9befdaaeec Merge "Use common service setup tasks from a collection rather than in-role" 2022-01-28 22:24:09 +00:00
Jonathan Rosser 4775014ff9 Use common service setup tasks from a collection rather than in-role
Change-Id: Id2621d0945b0f92d7ca14a0d4db66be5908d1722
2022-01-13 11:25:35 +00:00
Jonathan Rosser d2b3ad5dfd 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: I5cc0b1bde814abb0a4afe1567b9b23230a57f275
2022-01-12 08:17:16 +00:00
OpenStack Proposal Bot e2272ae442 Updated from OpenStack Ansible Tests
Change-Id: I4ed5a1c54dd48df3743596174d353d690cb36b79
2021-12-04 17:41:00 +00:00
Dmitriy Rabotyagov 1310490cbd 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: I9fa37f5f781b8529874daa6deffbd47de75e28fa
2021-12-02 17:05:09 +00:00
Dmitriy Rabotyagov 1a7f8b2a57 Refactor definition of lock path
Change-Id: I5dc391fa69d84e304439b1187dac7f73c2a959e1
2021-12-02 19:04:14 +02:00
Andrew Bonney ffac17201a keypair: copy key to deploy host rather than setup host
The env lookup in the key copying task refers to the deploy host.
If your deploy host user is not root then this task will fail
as this directory does not exist on the remote setup host.

As the original intention appears to have been to copy the result
of the keypair generation to the deploy host, the delegation is
explicitly set to 'localhost'.

Change-Id: I89649503d5918c33f0d1e4200be67be5e0ed8a9e
2021-11-23 10:49:15 +00:00
James Gibson 94e59adeeb Do not log private key
Change-Id: I07587193a0f1f84f1842b64b88a827aa3927cfe6
2021-10-18 15:17:07 +01:00
Dmitriy Rabotyagov 799f003b85 Fix self-signed certs distribution
With multinode Octavia setup self and octavia_generate_certs is
True, role fails with distributing certificates.

While correct approach would be to replace that with PKI role, right now
we just patching current approach, by ensuring that facts are set
for octavia_cert_setup_host so we could reliable gain them.

Change-Id: I0dc2488b9e8e33847c9a2646032ac5f926d09133
Closes-Bug: #1936646
2021-07-20 18:41:15 +03:00
Dmitriy Rabotyagov ad2532d3ca Fix linters
Change-Id: I9f51dbbf51e0a37ab71050ef210f0bfebb90d93e
2021-05-27 13:13:23 +00:00
Zuul 1553dd54ad Merge "Set octavia_amp_image_owner_id by default" 2021-04-26 19:01:11 +00:00
Dmitriy Rabotyagov 9ef492e3b2 Set octavia_amp_image_owner_id by default
This patch sets the octavia_amp_image_owner_id default so that the
Octavia configuration file has amp_image_owner_id populated.
That is important security setting for production deployments that helps
to avoid faked images being used

Change-Id: I22c56f32d7308803e9363f9375d7f6206ccecd41
2021-04-23 13:45:09 +00:00
Dmitriy Rabotyagov 53870c390e Use dynamic import for conditional task imports
When task import condition is false, we need to use include instead
of import, since this allows not running through all tasks and
reduce amount of skipped tasks for such deployments.

Change-Id: I4b51290b94b5b4b54b111d197688f65129a4f5ad
2021-04-23 10:22:23 +03:00
Zuul 7f6c5ed13a Merge "Updated from OpenStack Ansible Tests" 2021-04-22 11:20:02 +00:00
Dmitriy Rabotyagov e7b394dd58 [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.

config_template has been choosen instead of the copy, since it can
properly handle content that has been lookuped.

We make a separate task not to restart service when it's not needed.

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

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/787199
Change-Id: Idd28e5df99bfcf51bad2b785be41221eb0fe5142
2021-04-20 13:37:42 +00:00
OpenStack Proposal Bot b2212c5242 Updated from OpenStack Ansible Tests
Change-Id: I0ba663e67163bbf05d0ef02b244955aaa89794e8
2021-04-19 09:59:28 +00:00
Jonathan Rosser 082ad70c31 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: Ifb8dfacf44ac5537dea5ee4480350e6c93c2450a
2021-03-16 10:38:55 +00:00
Zuul 702acd3b50 Merge "Remove references to unsupported operating systems" 2021-03-10 17:47:58 +00:00
Jonathan Rosser 02051cb53a 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: I4153df38980650c726cc1a79320b22e1e07605cf
2021-03-10 12:16:39 +00:00
James Denton a96fd04d78 Fix typo in task
This patch addresses a typo in the 'Remove private key' task, replacing
looup with lookup.

Change-Id: I20a108a06f9a5edcf1cd3c62123bc28f5e0a979f
2021-03-05 21:06:24 -06:00
Andrew Bonney 44d0a6d398 Add variable to override keypair setup python interpreter
When using a non-standard host for keypair setup (such as a utility
container) it is necessary to set a custom python interpreter
which has access to openstacksdk.

This commit provides a variable to do this in the same style as
used for service setup hosts.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/777601
Change-Id: Ia2056cf287b666d4d3d8d36f06772c5117ca6bf7
2021-02-26 08:24:58 +00:00
Zuul 9250239838 Merge "Trigger service restart on cert change" 2020-12-14 12:41:11 +00:00
Dmitriy Rabotyagov 7659d1ac44 Delegate info gathering to setup host
We are not supposed to have neither openstack client nor clouds.yaml file
in octavia containers and all openstack commands are expected
to be executed on the setup (utility) host.

Change-Id: I93398ef72be3e423c721f92e4bf9077cd5e08d05
2020-12-11 14:02:50 +02:00
Dmitriy Rabotyagov f51a423cae Trigger service restart on cert change
Change-Id: I08c42b27802badd6286ab50dddfb1890ad1274fb
2020-12-08 20:04:53 +02:00
Zuul b94b927aaf Merge "Automatically create and import keypair if it doesn't exist" 2020-12-06 20:59:58 +00:00
Mohammed Naser b20198146e Automatically create and import keypair if it doesn't exist
This will automatically build a keypair if none exists with the
name that's provided and octavia_ssh_enabled is set to true.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/765673
Change-Id: I12b1b7d18c5efd1438585153fa6b2db467758419
2020-12-05 22:48:58 +00:00
Dmitriy Rabotyagov e33331ae0b Ensure that we create Octavia resources only once
Make use of the new _octavia_is_first_play_host while creating resources
to ensure that we try to create them only once.

Change-Id: I0c5d017bd865b09d94139740ef50b712b8753760
2020-12-05 22:36:01 +00:00
Dmitriy Rabotyagov aef1b1723a 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: Icf411ab2df0f6e937ce056b085fee97b89fe8361
2020-12-04 13:43:59 +00:00
OpenStack Proposal Bot 00e7b86135 Updated from OpenStack Ansible Tests
Change-Id: I4b1b1754b79b2ce583a3cf175a6094cb69cc9a44
2020-12-02 13:26:49 +00:00
Jonathan Rosser 9cf165dfce Fix linter errors
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/765134
Change-Id: I9072c5311ab5ff7b76095c20cad802ddf65efedc
2020-12-02 13:10:48 +00:00
Dmitriy Rabotyagov 7fb7f1ba75 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: I0bd9a36b69fb2eb388b0e23ed1fb52644d7ba4bc
2020-08-20 19:30:54 +03:00
OpenStack Proposal Bot 40bc580522 Updated from OpenStack Ansible Tests
Change-Id: I43b6eb84ac20fc5fa75c1db7b6482f8ae6791271
2020-08-12 11:34:46 +00:00
Zuul 9c7e355905 Merge "Updated from OpenStack Ansible Tests" 2020-06-09 07:54:28 +00:00