Commit Graph

39 Commits

Author SHA1 Message Date
Takashi Kajinami 10d7bbdeef Add all store options to glance-cache.conf
The glance-cache.conf is used by the glance-cache-prefetcher command
which requires access to backend store. Thus all store options should
be added to the glance-cache.conf file so that backend store can be
loaded properly.

Closes-Bug: #2034893
Change-Id: I8f0b2be8b138d267364f20ff81876902b225d29e
2023-09-08 18:56:20 +09:00
Takashi Kajinami 945280277f replace validate_legacy with proper data types
the validate_legacy function is marked for deprecation in
v9.0.0 from puppetlabs-stdlib.

Note that this change removes the pattern validation about [DEFAULT]
pipeline. The existing pattern check is incomplete, because of
the following two reasons.
 - the pattern does not guarantee that the requested pipeline is
   really supported or not
 - the pattern accepts a+b+c but the existing pipelines in glance
   does not have any entries with this pattern

Change-Id: I156d9a3a30ba6c523a0b16a14bf8a1839b61fb78
2023-06-19 18:33:38 +09:00
Takashi Kajinami 2cdc2b2176 Add strict validation about boolean parameters
This ensures the parameters used by if-else logic accept only boolean
values because non-boolean can result in unexpected behavior.

Change-Id: Ie3fce5786d44be38fad176442a0a0f9b24faab77
2023-03-17 02:23:27 +00:00
Takashi Kajinami 43735fb127 Replace legacy facts and use fact hash
... because the latest lint no longer allows usage of legacy facts and
top scope fact.

Change-Id: Iebdb33dd18a8f8d18840ff3e5f4608f021a78bfa
2023-03-02 10:54:36 +09:00
Takashi Kajinami 8a70cf5dea Swift backend: Use Keystone v3 API by default
... because v2 API was removed a long ago and is no longer available.

Closes-Bug: #1947816
Change-Id: I1402f72fa58f617ccb1e92caa774ca15a6133c58
2021-10-20 12:16:10 +09:00
Takashi Kajinami 7f1729e9ae Deprecate the swift_store_config_file parameter
Because we hardcoded the path in the glance_swift_config resource, We
don't expect the swift_store_config_file parameter is set to various
values, but set to the hardcode path, '/etc/glance/glance-swift.conf'
in almost all cases.
The parameter is deprecated by this change, and will be removed and
hardcoded in a future release.

Change-Id: Ie4a8b933200e25c69fc1ac4985acab486d8a62c8
2020-12-22 10:39:49 +09:00
Tobias Urdin ed9298e996 Convert all class usage to relative names
Change-Id: I9ff8d888e367a46ab89e3668bf4ba76c4c7c127c
2019-12-08 23:06:03 +01:00
Alan Bishop fd02761c6e Update the method of configuring glance backends
This patch updates the method of configuring glance backends to use the
modern syntax associated with glance's Multi Store feature. Glance's
glance_store/stores and glance_store/default_store parameters were
deprecated in Rocky, and are scheduled for removal in Ussuri.

Backends are now specified using new glance::api::enabled_backends and
glance::api::default_backend parameters. A series of
glance::backend::multistore::* defined resources support configuring
multiple instances of each backend.

The legacy glance::api::stores and glance::api::default_store parameters,
as well as the glance::backend::* class resources, are deprecated, but
continue to function for backward compatibility.

The glance::backend::s3 class is completely deprecated. Glance removed
support for the s3 backend in Newton.

Closes-Bug: #1846808
Change-Id: I4f3ec9ee7c4147a4e62de961a9532bdc45526f6b
2019-10-16 14:46:39 -07:00
Tobias Urdin 97c5ff3874 Change keystone v2.0 url to v3
Change-Id: Ic90c6394acad605b4a2172b4993bf32cab3e7c20
2019-02-24 13:01:33 +01:00
Tobias Urdin 4700a450be Remove deprecated parameters
Removes deprecated parameters that has been
deprecated for one cycle or more.

