Commit Graph

155 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov ceca11a27d 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/+/911377
Change-Id: I658e6218cf59650d0abfa491ebaa6d3c37db2993
2024-03-05 20:40:12 +00:00
Jonathan Rosser 1ec5a2e8c4 Add tag for creating magnum resources
This cannot currently be run without running other parts of the role.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/896017
Change-Id: Ia3c4bb2a0d61a1b741b9b5bc77b62acf8b79f00b
2023-11-08 08:48:33 +00:00
Damian Dabrowski 9709e102df Wait for magnum endpoint before creating cluster templates
Magnum playbook flushes handlers(that cause service restart) and then
it starts creating magnum resources right away.

In some cases(for ex. magnum tls upgrade job), magnum haproxy endpoint
is down before playbook flushes handlers. It means that after flushing
them, haproxy healthchecks need some time to rise magnum endpoint.
In this case, there is a high chance that playbook will try to connect
to magnum endpoint before haproxy marks it as alive.

To solve this issue, this patch implements an extra task to ensure
that magnum endpoint is reachable before playbook tries to reach it.

This patch also fixing linters issue in an example playbook to resolve
circular dependency.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/896017
Change-Id: I36cf9f4b71daa107e27e966ebe25816c7bffa42a
2023-11-08 08:48:08 +00:00
Dmitriy Rabotyagov bfbf0db8fb 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: I68c3d98de3a0a4444c0c1ea0cc528901613a63bd
2023-07-14 18:02:08 +02:00
Damian Dabrowski c9fb7e4f46 Add TLS support to magnum backends
By overriding the variable `magnum_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the magnum 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: Id3413eb53ab2948de61b2e67f85c5a19fc670434
2023-05-16 15:04:39 +00:00
Dmitriy Rabotyagov 3591a729dd Rename floating IP option for coe_cluster_template
With new collection version, this option was renamed.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/881566
Change-Id: I072ef995d14b2301d308ef1af958e28154f882c4
2023-05-12 22:06:06 +00:00
Erik Berg 751b55d01e Remove redundant vars line
This line came with Idbf1b737a11b0bb2460989b2881395ee87a90429
for the "multi-distro framework", but should since be covered
by the distribution_major_version line above, introduced at
a later date.

Change-Id: Ib4ddea834cc5bbe043a32118d8fff0571ac816bc
2022-09-14 13:29:49 +02:00
Danny Nelhams 719280a83e Fixed dest typo in config_template
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/846145
Change-Id: I986113491800f9432ebcc8ea82b8f4362671c5d2
2022-06-18 07:42:47 +00:00
Dmitriy Rabotyagov 4c4c70a376 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
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/846142
Change-Id: Ic77d8645613d265997895b6742b334336ce00ec1
2022-06-17 08:29:33 +00:00
Zuul 4f4049170e Merge "Run service_setup only once" 2022-01-14 16:02:26 +00:00
Zuul 8616f479d2 Merge "Use common service setup tasks from a collection rather than in-role" 2022-01-13 13:16:08 +00:00
Dmitriy Rabotyagov 407e3d74b2 Run service_setup only once
There's no reason to run service_setup for each magnum container
as it's enough to be done once. So we're including role only
when it's first host in the play.

Change-Id: I8f282d4a284e0de395081251f6622df0c1daeeb3
2022-01-13 13:10:21 +02:00
Jonathan Rosser 2604f534a8 Use common service setup tasks from a collection rather than in-role
Change-Id: Ie906228e6613d8453835ae8c52c3c4dce1adfae2
2022-01-12 17:53:51 +00:00
Jonathan Rosser b7b1f44a03 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: I0aa7af76b19d143128113557fec3ab928280faab
2022-01-12 08:29:41 +00:00
OpenStack Proposal Bot 927f7cbb83 Updated from OpenStack Ansible Tests
Change-Id: I47eccbac8b9d88cc0f0c36b489914b0b2fb709d6
2021-12-04 17:40:19 +00:00
Dmitriy Rabotyagov 368580e00d 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: Ib1752953c8afaa4d56d4b0951d8346be4379536f
2021-11-30 15:17:22 +02:00
Zuul c89938d358 Merge "[goal] Deprecate the JSON formatted policy file" 2021-04-21 11:29:31 +00:00
Dmitriy Rabotyagov af92c6ae79 [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

Change-Id: Ie246d803b5c4e490af76351a595aedcf2fcff62b
2021-04-20 16:49:08 +00:00
OpenStack Proposal Bot 97e83a07ca Updated from OpenStack Ansible Tests
Change-Id: I4574b83e344c6b1da735cda07ecbde617152be3c
2021-04-19 09:58:31 +00:00
Zuul cbb7a67326 Merge "Use ansible_facts[] instead of fact variables" 2021-03-20 01:29:35 +00:00
Jonathan Rosser f75dc9c797 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: Ic7b58cc4e4840d342f48b7c9ec90953d5dce4ab5
2021-03-16 08:05:20 +00:00
Dmitriy Rabotyagov 7790c54080 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.

Depends-On: Ic31fd78bb5ad9cd484f44e63ba02db7424a500d5
Change-Id: I0dae6805ac5883f75bed138d652d0dd0bd1594fb
2021-03-11 22:30:32 +00:00
Dmitriy Rabotyagov c87dcebfe0 Use global service variables
Instead of overriding each service separatelly it might make
sense for deployers to define some higher level variable that
will be used first or fallback to default variable.

Change-Id: I295b6f99422ba81d14a04129939648d0722dd584
2021-01-08 17:18:17 +02:00
OpenStack Proposal Bot af54ecc08b Updated from OpenStack Ansible Tests
Change-Id: Ice4664143eed522048a3b1daeb12717a17deeb67
2020-11-29 22:05:25 +00:00
Jonathan Rosser 7c90bb1729 Fix linter errors
We also fix magnum config in order to work with bind-to-mgmt,
until [1] got merged

[1] https://review.opendev.org/733408

Depends-On: https://review.opendev.org/763049
Change-Id: Iaa7a0aae186eaf080b7be3949821ed9e90c52456
2020-11-17 17:20:42 +00:00
OpenStack Proposal Bot 7256fbafdc Updated from OpenStack Ansible Tests
Change-Id: Id4eff04c6ce67cc43785d33c900f4e48722488d1
2020-09-24 16:56:36 +00:00
Zuul 8c51051b0f Merge "Define condition for the first play host one time" 2020-09-23 17:42:11 +00:00
Zuul 5cdf4bb9f8 Merge "Only install devel packages during python_venv_build" 2020-09-21 16:07:41 +00:00
Zuul 61c8f1a6a6 Merge "Simplify service creation" 2020-09-21 12:22:13 +00:00
Jonathan Rosser 1aa18f67e8 Only install devel packages during python_venv_build
These packages should not be directly installed onto the target host
as they are only required at wheel build time.

Change-Id: I2d6358bde5d00700e11ce7eb1fb1724e02f999e4
2020-09-21 11:25:14 +00:00
Dmitriy Rabotyagov cfd671ef5d 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: Idd1c6c9ad7f5165b8e12e156ab6398b28c5e799a
2020-09-16 10:22:47 +00:00
Dmitriy Rabotyagov c65a617174 Simplify service creation
Since ansible feature has been implemented and we can reference
openstack domain with it's name but not only id,
we can simplify service creation task.

Change-Id: Ia74faf6b686c6a1f59d9e920aa91b36bd1b27019
2020-09-14 14:41:03 +03:00
Dmitriy Rabotyagov 200dcd89aa Add deployment of keystone_auth_default_policy
In case `keystone-auth-enabled` is true in k8s template, magnum requires
keystone_auth_default_policy file to be present.
At this point we suggest creating corresponding roles by deployers
manually, since it's not enabled by default or used widely.

Change-Id: I77bfd3026e3168d7504ef3dc5214cfe706c525dd
2020-09-14 14:37:23 +03:00
Zuul 6d880c3fdd Merge "Use the utility host for db setup tasks" 2020-08-26 18:08:05 +00:00
Dmitriy Rabotyagov 7b66dea55a 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/747981
Change-Id: Ia60bdb33889a3d0c2e080dab9badbdd777fcdbeb
2020-08-25 15:35:35 +00:00
Zuul 6188087fba Merge "Updated from OpenStack Ansible Tests" 2020-06-09 08:03:43 +00:00
OpenStack Proposal Bot 7b9b2f9626 Updated from OpenStack Ansible Tests
Change-Id: I0a154961d2307fd02ca916af8c89dd62ac4e6725
2020-06-08 19:55:23 +00:00
Jonathan Rosser 14f9868a23 Use ansible openstack collection
Depends-On: https://review.opendev.org/718431
Depends-On: https://review.opendev.org/718362
Change-Id: Ibf5fa0c7a00d18beee61a6a9077d85537691567d
2020-05-20 20:33:00 +00:00
Dmitriy Rabotyagov 51fe8d4897 Add ability to create COE template
Creation of cluster templates is pretty routine operation wich
might be easily automated with ansible.

Depends-On: https://review.opendev.org/710245
Change-Id: Ib7f99714502ba94604b8f0bb997c77a768af6d1d
2020-02-28 10:23:44 +02:00
Mohammed Naser 143f6c16cf Download Magnum images once
We delegate the post-installation steps to localhost, but we do not
limit to running them once so we download them multiple times :(

Change-Id: I0f0e97ac8ec625f26bf1cf6437457f3733cd5e8c
2020-01-28 15:10:38 +01:00
Ralf Haferkamp 0fec35b44e Fix service_user creation
The os_user module in newer versions of ansible (2.8.5) rejects to
create users where the default project is not existing in the user's
domain. So create the magnum_trustee_domain_admin user with an empty
default project.

For details see: https://github.com/ansible/ansible/pull/59876

Change-Id: I8e005df0de39bf2f4790c06ed1b311ff0caa070a
2019-09-26 20:13:30 +00:00
Jonathan Rosser b676262d9c Allow venv python interpreter to be overridden
Change-Id: I0620dfee3777113d0ed7b646a18986e09cc1529f
2019-09-11 18:00:07 +01:00
Zuul 9ae000319e Merge "Start using uWSGI role" 2019-09-06 15:53:27 +00:00
Dmitriy Rabotyagov 027224854d Start using uWSGI role
Move service to use uWSGI role instead of iternal task for uwsgi
deployment. This aims to ease the maintenance of uWSGI and speedup
metal deployments as the same uwsgi environment will be used
across all services.

Change-Id: I354ff3e81f4f4586aa2d52e1dcd8359c16a9e39a
2019-09-05 14:11:14 +03:00
OpenStack Proposal Bot 7d640c62ec Updated from OpenStack Ansible Tests
Change-Id: If8d079e3969111f581c196f708ccab0174e7886e
2019-09-04 15:15:20 +00:00
Dmitriy Rabotyagov d36311c6e4 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: Iec426e8161da2e92f075d87bae3f4a28a05dd2b1
2019-08-07 18:50:29 +03:00
Zuul 12cde7ae35 Merge "Use systemd-journald instead of log files" 2019-07-18 07:37:05 +00:00
Dmitriy Rabotyagov bef0ec0ce2 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

Change-Id: I3a1fe5e065b9dbb218acdab06c1d1dac38ea7e64
2019-07-17 16:19:27 +03:00
Dmitriy Rabotyagov 2fe6aaa322 Use systemd-journald instead of log files
This patch aims to migrate service from usage of regular syslog files
to journald. We also disable uwsgi logging, since it dublicates
requests that are logged by service itself.

Change-Id: I8be07495dd84f085de6d4409f2efd67a8359d82e
2019-07-17 16:12:34 +03:00
OpenStack Proposal Bot 51db15c152 Updated from OpenStack Ansible Tests
Change-Id: Icfa2e123c4e2d8cab23239a30b52a15a0a75d36b
2019-07-16 14:52:01 +00:00