Commit Graph

106 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
Andrew Bonney 3c476298a8 Add missing magnum octavia client configuration
Omitting this config causes Magnum to use the public endpoint
by default.

Change-Id: I41122f166806b30e07067c539c182f98c6919134
2023-12-14 10:35:07 +00:00
Dmitriy Rabotyagov 1b7360802f Add quorum queues support for service
This change implements and enables by default quorum support
for rabbitmq as well as providing default variables to globally tune
it's behaviour.

In order to ensure upgrade path and ability to switch back to HA queues
we change vhost names with removing leading `/`, as enabling quorum
requires to remove exchange which is tricky thing to do with running
services.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/896017
Change-Id: Ic5b425564e494502722106f94e406dc2ed69dcde
2023-11-08 08:48:39 +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 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
Dmitriy Rabotyagov 5e1780b809 Control amount of conductor workers
As of today we didn't manage amount of magnum-conductors that equal to
amount of CPU on host. So things can go off regarding CPU and memory
consumption. For better control on resources we add variable to control
conductor workers.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/846151
Change-Id: I3eedd74717b3b621b4e0b6ae4a8df4ee6f1eb739
2022-06-17 08:24:58 +00:00
Damian Dabrowski 03990bb4a0 Database connection pooling improvements
- Implemented new variable ``connection_recycle_time`` responsible for SQLAlchemy's connection recycling
- Set new default values for db pooling variables which are inherited from the global ones.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/819424
Change-Id: I305c6f4fb0b20e6e916fff7c912e8664733a902e
2021-12-03 11:41:01 +01:00
Dmitriy Rabotyagov db5ac1dc35 Refactor galera_use_ssl behaviour
With PKI role in place in most cases you don't need to explicitly
provide path to the CA file because PKI role ensures that CA is trusted
by the system overall. In the meanwhile in PyMySQL [1] you must either
provide CA file or cert/key or enable verify.

Since current behaviour is to provide path to the custom CA we expect
certificate being trusted overall. Thus we enable cert verification when
galera_use_ssl is True.

[1] 78f0cf99e5/pymysql/connections.py (L267)

Change-Id: Ib9d0b810bf5aef475021f886dd19348548a7ec9a
2021-09-21 15:38:59 +03:00
Jonathan Rosser e5e064e055 Add variables for rabbitmq ssl configuration
Change-Id: I84a8cbf8f1bbfa40fbf107f346c4564905244ecd
2021-05-17 14:56:46 +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
Jonathan Rosser 443b51bfc8 Switch default virtualenv to python3
Depends-On: Ic31fd78bb5ad9cd484f44e63ba02db7424a500d5
Change-Id: Ide1c0da26415a3e5c71889a708957c63106e47f7
2021-03-11 22:29:52 +00:00
Jonathan Rosser 7b611058d5 Move magnum pip packages from constraints to requirements
This is necessary to use the new pip resolver

Change-Id: I44085391d469010ed941d08d4ec1debd0ddd55e5
2021-01-25 10:07:41 +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
Dmitriy Rabotyagov 2ba7654fe6 Fix magnum_service_user_domain_name
Change-Id: Ia92310ea825d2cafc9956fbd2acfc0137c9191aa
Related-Bug: #1648491
2020-12-03 14:34:40 +02:00
Zuul 88dc27e24d Merge "Use openstack_service_*uri_proto vars by default" 2020-11-30 15:32:44 +00:00
Dmitriy Rabotyagov 6c4016afbe Reduce number of processes on small systems
Even the most modest 4C/8T system would run with the maximum 16 processes
due to the calculation being VCPU*2.

We devide amount of CPUs to number of threads for hyperthreaded CPUs

Change-Id: I23fa200a017c290b342bfd4594cbffa5efd24566
2020-11-29 22:05:31 +00:00
Adrien Cunin 8da1816b7c Use openstack_service_*uri_proto vars by default
Change-Id: Ib1d5788af53556196e89c754975e329da90970a0
2020-11-29 22:05:18 +00: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
Dmitriy Rabotyagov c65816fc06 Cleanup after repo_build and pip_install retirement
Depends-On: https://review.opendev.org/727749
Change-Id: I523f601aee23d26623078491d1ebec444bba814f
2020-05-20 20:31:08 +00:00
Guilherme Steinmüller d5be854362 Refactor memcached_servers
This patch aims to add a prefix for memcached_server
on each role to give the ability for deployers to
override the location of memcached cluster. I.e users
wants to create a single memcached cluster with k8s
for each service.

We also add pymemcache based on [1]

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

Change-Id: If7bbef32ae1102ff586bd765052d984896bde43d
2020-03-16 16:18:50 +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
Jonathan Rosser 2e118940f1 Fix magnum-api wsgi name
This should not be a hardcoded path and certainly not to python2.7


