Commit Graph

181 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov 408f794e2a Grant proper privileges to admin user for testing purposes
At the moment we assign `heat_stack_owner` to the `admin` user in a
`service` project, which leads to a completely unwanted behaviour, since
`admin` user does not have any other privileges to the `service` project
rather then `heat_stack_owner`.

Instead we should be granting privileges to the bootstrapped project
for the admin user.

This fixes unclarity and potential issues users might face in horizon
by switching to the `service` project, where they have no permissions.

Change-Id: I95faa779bf62524fafd09576aa7ae27de029bb57
2024-03-14 11:58:19 +00:00
Dmitriy Rabotyagov 94e5817391 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: I68a3041edf0b0eb891fbe1e40081f779fc40c21d
2023-07-14 15:21:35 +02:00
Damian Dabrowski 0964f87c69 Add TLS support to heat backends
By overriding the variable `heat_backend_ssl: True` HTTPS will
be enabled, disabling HTTP support on the heat 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: Ifb904adc61f1461e646c3fce0bd062f526b8e446
2023-04-29 18:37:10 +02:00
Erik Berg 211a527a7f Remove redundant vars line
This line snuck in with If9f874305d0470f267bc8bbc74e879ec11860cac
probably to bring it in line with other OSA roles, but should already
be covered by the distribution_major_version line above.

Change-Id: I48b67f163ea5cf5d6fb37a9a8ae5678aa8574fe7
2022-09-14 13:17:57 +02:00
Dmitriy Rabotyagov 1d39c7ab44 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: Ib5d15aaf56112a776e2b9abb2396f9ea4f4fe319
2022-06-15 18:23:20 +02:00
Zuul 81121a5370 Merge "Use common service setup tasks from a collection rather than in-role" 2022-01-13 13:12:19 +00:00
Jonathan Rosser a6d2dc414c Use common service setup tasks from a collection rather than in-role
Change-Id: I53c6d9cc38f5765c88c8eb2606cfe38a17ed8325
2022-01-12 17:50:38 +00:00
Jonathan Rosser 33d6e012db 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: If9f874305d0470f267bc8bbc74e879ec11860cac
2022-01-12 08:33:29 +00:00
OpenStack Proposal Bot 03b5e7c28c Updated from OpenStack Ansible Tests
Change-Id: I3648715d2b95ed8c3ef524941c94d35fe1b81556
2021-12-04 17:40:03 +00:00
Dmitriy Rabotyagov 9686b31c82 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: Ie4e45d41b070c5abbc3b80305aeee89470ee739a
2021-11-30 15:17:18 +02:00
Zuul d76dbaff51 Merge "[goal] Deprecate the JSON formatted policy file" 2021-06-23 20:36:37 +00:00
Damian Dabrowski f1e08dab1b Fix _service_users for multi-domain deployments
Deployment can fail if an user with name defined in _service_users exists in more than 1 domain(Multiple matches found for <username>). To avoid these errors we need to explicitly define domain in _service_users