Change-Id: I9f433ec89f8990a0f0c670389a301bdb732a989a
2018-05-22 14:59:22 +02:00
Arnaud Morin 2ce1ddfd83 Add swift_store_large_object_chunk_size parameter
Add a new parameter to swift backend to let user set the chunk size when
glance will start chunking the images before uploading.

Change-Id: I9984bdb416ec9d874345b410557ef42c360232fb
Signed-off-by: Arnaud Morin <arnaud.morin@corp.ovh.com>
2017-10-18 17:03:19 +02:00
Denis Egorenko 1123f79809 Drop Glare service from puppet-glance
Glare service is now totally dropped from Glance [1] and now should
be configured only with puppet-glare module.

[1] https://review.openstack.org/#/c/427535/

Change-Id: I695ad518285a92a80dd7a9d5bebd11e804359224
2017-09-20 20:31:08 +00:00
Andrew Woodward 33f96d71ed Ensure that swiftclient is installed
It's possible for glance-api to get stuck in a loop starting when
the backend is swift, and python-swiftclient is not present on
the system.

Depends-On: I65fb0736e9fa9e68c3c7877cf6caf228c49eb82d
Change-Id: I1eeb9f12cf82961ae820067ad8fe91d096d1d6e1
Closes-bug: #1632143
2016-10-14 13:06:31 -07:00
Clayton O'Neill 18b010975c Add hooks for external install & svc management
This adds defined anchor points for external modules to hook into the
software install, config and service dependency chain.  This allows
external modules to manage software installation (virtualenv,
containers, etc) and service management (pacemaker) without needing rely
on resources that may change or be renamed.

Change-Id: If683fbd098e701a3c4da91941cf818b18b41b209
2016-06-17 13:17:34 +00:00
Mykyta Karpin 037545fb3e Switch glance to os_service_default facts
Change-Id: If860858e2bdfe0387b6a3260b81a97625d05b9fe
2016-04-06 18:56:34 +03:00
Dan Prince 006c32a38f Add options to set swift auth domains
We need options to be able to set the user and project domain
when using keystone v3 credentials for the swift backend. Without
these options keystone v3 swift will fail.

Change-Id: Id384b0eca750e0946b42cb8ccb60a7f9ed64d21a
2016-04-01 14:16:12 -04:00
Denis Egorenko ea0c4d5b51 Add posibility to configure Glance backend settings for Glare service
This patch adds posibility to configure backend settings for Glare
service.

Since Glare service is experimental feature, it can be usually disabled
for deployment. Hence was added a optional parameter 'glare_enabled' for
each backend manifest. So, if Glare is enabled glance glare config
will (and should) have same backend options as main glance api config.

Change-Id: I112a332f490d2e57eef5fa7d41d465c0eb89da04
Related-bug: #1555697
2016-03-28 16:18:13 +03:00
Nate Potter 22231b2d66 Implement multiple store configuration
This patch moves the default_store config option to the glance::api
class, and makes it possible to configure more than one store while
supplying a value for the default store to be used. If only one store
is given for glance_store/stores, the default store is automatically
set to be the same value. If multiple stores are given and no default
store is explicitly set, the config will fail and ask the user to
provide a default store.

Change-Id: I28a79ae36e673a3537ea16910d338666b65c80f7
Closes-bug: #1481460
Co-Authored-By: Alex Schultz <aschultz@mirantis.com>
2016-03-05 00:32:39 +00:00
Denis Egorenko b3160011aa Use http protocol by default in auth_address for Swift backend
This commit explicitly sets default protocol to http in
swift_store_auth_address variable for Swift backend, because without
any specified protocol it will use https by default. That's not
consistent with other default values for protocols in auth addresses.