Closes-Bug: 1858034
Change-Id: Id22502d0fbe33b3d07ad738f39aff8367ef52074
2020-01-03 11:48:55 +00:00
Dmitriy Rabotyagov 6c7bf4652a Replace git.openstack.org with opendev.org
This patch replaces git.openstack.org with opendev.org as redirection
from old path was enabled.
Also we change upper constraints url due to [1]

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I837aefc043d91212b21ca3cb3d9851e3a33b358e
2019-11-14 16:51:20 +02:00
Jonathan Rosser fb5cb835b9 Add global override for service bind address
Change-Id: Ic253fa49597351961c938696307964027a70b559
2019-09-19 13:43:03 +01:00
Guilherme Steinmüller eb251d3fad Update fedora-atomic image to version 29 following upstream repo
d5c6945c93 (diff-cd9ddf33b5bab44d58ff1f7e5ccc0c53R16)

Change-Id: I84f5f2b6cbc4355f8b52aceef4e64c17d5e26a36
2019-09-13 20:46:07 +00:00
Jonathan Rosser b676262d9c Allow venv python interpreter to be overridden
Change-Id: I0620dfee3777113d0ed7b646a18986e09cc1529f
2019-09-11 18:00:07 +01: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
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
Guilherme Steinmüller 64615992b9 Update role for new source build process
The variables magum_developer_mode and magnum_venv_download
no longer carry any meaning. This review changes magnum 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: I89177a702cd6f31f4b26b4d8fa260fd38a895ba0
2019-03-27 02:22:11 +00:00
mb 3c4952376d Add ability to set keystone region_name in magnum.conf
Adding the ability to set region_name in keystone_authtoken section of
magnum.conf in the same wqy as for other services. Defaulting to
magnum_service_region.

Change-Id: I7f7e184c5eec6489505a6492ed2786a27bae29ab
Closes-Bug: #1819380
2019-03-10 23:36:10 +01:00
Zuul b020a631b9 Merge "Update fedora-atomic image to version 27 following upstream docs" 2019-02-27 12:09:50 +00:00
Guilherme Steinmüller da833077e0 Add magnum_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: Iaa94479ea780aa0b79b880327b807223f66874d6
2019-02-22 16:34:22 +00:00
Jonathan Rosser 81309c6662 Update fedora-atomic image to version 27 following upstream docs
See https://docs.openstack.org/magnum/latest/install/launch-instance.html

Change-Id: I84e3590cb95a405d91db80238394e0a4d441271b
2019-02-19 15:41:48 +00:00
Jesse Pretorius 844c493891 Enable overriding the service setup host python interpreter
In order to enable the service setup host python interpreter to
be changed easily, we make it a variable. This will be useful
when someone sets the service setup host to be the utility
container, because we'll be able to set this var by default.

Change-Id: Ib5245e5f13c8de41a6ca020be53781195903498d
2018-11-30 16:21:29 +00:00
Zuul 1769545d04 Merge "Update messaging notification configuration" 2018-10-17 03:05:24 +00:00
Mohammed Naser fbdcdbd19c Add multi-region support for Magnum
Magnum currently tries to hit the first region that it finds
so it can fail to deploy clusters in multi-region deployments
non-determinsitically.

This patch makes sure that the region can be configured and
it defaults to the same one that Magnum is deployed on.

Change-Id: I136ba0caead3a5afe11152aaed7bae94af8906b4
2018-10-09 06:33:18 +02:00
ZhijunWei 9508e525ed Update messaging notification configuration
This patch add the conditional inclusion of the notification
section of the service configuration. This ensures that oslo.messaging
notifications use the correct transport for deployments that have
separate rpc and notify messaging backends. For example, if the
transport_url is not provided in the notification section of the
service configuration, the transport_url specified in the default
section will be used instead.

This patch conditionally selects the notifier driver. The noop
driver will be selected when notification publishing is disabled.
The messagingv2 driver is selected when notification publishing is
enabled.

Change-Id: Iaadc0d852c003e653e00b4736ddc28f16ddfec5a
Closes-Bug: #1794320
2018-09-27 02:15:30 +00:00
Jesse Pretorius 0739e62162 Remove mysql-python
The mysql-python package is no longer maintained. We are using
pymysql instead, so this package does not need to be installed.

Depends-On: https://review.openstack.org/602927
Change-Id: I194cea7b270702206b7c3661523804e351798e81
2018-09-17 10:53:39 +00:00
Jesse Pretorius 611fa2e762 Use a common python build/install role
In order to radically simplify how we prepare the service
venvs, we use a common role to do the wheel builds and the
venv preparation. This makes the process far simpler to
understand, because the role does its own building and
installing. It also reduces the code maintenance burden,
because instead of duplicating the build processes in the
repo_build role and the service role - we only have it all
done in a single place.

We also change the role venv tag var to use the integrated
build's common venv tag so that we can remove the role's
venv tag in group_vars in the integrated build. This reduces
memory consumption and also reduces the duplication.

