Commit Graph

48 Commits

Author SHA1 Message Date
Dmitriy Rabotyagov aa69a6fe5c Make glance_additional_stores work nicely with multi-store
While we assume that glance_additional_stores can be list of mappings
for multistore glance support, bunch of other logic in role still treats
it as simple list and make verifications against it. So in case one
dares to override variable according to our suggestion, they also need
to override bunch of other things.

We change defaults for `glance_available_stores` variable and always
define it as a multistore list of mappings.

Then we introduce a variable `glance_available_store_types` that is a
list of types for each of configured storage.

Logic of how storages are defined in glance config is also changed now.
Storages won't be defined if there's no "default" record for them in
glance_available_stores.

For each new store that deployer wants to provision, they now can pass
`config` key for glance stores, rather then use config overrides.

Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/901041
Change-Id: I1416e0f6e3ed79abd10f468b52fc712d35a61bd2
2023-11-27 11:36:33 +00:00
Dmitriy Rabotyagov c2428ab8da Add glance_bin to rootwrap defenition
At the moment rootwrap can not find privsep-helper binary as it's located
in glance bin directory, which is inside the virtual environemnt.
In order to properly use privsep we must define venv bin directory in
allowed exec_dirs of rootwrap.

This also introduces new variable  `glance_rootwrap_conf_overrides`
that allows to manage some extra overrides for rootwrap if needed.

Closes-Bug: #2043503
Change-Id: I4ee3fc33fdbeb50fc7b102bf62d6134f83c5925f
2023-11-14 18:50:18 +01:00
Dmitriy Rabotyagov 289ce991c4 Use correct default for glance_mount_points
Back in Yoga we've refactored way of mounting remote filesystems
for glance while keeping backwards compatibiltiy [1]

However, there was a copy/paste error made while defining
glance_mount_points with old format of glance_nfs_client.

[1] https://review.opendev.org/c/openstack/openstack-ansible-os_glance/+/837550

Change-Id: I755822089bf406f532a718db5b84df553cbc2084
Closes-Bug: #2032771
2023-11-06 08:33:09 +00:00
Dmitriy Rabotyagov 8e36b59745 Split lines to not exceed 160 characters limit
Change-Id: I05029ad2a2a8e351ecc7236cb779a045c3a44403
2023-09-18 15:38:17 +02:00
Zuul 4e0ca28c67 Merge "Add quorum support for glance" 2023-09-04 08:19:43 +00:00
Dmitriy Rabotyagov cf448d95c5 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: Ifb3711157e77d5c917d05e4a384dead2abe72a7c
2023-07-14 14:56:14 +02:00
Dmitriy Rabotyagov a5d922e4ed Add quorum support for glance
This change implements and enables by default quorum support
for rabbitmq as well as providing default variables to globally tune
it's behaviour.

Depends-On: https://review.opendev.org/c/openstack/oslo.messaging/+/873630
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/873618
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible-plugins/+/875399
Change-Id: I87a5a1bb5028706e1768f53f53c4567cbdff64c9
2023-07-06 14:04:59 +02:00
Damian Dabrowski fafd49959e Move _glance_available_stores to defaults
We need to define _glance_available_stores outside glance role to
use it in haproxy service definition.

It's a good idea to make `_glance_available_stores` public by moving it
out of role variables to role defaults beforehand.

Change-Id: Ieb10a0e5c9faf72c6bea4c45f7e216469971a1f3
2023-04-20 20:51:58 +02:00
Zuul 1d8cb0dbd9 Merge "Use systemd_mount native syntax for mounts" 2022-04-25 22:47:45 +00:00
Dmitriy Rabotyagov 8c425490e7 Do not deploy api-paste for CentOS distro deployment
RDO stopped shipping api-paste file for glance, so we can't provide it
anymore. To avoid maintaining it for this usecase we simply stop
provisioning as well for this path.

Change-Id: I01440a4df4f4a1f7bb96d2bd672812c35963cdb3
2022-04-12 16:18:11 +02:00
Dmitriy Rabotyagov 887a59256e Use systemd_mount native syntax for mounts
Currently we have bunch of limitations related to the format
of ``glance_nfs_client``. While systemd_mount role is flexible enough
to allow mount cephfs or s3fs, variable format has weird assumptions
that we want to change for better flexability.

Since keys of variable are changing, new name for it was picked to
reflect purpose of the variable better.

Change-Id: Ic0d91a3a873b4253255beac79becf01b4a304695
2022-04-12 12:56:38 +02:00
Dmitriy Rabotyagov 091f33c8da Define _glance_available_stores in variables
Glance available stores is usefull outsie of the template as well, so we
move defining variable from Jinja template only to ansible variables.