Change-Id: I232536d179db92d82f1c7459a0f13e5ca5576f42
2016-02-26 16:10:45 +03:00
Denis Egorenko c8b7d3319b Use glance-swift conf for swift backend
For working with Swift backend, Glance needs authentication parameters,
which are supplied to Swift when making calls to its storage system.
Glance will use information from the file specified under parameter
swift_store_config_file. When this parameter is set to the same file
(glance-api.conf), we have lot of non-critical errors in glance-api
log, because of 'Invalid format of swift store config'.

The same problem, when we have RadosGW.

Change-Id: I18ee8f68f7ce793d2580685e79ed636556c57ddd
Related-bug: #1540890
2016-02-02 17:34:33 +03:00
Ben Nemec c324788ff6 Fix Swift store configuration
The swift_store_config_file option is being set in the DEFAULT
group instead of the glance_store group where it is actually
defined in Glance.  This causes configuration of the Swift store
backend to fail because the configuration is not found by the
check here:
https://github.com/openstack/glance_store/blob/master/glance_store/_drivers/swift/utils.py#L66

Moving the option to glance_store makes the Swift backend work again.

Change-Id: I3af198e5015df1d626c4a5aaccb3b4e5781f56b8
Closes-Bug: 1532352
2016-01-09 00:03:19 +00:00
Denis Egorenko 09fec793da Update Glance Swift backend configuration
Currently, when Glance uses Swift as backend, all references to
images saved in database with credentials, like:
swift+http://services%3Aglance:EF3tluYM@192.168.0.2:5000/v2.0/glance/049cd701-77

The problem is that when we want to change Glance credentials we can't use
old images anymore, because new credentials and creds in database are
different. For resolving this issue was implemented patch in Glance [1]
and couple of patches in Glance_Store [2,3]. The main goal is using
separate section (file with such section) for providing credentials
for access to Swift and do not place reference with credentials to
database.

All changes above are covered in docs for configuring Swift backend [4].

Also glance_cache_config now is not using for configuring Swift backend,
hence all related parameters for this config removed.

[1] https://review.openstack.org/#/c/98722/
[2] https://review.openstack.org/#/c/193422/
[3] https://review.openstack.org/#/c/108036/
[4] https://review.openstack.org/#/c/242583/

Change-Id: Iaf0c1c6f2188c84267e41d2d4f9bda0dbf3dccad
Related-bug: #1499754
2015-11-16 20:38:59 +03:00
Bartłomiej Piotrowski 3458416af1 Add swift_store_region parameter to glance::backend::swift
- Allow glance to connect to swift in different Region

Change-Id: I7f00b9cc20cb2d11eacbfaefb86f998247cf3454
2015-07-23 16:44:32 -05:00
Denis Egorenko 05b0969c4d Fix section names for parameters
Some parameters have wrong (or deprecated) section names.

Change-Id: Ib44cf7825de33dc251812cb9138b821a397d77e7
2015-07-02 18:43:25 +03:00
Stanislaw Bogatkin 611045f213 Add endpoint type parameter
To point glance swift endpoint type, one optional parameter
was added.

Change-Id: I25ce5d9d119804f1aca5b5567be46750050ebacd
Closes-Bug: #1458811
2015-05-26 10:14:42 +00:00
Sebastien Badia 0d83409381 Fix lint issues (doc, metadata, manifests)
Add puppet parameters lint (with puppet-lint-param-docs gem) and fix
missing documentations, this commit also fix metadata.json file (SPDX
license, and open dependencies).

Change-Id: I0d590b930a8d0263c3a74d861b9786770be7d183
2015-02-23 01:29:11 +01:00
Emilien Macchi 908a62b2b9 Update [glance_store] section in glance config for Juno
Use new parameters for Juno like it's documented here:
http://docs.openstack.org/trunk/config-reference/content/glance-conf-changes-master.html
* Use [glance_store] section
* Update prefix when needed

Partial-Bug: #1391099