This is by no means the final stop in the simplification
process, but it is a step forward. The will be work to follow
which:

1. Replaces 'developer mode' with an equivalent mechanism
   that uses the common role and is simpler to understand.
   We will also simplify the provisioning of pip install
   arguments when doing this.
2. Simplifies the installation of optional pip packages.
   Right now it's more complicated than it needs to be due
   to us needing to keep the py_pkgs plugin working in the
   integrated build.
3. Deduplicates the distro package installs. Right now the
   role installs the distro packages twice - just before
   building the venv, and during the python_venv_build role
   execution.

Depends-On: https://review.openstack.org/598957
Change-Id: Ib822c0a9c9a06d4505a898c48f1126974c643f2b
Implements: blueprint python-build-install-simplification
Signed-off-by: Jesse Pretorius <jesse.pretorius@rackspace.co.uk>
2018-09-03 12:02:15 +00:00
Zuul edfe84bc9d Merge "Setup oslo.messaging extra packages for optional drivers" 2018-08-09 07:00:35 +00:00
Jesse Pretorius 5678153fa9 Execute service setup against a delegated host using Ansible built-in modules
In order to reduce the packages required to pip install on to the hosts,
we allow the service setup to be delegated to a specific host, defaulting
to the deploy host. We also switch as many tasks as possible to using the
built-in Ansible modules which make use of the shade library.

The 'virtualenv' package is now installed appropriately by the openstack_hosts
role, so there's no need to install it any more. The 'httplib2' package is a
legacy Ansible requirement for the get_url/get_uri module which is no longer
needed. The keystone/glance/cinder client libraries are not required any more
now that we're using the upstream modules. As there are no required packages
left, the task to install them is also removed.

Depends-On: https://review.openstack.org/582359
Depends-On: https://review.openstack.org/582579
Depends-On: https://review.openstack.org/582957
Depends-On: https://review.openstack.org/583430
Change-Id: Id3b9d57981006d3f7abbb94af5f72214db3da6cb
2018-08-08 10:36:16 +00:00
Zuul e539056dc1 Merge "Add packages required for osprofiler" 2018-07-31 17:02:23 +00:00
Jesse Pretorius ed2595a0d4 Default MQ RPC/Notify credentials/vhosts to match
When the RPC and Notify service are the same, the credentials
must match - otherwise the tasks to create the user/password
will overwrite with each other.

If the two clusters are different, then the matching credentials
and vhost will not be a problem. However, if the deployer really
wishes to make sure they're different, then the vars can be
overridden.

Also, to ensure that the SSL value is consistently set in the
conf file, we apply the bool filter. We also use the 'notify'
SSL setting as the messaging system for Notifications is more
likely to remain rabbitmq in our default deployment with qrouterd
becoming the default for RPC messaging.

Change-Id: If49da70b8b9768d48c09b8fcfca734c9531f1181
2018-07-30 12:50:07 +01:00
Andy Smith 76e16f9ff8 Setup oslo.messaging extra packages for optional drivers
Change-Id: Idd1866b0527e8594b8e06df66a8d170cf40a317a
2018-07-27 12:53:37 -04:00
Jesse Pretorius 5eae47074a Move MQ vhost/user creation into role
There is no record for why we implement the MQ vhost/user creation
outside of the role in the playbook, when we could do it inside the
role.

Implementing it inside the role allows us to reduce the quantity of
group_vars duplicated from the role, and allows us to better document
the required variables in the role. The delegation can still be done
as it is done in the playbook too.

In this patch we implement two new variables:
- magnum_oslomsg_rpc_setup_host
- magnum_oslomsg_notify_setup_host

These are used in the role to allow delegation of the MQ vhost/user
setup for each type to any host, but they default to using the first
member of the applicable oslomsg host group.

We also adjust some of the defaults to automatically inherit existing
vars set in group_vars form the integrated build so that we do not
need to do the wiring in the integrated build's group vars. We still
default them in the role too for independent role usage.

Depends-On: https://review.openstack.org/583430
Change-Id: I70c2a340d617bdc603d983fecf4d064975aef780
2018-07-20 11:53:11 +00:00
Andy Smith e587d74d29 Update to use oslo.messaging service for RPC and Notify
This introduces oslo.messaging variables that define the RPC and
Notify transports for the OpenStack services. These parameters replace
the rabbitmq values and aure used to generate the messaging
transport_url for the service. The association of the messaging
backend server to the oslo.messaging services will then be transparent
to the magnum service.

This patch:
* Add oslo.messaging variables for RPC and Notify to defaults
* Add transport_url generation to conf template
* Add oslo.messaging to tests inventory
* Update tests
* Update examples
* Add release note

Change-Id: Ib44af3b1d153742975351a321d65c8812a994370
2018-07-20 11:53:00 +00:00