Depends-On: https://review.opendev.org/c/openstack/ansible-role-python_venv_build/+/822998
Change-Id: I312fdede3c3bffa0c897588d33fcc5d5d6988ccd
2021-12-27 16:53:47 +00:00
Jonathan Rosser 7f2614ce4e 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: Id4f43e11bb02733b90f8bdf49e86f7a37656c68f
2021-03-10 12:16:38 +00:00
Jonathan Rosser ae6c72997c Use ansible_facts[] instead of fact variables
See https://github.com/ansible/ansible/issues/73654

Change-Id: I03b51e2cf342b8b1434503f2bd0f4b30dcd5258e
2021-02-23 18:05:14 +00:00
Dmitriy Rabotyagov 1c2f04b028 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: Ida1d88be3ae8f52b6c467563a9b99a7f7d44c4c0
2020-09-16 11:54:27 +00:00
Dmitriy Rabotyagov 5245eafd14 Add Centos-8 support
Change-Id: I33297d21fbd8618e167e1f332ec2c838c5086b0e
2020-07-07 04:30:44 +00:00
Dmitriy Rabotyagov ed736fd783 Cleanup glance-registry service
Glance-registry service has been removed in V cycle with [1]

We do all necessary cleanup to fully remove service deployment.

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

Change-Id: I0b2e2e39040fd0daef04724f94a39f2d11e4d105
2020-07-07 07:30:17 +03:00
Dmitriy Rabotyagov 0f7971c9cb Fix glance policy.json deployment
Glance has dropped default policy.json [1] which
was used by "smart sources". We are fixing this by setting content
to empty dict, that way the only content deployed will be the one
provided by overrides, so that won't change current behaviour.
Additionally `glance_policy_content` has been introduced, which
eventually is going to replace `glance_policy_overrides` in the future.

[1] dd1975bd3e

Change-Id: I3f365684542b390ea02c08ab56f76a447f65a814
2020-03-10 14:27:33 +02:00
Dmitriy Rabotyagov 4b2724b44b 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.

Depends-On: https://review.opendev.org/678025/
Change-Id: I6f129940e55130c289d94138171cee54dbd28fc1
2019-09-04 15:32:08 +03:00
Dmitriy Rabotyagov 002d2a91ea 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: I12c5a117d9ca508f24a36a477d2d71c36e6c8c96
2019-07-16 16:09:28 +03:00
Dirk Mueller b041c1df8b Update distro package names for openSUSE Leap 15.1
Change-Id: I174bba199acd8c3486b15e4232ea42782bf9bbd1
2019-06-28 14:58:29 +02:00
Jimmy McCrory e45c741f5b Fix distro installs on Ubuntu
Beginning in the Stein release, Ubuntu distro packages are now using
Python3. This requires additionally installing and using the uwsgi
python3 plugin.

Install the 'python3-glance' package instead of 'glance-api'. glance-api
provides a service config file that conflicts with the one OSA provides.

Change-Id: I24e7a05372b6b1831529c620d3346889d5505f09
2019-06-04 10:20:04 -07:00
Mohammed Naser d0acb95b9f [redhat] Update variables to be version agnostic
The RedHat-based operating systems such as CentOS have a pretty
stable list of packages, therefore, we don't need to pin it by
version and we can instead move to a much more generic redhat.yml
which will support a bigger range of systems.

Change-Id: I87d30e020977ea2f01592bb60b54d02292818d49
2019-05-10 00:10:38 -04:00
Mohammed Naser 60dd55d6b7 debian: add support
This patch adds support for this role to be able to deploy on
Debian Stretch.

Change-Id: I3d14906c7ce5e4722fa4b59c4aa6949405f40898
Needed-By: I9a92b73c419a0dc1cca40dacfef75de61a61db94
2019-04-05 22:54:05 -04:00
Kevin Carter 9748e6b154
Cleanup files and templates using smart sources
The files and templates we carry are almost always in a state of
maintenance. The upstream services are maintaining these files and
there's really no reason we need to carry duplicate copies of them. This
change removes all of the files we expect to get from the upstream
service. while the focus of this change is to remove configuration file
maintenance burdens it also allows the role to execute faster.

  * Source installs have the configuration files within the venv at
    "<<VENV_PATH>>/etc/<<SERVICE_NAME>>". The role will now link the
    default configuration path to this directory. When the service is
    upgraded the link will move to the new venv path.
  * Distro installs package all of the required configuration files.

To maintain our current capabilities to override configuration the
role will fetch files from the disk whenever an override is provided and
then push the fetched file back to the target using `config_template`.