Change-Id: I096b16c33c493270422113e0107a100f967debc6
2014-11-14 19:30:39 +01:00
Aleksandr Didenko baa47b4bba New parameter for swift backend
New parameter is 'swift_store_large_object_size'.

Sometimes default value (5G) doesn't work when user attempts to
make a snapshots with size > 300 Mb. So it may be usefull to have
a possibity to adjust this parameter to your needs.

Change-Id: I08336b91b0cd294a86326605fb6c28653e8eedb8
2014-09-25 17:31:41 -07:00
David Moreau Simard 30fd048fc8 Make sure swift backend in-file documentation matches actual code.
Simply making sure that the in-file documentation matches the
manifest to avoid any confusion.

Change-Id: I0b890f575ec1c33dbd515d2454023bfa3ade041b
2014-01-08 15:16:23 -05:00
Emilien Macchi 3d3c342bb3 Clean all warnings for puppet-lint gate
Change-Id: If143d40464af60bcba4b69705ef48c1206fead02
2013-08-13 10:27:18 +02:00
Mathieu Gagné 95dd566b9b Configure glance-cache.conf with swift backend
glance::backend::swift was not properly configuring
swift_store_* in /etc/glance/glance-cache.conf
when using swift backend.

Change-Id: I7b46dd2bd1ff050759b11cbc9c3c7068e4c3e01e
2013-07-02 19:29:49 -04:00
Mathieu Gagné b04232aecb Use boolean instead of string
Change-Id: Ie508c5f6a98277b650307a1782ce3fde9d2bca1e
2013-05-09 23:12:33 -04:00
Dan Prince 5dbcb47c50 Add swift_store_auth_version to swift backend.
Updates the glance swift backend to support configuring the
swift_store_auth_version setting. The default value for this is '2'
(which matches the glance config file defaults).

As part of this change I am also updating the default value
for swift_store_auth_address to use 127.0.0.1:5000/v2.0/ (keystone).
This makes sense because the previous value would have required
us to set swift_store_auth_version by default to 1.

Change-Id: I865712914dd0506b2722ab8da3e1c56d7d9f433a
2013-04-11 11:30:41 -04:00
Dan Prince 3ce02dbd69 Make swift backend not enherit glance::api.
Having the glance::backend::swift class inherit glance::api
makes it unusable (it causes puppet errors due to missing password
which is required by glance::api).

Since this module is mainly just useful to configure sets of
swift configs it can stand on its own.

Change-Id: I549087e2e9e9e1abd43bd0f78e4f4dee71490ace
2013-04-04 18:26:28 -04:00
Dan Bode 74b15ec273 fix backends 2012-10-14 00:23:09 -07:00
Dan Bode db7de69bd5 Convert to ini file management
- Add native types to manage all existing ini files
- remove all unused templates
- convert all concat with ini_setting resources
- remove all concat code
2012-10-03 22:04:00 -07:00
Branan Purvine-Riley 87740b26ae fix old puppet 2012-05-08 15:08:01 -07:00
Dan Bode 151493f294 Remove backend class
The backend class has been removed and the related
backend config service has been coupled with the
file and swift classes. This is to reduce the code
complexity.
2012-04-03 10:00:44 -07:00
Dan Bode 6c29550dcb Split api.conf file into fragments
This commit splits the api.conf template into
fragments to better allow for logical separation
for configuration sections.

The main motivation for this change is to allow
differrent implementations of services in glance to
be split up into seperate configuration interfaces.

The primary examples of this are the notifier and
the storage backend. Each of these services have
multiple potential implementations. This allows
those implementations to be implemented as separate
class interfaces and saves us from having to have
all of the possible config parameters to be specified
as parameters of the api class.

It creates a define: glance::api::config that can
used to configure file fragments for
/etc/glance/glance-api.conf

It also creates configuration interfaces for
configuring the following config sections of api:
backend::swift, backend::file, notify::qpid,
notify::rabbitmq.
2012-03-31 16:01:42 -07:00