Change-Id: I55c5c8b9806188f246af9f2e89afe4a2d1b38b3c
2021-06-04 12:15:43 +02:00
OpenStack Proposal Bot 24e947ba49 Updated from OpenStack Ansible Tests
Change-Id: Ib9d44f22cca32d501b401ce848493441ee87164b
2021-04-19 09:57:51 +00:00
Dmitriy Rabotyagov 5a8cd45701 [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/heat/+/766861
Change-Id: I3d1c51a025f2c94cb02f7e0882472344dcb97fa4
2021-03-24 12:12:10 +00:00
Jonathan Rosser 2dc4709537 Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I70349036d45f44b7d951224fa2d27fe417301d87
2021-03-16 08:04:15 +00:00
Jonathan Rosser 22b5051802 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: I1a9fd61f8690621144fc26eec762527d6ffcc33c
2021-03-10 12:16:38 +00:00
OpenStack Proposal Bot 1019c1a398 Updated from OpenStack Ansible Tests
Change-Id: I5e84896583ae22d2cf548595446d588590ff4268
2020-10-19 09:20:00 +00:00
Dmitriy Rabotyagov 4b23b72b4a Trigger uwsgi restart
When we were migrating service to uwsgi usage, we clean forgot to
trigger uwsgi restart on service config change.

Change-Id: I9c470d5555e5d2841018be3112c1b82e75e60021
2020-10-08 17:32:55 +03:00
OpenStack Proposal Bot 99c960fd53 Updated from OpenStack Ansible Tests
Change-Id: I89d614301bffb4afeec73cdf7e50cc358df5b459
2020-10-01 14:30:18 +00:00
Dmitriy Rabotyagov 70cb248d3a Revert use of _heat_first_play_host for post install tasks
run_once can't be replaced with such condition since config files should
be put against all groups, and not only api one.

Change-Id: Iee0f0efa7e8c8f5ee14e6052db9d2407c4880680
2020-09-22 10:28:41 +03:00
Dmitriy Rabotyagov b11f705ea3 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: Iea777412d3bf7dc76b8073c51b4cdcb029573f66
2020-09-16 11:53:56 +00:00
Zuul 736334abd2 Merge "Use the utility host for db setup tasks" 2020-08-24 09:02:15 +00:00
Dmitriy Rabotyagov cec8761c66 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: Ic51187c5f063d7d8b932e76d0f82c062061a3962
2020-08-21 14:39:28 +00:00
Zuul c9b4e32e5f Merge "Updated from OpenStack Ansible Tests" 2020-08-12 16:14:43 +00:00
OpenStack Proposal Bot 309f97b62d Updated from OpenStack Ansible Tests
Change-Id: Ic23f4be11be0632f340c7e182c639307d01e9540
2020-08-12 11:33:04 +00:00
Dmitriy Rabotyagov 2878de0578 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: I1485160f330fa289e02874e9286cf7a27009ea76
2020-08-06 20:28:29 +00:00
Dmitriy Rabotyagov 780dc2eb59 Fix _project_domain for heat
Change-Id: I8b93233e30136f54221234e12c8b5eeffc1ba5a6
Closes-Bug: #1890635
2020-08-06 19:53:48 +00:00
OpenStack Proposal Bot 87a369485c Updated from OpenStack Ansible Tests
Change-Id: I0988b802a65cbcf9a4bb3fcdc9bd244583ad73c1
2020-06-08 19:54:53 +00:00
OpenStack Proposal Bot 591f2b4bbb Updated from OpenStack Ansible Tests
Change-Id: Ief9f9c4b3f7d896358ea6102c6980d15d64bb65c
2019-10-08 13:25:54 +00:00
Dmitriy Rabotyagov 7858df55c3 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.

Depends-On: https://review.opendev.org/681610
Change-Id: I88665890fc2e117d1ed9892b976bba2aa06dd504
2019-09-18 19:50:15 +00:00
Jonathan Rosser 512c3c9ff1 Allow venv python interpreter to be overridden
Change-Id: I977f156bbf6a62bb433565a01010cfda0d483cbe
2019-09-11 17:54:42 +01:00
Zuul 60ba769826 Merge "Start using uWSGI role" 2019-09-06 15:50:37 +00:00
Dmitriy Rabotyagov 83d643947f 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: If539762d5de0730ce97d8f8aaefb4c096d850902
2019-09-04 19:41:09 +03:00
OpenStack Proposal Bot 2b7002e8ca Updated from OpenStack Ansible Tests
Change-Id: Ife7537490972f3f9ff05fc4b44595a023ffb7e4c
2019-09-04 15:14:13 +00:00
Dmitriy Rabotyagov cd66c12e7f 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.

Also heat_init_systemd is finally dropped, as it is not used anymore.

Reference -
https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse.html
https://bugs.launchpad.net/openstack-ansible/+bug/1815043

Change-Id: I321979a96acc04a25b5287fb2f61fa03cda66e81
2019-08-01 14:09:45 +03:00
Dmitriy Rabotyagov 88c29bb665 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: I9f8a7f92d644775bd673dbade73fbaa1268712d5
2019-07-17 00:23:33 +03:00
OpenStack Proposal Bot 1776a9d374 Updated from OpenStack Ansible Tests
Change-Id: I0e1d3dbea09e615837a8b39ff033ec7ec69a1b29
2019-06-18 18:15:47 +00:00
OpenStack Proposal Bot cd11c7e93c Updated from OpenStack Ansible Tests
Change-Id: I135dbb0f8d18659c5414177cd444cf3d7d37a966
2019-06-11 22:17:50 +00:00
Guilherme Steinmüller d759c870f6 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: Ife10587bb82cd56c3d537c510f35962a9b8276d9
2019-06-03 19:49:44 +00:00
OpenStack Proposal Bot ed8abbbbb1 Updated from OpenStack Ansible Tests
Change-Id: I689df32ceaf09e4bfd100ae4f4a6c0315955095d
2019-05-09 11:34:36 +00:00
OpenStack Proposal Bot f4f86a2fbc Updated from OpenStack Ansible Tests
Change-Id: Ibd9e9454d35e98b26afc4648240075adf22c10c9
2019-04-17 19:11:37 +00:00
OpenStack Proposal Bot 5d0f42f709 Updated from OpenStack Ansible Tests
Change-Id: I8b7a32ece0590218cfb538049950feaed1989565
2019-04-17 07:25:24 +00:00
OpenStack Proposal Bot fd62dbbb5f Updated from OpenStack Ansible Tests
Change-Id: I72d5751f3ded57b1282254f2ef1c7683420ecf56
2019-04-13 20:22:19 +00:00
OpenStack Proposal Bot 6bdf9c9960 Updated from OpenStack Ansible Tests
Change-Id: I345e9cb8a2ed8cca2eda64841ac63c66cc668a5d
2019-04-01 13:18:47 +00:00
Mohammed Naser 5de0b700b5 Update role for new source build process
The variables heat_developer_mode and heat_venv_download
no longer carry any meaning. This review changes heat 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 installation 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.

Depends-On: https://review.openstack.org/648551
Change-Id: I4b66febefc77176a112486b0e9ee9b46e16cff05
2019-03-28 23:54:21 +00:00
Kevin Carter f393f21d3b 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: I0fe59819c7e2594188e93d7cc482abff74495b8e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2019-02-22 00:32:41 +00:00
Guilherme Steinmüller d94ca42619 Add heat_user_pip_packages variable
With this variable, users would be able to extend
the list of pip packages in case of needing an
extra pip package.

Currently if we need an extra pip package we need
to override the existing list.

Change-Id: I9aea9f42c476ff3c6f2355a0afb21be4eea57b69
2019-02-20 17:48:23 +00:00
Zuul 828fd505de Merge "venv: use inventory_hostname instead of ansible_hostname" 2019-02-12 23:24:03 +00:00
Guilherme Steinmüller 2c0323c9ef Add heat user to heat domain admin role
Currently in rocky, due to the fact we replaced
the ansible keystone plugin, the heat user is
not being added in the heat domain, which causes
issues for example to magnum to create stacks and
nodes. This role is stated in the heat openstack
installation docs.

This patch aims to implemente the role assignment

Depends-On: I2fbb2465f9b4765a87011dfb2c2f65bd27e7b2c9 

Change-Id: Ib65a12990059f8125caff279622d89643bcc2fd5
2019-02-12 02:38:41 +00:00
Heba Naser 694708ef9f 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: I22eb68694063b4e0567c5700d8a9d8b93ffae6a2
2019-02-06 09:57:49 -05:00