Change-Id: I3e7283bf778a9d686f3ae500b289c1fb43b42b92
Signed-off-by: cloudnull <kevin@cloudnull.com>
2019-02-18 09:06:26 -06:00
Zuul d28c0dced7 Merge "Add cron as a required package" 2018-10-25 17:23:32 +00:00
Jesse Pretorius c5e7333610 Install missing libxml2 distro package
In order to run the glance-api service, the libxml2 library is required,
or the following error will be returned when starting the service:

error while loading shared libraries: libxml2.so.2: cannot open shared object file

To ensure that the library is installed, we add the required package to
the base glance packages.

Depends-On: https://review.openstack.org/613030
Change-Id: I4f2c5df598473152bf319296355b57f4826b3554
2018-10-25 07:16:31 +00:00
Jonathan Rosser e596ee101b Add cron as a required package
The role sets up crontab entries but assumes that the environment
has cron installed. This patch ensures that assumption is correct.

Change-Id: I354f30462205dbf34de946260204b63c11488049
2018-10-24 17:21:45 +01:00
Kevin Carter 9a006a12bc Remove infectious distro service packages on source installs
The glance distro service packages were being combined with both distro
installs and source installs. This resulted in a situation where glance
was running both the distro service units as well as the source service
units causing lots of extra over head and transient failures. This
change removes the glance distro packages from the source based install.

Change-Id: I14dc46df74e5de2600b8d35c3018cff3caf5eafd
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-10-03 05:38:57 +00:00
Jesse Pretorius 482d8580b0 Remove python-keystoneclient package install
Now that we no longer use our own keystone module, but
instead make use of the ansible runtime venv's shade
library and upstream ansible modules, we can eliminate
this package/library being installed on the host.

Change-Id: I382a2fed407b159731b9ecd2af16ce80f3bb0b74
2018-09-18 08:36:31 +00:00
Jesse Pretorius d833af740b Rename SUSE vars file to cater for any version
To make the transition between versions easier,
we rename the vars file. This also resolves
issues when meta-dependent role inclusions do
not pick up the correct file when using the
include_vars task with multiple search paths.

Depends-On: https://review.openstack.org/602924
Change-Id: I378de1ade4c1cc231ec21fd3c3b1ce417df9abb0
2018-09-16 01:57:26 +00:00
Andy Smith 910522562e Add extra distro packages for optional oslo.messaging amqp1 driver
Change-Id: Ib7541da6f50aed75b428037f43ca7d0da7c27a21
2018-09-11 10:06:29 -04:00
Jonathan Rosser b46f6e07e9 Use generic vars file for ubuntu
These vars work for both Xenial and Bionic

Change-Id: I9831b8b6e9150346b8e8216ac9bc9f0a724b8dbe
2018-07-31 09:31:46 +01:00
Kevin Carter c6cd170fb7 Correct role rerun when using glance with NFS
When using glance + NFS the role deploys everything perfectly the first
time however if the role is executed again it will result in failure due
to some base directories being a mount. This change adds a new variable
which will create a list of all NFS mount points. This list is then used
in the required tasks to ensure we're not attempting to recreate
directories that should already exist and are being used as
mount-points.

Change-Id: Id28176833c0b783c20ee1d2ce71fa0654ccf683e
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-06-28 14:47:53 +00:00
Markos Chandras ea75a8ea10 vars: Do not pull devel packages on distro installations
The devel packages are only needed to build the pip pacakges so we don't
need them when we install packages straight from the distro repos.

Change-Id: I97855f8ac677dc34d7e4619b4ec72aa593eca76f
Implements: blueprint openstack-distribution-packages
2018-06-04 10:36:33 +01:00
Markos Chandras ee14464c58 Do not pip install keystoneclient on the host
The keystoneclient package is being installed on the host by PIP but
that means that a whole bunch of required dependencies are being pulled
in as well.

This brings the host to a rather messed up state when installing
keystone from distro packages, since distribution and
PIP packages are being mixed together. We only need the client to
register the service with keystone so we can simply use the distro
package for that to avoid installing lots of PIP packages on the
host.

Implements: blueprint openstack-distribution-packages
Change-Id: I90c9e6732e71e153aa37f9bf69bdda679439f8b3
2018-05-31 08:41:09 +01:00
Markos Chandras 3d7cf92bda vars: Do not install build dependencies for distro installs
The glance_distro_packages contain packages which are build dependencies
to the 'PIP' ones so we don't need to install them when we are using the
Glance distribution packages. This also renames the '*glance_wsgi_bin'
to '*glance_uwsgi_bin' since it refers to the actual uwsgi package.
Finally, we add the missing 'install_method' conditional when recording
the local facts.

Implements: blueprint openstack-distribution-packages
Change-Id: I063a73ca7d50a0ad0bee57ccc42604802ab08220
2018-05-14 12:01:53 +01:00
Markos Chandras ba64ce3083 Add support for using distribution packages for OpenStack services
Distributions provide packages for the OpenStack services so we add
support for using these instead of the pip ones.

Change-Id: I026a440b6a0fda43b613e30f359b2a23c3c1151f
Depends-On: I5a78e2120e596d36629b4ba978b2b5df76b149b0
Implements: blueprint openstack-distribution-packages
2018-05-04 15:42:26 +01:00
Mohammed Naser cf2472c4b1 Remove un-used packages from Glance
There are a few packages which are being installed that are not
necessary as they're not used in the role.

Change-Id: I7822498d65572993882b75ec56adf3f1a096da34
2018-02-28 18:35:49 +00:00
Jimmy McCrory 43aa00424f Fix systemd init template for program override
The systemd-init template was not looking at the program_override
variable within each service's dictionary.

This also fixes glance-api so that it's running under uWSGI when the v1
API is disabled. Creating images from a remote URL is exclusive to the
v1 API and does not work when glance-api is run under uWSGI.

The libxml2-dev package is required by uWSGI and has been added to the
distro package list.

Additional options have been added to the uWSGI configuration to better
support requests containing chunked data (image uploads).

Change-Id: I14f3162a4666d770beec9746469021466fa4d449
2017-12-06 08:56:48 -08:00
Markos Chandras e9ae99edbf Add support for the openSUSE Leap distributions
Add support for the openSUSE Leap distributions. Nothing special is
required for this except for adding the appropriate distro variables
file and also update the zypper cache before package installation.

Change-Id: Ia3fe5fedbbc2781cf2e7ae4d82c09e0960c6744b
2017-07-06 13:19:19 +01:00
Jesse Pretorius 545e362b05 Ensure that services restart in a particular order
Currently when multiple services share a host, the
restart order is random. This is due to an unordered
dict being used to facilitate the mapping of services
to their groups, names and other options.

This patch implements changes to the role to ensure
that services on the same host are restarted in the
correct order when the software/config changes.

Change-Id: I52fc66f861ce98cc8299c84edcfd5f18d74306b3
2017-06-30 13:27:56 +01:00
Marc Gariepy c1a802cca1 Add which in CentOS package list
which is needed by virtualenv-tools.

Change-Id: Iacb454ea5d37ce1ccce909c55a979966d86dff5e
2017-01-11 13:58:10 -05:00
Andy McCrae 42838c971c Remove Trusty support from os_glance role
Change-Id: If44365b0c00588a40802afe12f937b0c5ae797f8
Implements: blueprint trusty-removal
2016-12-15 13:17:08 +00:00
Major Hayden ffacc20cc8 Implement CentOS 7 support in os_glance
This change implements CentOS 7 support within the os_glance role.

Change-Id: I65d8e66673f5372fe880680a035842ffcd775ac2
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
Co-Authored-By: Major Hayden <major@mhtx.net>
Co-Authored-By: Marc Gariepy <gariepy.marc@gmail.com>
2016-09-19 15:47:39 +00:00
Jesse Pretorius 66e8dc3b6e Rename package lists (and related vars) appropriately
In order to make it easier to differentiate between the lists of
python packages, distribution packages, downloaded packages,
package pins and other similar variables the variable names are
being changed to ensure that they have a more explicit suffix
that defines the purpose and makes the naming more consistent.

This is to facilitate a lookup plugin which will be able to look
up all the package lists and present them as a consolidated piece
of data which may be used for artifact preparation.

Change-Id: I29e93c889f1450c33529563687a74914d8b03006
2016-08-30 17:04:39 +01:00
Kevin Carter 24c3d7053e Implement Ubuntu 16.04 support with SystemD
This change updates the glance role to support Ubuntu 14.04 with
upstart init and 16.04 with a systemd init.

Implements: blueprint support-ubuntu-1604
Depends-On: Ib6d7e68133de8d10b81d9116b74dca1de7568897
Change-Id: I39214199e2bbc2bbc5c1b30f8a04aa4e74ed967b
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-05-31 14:37:59 +00:00
Hector I Gonzalez 651a11d5a0 Updated role using Multi-Distro framework
* The default apt packages have been moved into a var file
  that is only loaded when the detected OS is matched.
* The Install task file has had the apt specific tasks moved
  into a named install task file.

Change-Id: Id352021c2c4a989eb93cdaa3804b2d363cd9f8bd
2016-03-28 13:26:48 -05:00