Commit Graph

40 Commits

Author SHA1 Message Date
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 8deb04fca2 Avoid hard-coding OS user/group in each manifest
and replace hard-codes by definition in params.pp .

Change-Id: I8a124223168556a6e733628d97151a79bc191c86
2022-02-20 19:53:45 +09:00
ZhongShengping 83f9db704c Allow db sync timeouts to be configurable
As Openstack projects continue to have longer database migration
chains, the Puppet default timeout of 300 seconds for an execution
is becoming too short a duration on some hardware, leading to timeouts.
As projects continue to add more migration scripts without pruning
the base, timeouts will continue to become more frequent unless
this time can be expanded.

Change-Id: Icd6698d7b15344b7ab1c14aad08ebc1cd61346f6
Closes-Bug: #1904962
2020-11-23 09:27:52 +08:00
Takashi Kajinami 1015639de8 Remove password hash generation in each puppet modules
... and migrate it to openstacklib so that all logics about database
configuration are implemented in one common place.

Depends-on: https://review.opendev.org/#/c/728595/
Change-Id: I2908540605a824acdc48b478f76da17c5dd08a39
2020-05-19 19:51:09 +09:00
Tobias Urdin ed9298e996 Convert all class usage to relative names
Change-Id: I9ff8d888e367a46ab89e3668bf4ba76c4c7c127c
2019-12-08 23:06:03 +01:00
Zuul c0fabacc57 Merge "Use validate_legacy" 2019-02-25 19:20:03 +00:00
Tobias Urdin 4b558f6f00 Use validate_legacy
This changes all the puppet 3 validate_* functions
to use the validate_legacy function.

The validate_legacy function has been available since
about three years but require Puppet >= 4.4.0 and since
there is Puppet 4.10.12 as latest we should assume people
are running a fairly new Puppet 4 version.

This is the first step to then remove all validate function
calls and use proper types for parameter as described in spec [1].

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

Change-Id: Ib21fef57404d63579743270be4080d248a4ca8cc
2019-02-23 17:19:29 +01:00
Tobias Urdin 9b9d5ae57e Use puppet 4 compatible mysql functions
These was introduced in 6.0.0 and is required to
support later version of puppetlabs-mysql.

Change-Id: Ic83677a569ece443620cf991b64d356352fd8de7
2019-02-08 12:08:47 +01:00
ZhongShengping d07c62fe8f Cleanup documentation
Make sure documentation is the same and follow
the standard which we are trying to enforce on
all modules.

Change-Id: I1b54aefa27a929946aaf91c6f863466df8b13107
2018-12-13 17:11:07 +08:00
zhubingbing f39316441a Fix annotations
Change-Id: If6d9c3028b24a3ae66b628fb73ad8ca63f14dbbc
2018-06-15 15:07:37 +08:00
wangqi d168469792 fix a typo: s/allowd/allowed/
Change-Id: I163cd2d1661f1e46a8993823fa98b6b887c74b07
2018-04-19 10:52:31 +00:00
ZhongShengping 75708dbf10 Remove useless code for sync.pp
In order to improve efficiency, remove useless code.

Change-Id: Iaba7a78aab74ece54fc846bc7b66034eb34d4d28
2018-04-08 09:10:41 +08:00
ZhongShengping e3b9d19cbf Add 'openstack-db' tag to db-sync Exec resource
In order to make easy orchestration on all OpenStack db-sync, add this
tag so people can use this tag in composition layer.
A use case it to set some orchestration to make sure MySQL Galera is
ready before running any Exec with this tag.

Change-Id: I0a7d0859d2052e5a8b4805e82e4370057bedf0b2
Closes-Bug: #1755102
2018-03-12 16:33:07 +08:00
Christian Schwede bdd52684d6 Load Glance DB metadefs
This will load default metadata definitions into Glance when syncing the
DB.

Closes-Bug: 1664995
Change-Id: Id043e36b32516ae077239f5af0b6017104e99b83
2017-03-20 14:04:08 +01:00
Flavio Percoco 07a7b66bae Don't pass glance-registry.conf in every sync_db
Since it's possible to run glance-api without glance-registry, we
shouldn't be passing the registry config file in every database sync.

This patch keeps the extra_param so that we can pass the config file if
the registry is enabled from other places.

Depends-On: Ib9f511219e8cb9a7322745b6bd7c4f9c9cc0c198
Change-Id: I4e7570bdc1b8d89c9914855fd8eec13688fbf9f3
2017-01-04 14:43:09 +00:00
Sharat Sharma 0fc2099d12 Added retries for db_sync
If db sync fails, it is never retried leading to errors. So, this
patch adds retries for db_sync to avoid sync fails.

Change-Id: I8778bd1b609bc5458a250111dc0a0f9b2fb52161
Closes-Bug: #1628580
2016-09-29 12:45:55 +05:30
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
Matt Fischer c720e78925 Remove unused cluster_id parameter
Change-Id: I020e7130d3d4bd479a6c2d167d7c485718d9b52f
2015-12-06 23:06:46 -07:00
Nate Potter 166af71b1f Correct db sync for backwards compatibility
In the previous patch https://review.openstack.org/#/c/241003/4
the default value for the config file when running glance-manage
db sync was changed. This patch restores the old default value
for backwards compatibility.

Change-Id: I1c17461bf7f4922ece41673f3f726ec00b0cd4c7
2015-11-19 16:31:13 +00:00
Nate Potter 9babb26d31 Allow customization of db sync command line
Add parameter to glance::db::sync class to allow end
users to add command line parameters to the db sync command.

Change-Id: I043dd9560f7d5eb7bc18721e759e5f61186f5cf7
Partial-bug: #1472740
2015-11-11 15:15:27 +00:00
Jenkins 3ffcc382d0 Merge "Remove deprecated mysql_module" 2015-10-15 08:27:58 +00:00
Matt Fischer 26cbd53d99 Remove deprecated mysql_module
This has been deprecated for some time and should be removed.

Change-Id: I648b6415385bc32ddeb2ae916e0cdb5c40c05743
2015-10-12 19:51:48 -06:00
Yanis Guenane 48a7164021 Creation of glance::db::sync
In order to standardize the way dbsync are run across our modules,
we create a new class glance::db::sync.
This class will be included if sync_db is enabled.

By making this transition the glance::db::sync class
can be returned by the ENC.

A use case would be in an highly available environment, with 3 galera
nodes, include glance::registry on every node with sync_db set to false
and have the ENC return glance::db::sync just for one node.

Change-Id: I16c8bc411bd34f720513a5d4c94e82b07105af20
2015-09-08 10:46:21 +02:00
Emilien Macchi 2f614cf9fd MySQL: change default MySQL collate to utf8_general_ci
Install & configure MySQL database by using utf8_general_ci collation
which is the way documented in OpenStack [1] and already the default
in puppetlabs-mysql [2].

[1] http://goo.gl/GA5gyZ
[2] https://github.com/puppetlabs/puppetlabs-mysql/blob/master/manifests/db.pp#L7

Change-Id: If85731786a061aed9cb44f016edc67f32c3db1a5
Closes-bug: #1446375
2015-04-21 18:53:13 -04: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
Sebastien Badia 7857c67e24 Migrate postgresql backend to use openstacklib::db::postgresql
Let migrate to the new openstacklib::db::postgresql helper for
postgresql backend. This commit also unpin postgresql fixture
(openstacklib support now the latest version of postgre module).

Change-Id: I29ae9506cb638aa3e3925705bac945511c96ca8f
Implements: blueprint commmon-openstack-database-resource
2014-12-30 19:05:14 +01:00
Colleen Murphy dbcb82fa36 Migrate mysql backend to use openstacklib::db::mysql
Implements: blueprint commmon-openstack-database-resource
Change-Id: I03bd33d7c78ea69702650688c28e9d0b7cac2911
2014-08-14 08:45:41 -07:00
Soren Hansen c3a25eac47 Use 2.2 as the default mysql_module
Change-Id: I5ec545b62ef8ac5371ca567a8a00f5ba535efceb
2014-07-16 18:45:39 +05:30
Ivan Chavero dba437e8af Change mysql default charset to utf8
Changed the default charset to uf8 and the
collation to utf8_unicode_ci.

Change-Id: Iac22a6f66e889157bd1f327da50e0186e04651dc
2014-03-31 22:09:30 -07:00
Michael Chapman 4aa86af2fc Add support for puppetlabs-mysql 2.2
Puppetlabs-mysql has been rewritten to be much
cleaner. This patch adds a new parameter for the
glance mysql class allowing users to use the new
version. Previous behavior will continue as normal
when using the old version (0.9)

Change-Id: Icdc787e325f3e86572f6930f1ab8c3d5291e67c9
2014-03-22 02:12:28 +11:00
Xingchao Yu aee08d0cbb Update allowed_hosts conditional statement
In the origin glance::db::mysql, if the value of $allowed_hosts
contains or equals to $host, then puppet will complain duplicate
declaration error. This patch is aim to update the allowed_hosts
conditonal statement in glance::db::mysql.

There are two cases to pass $allowed_hosts to $real_allowed_hosts:

   - If $allowed_hosts is array,then remove $host from $allowed_hosts;
   - elsif $allowed_hosts is string and not equivalent to $host;

At last, if $real_allowed_hosts is not undef, then run
glance::db::mysql::host_access

Fix bug 1206444

Change-Id: Ic70aaaec493195c7277782abb87469f9809e5baa
2013-08-01 12:11:41 +08:00
danehans 1121d7dccd Remove Unnecessary mysql::server Dependency
Previously, the db::mysql class required mysql::server.  This is
unnecessary since the mysql::db define requires the mysql::config
class for db creattion.  Additionally, this prevents users from
using a different class such as galera::server to manage
the database.

Change-Id: I8ee9303eef67657dd2898d910897748a0af5415b
2013-07-18 22:14:47 +00:00
Mathieu Gagné d5567e6aef Various Puppet lint fixes
* Fix following warnings:
    * double quoted string containing no variables
    * indentation of => is not properly aligned
    * quoted boolean value found
    * variable not enclosed in {}
* Fix following errors:
    * two-space soft tabs not used
* Remove quotes around class in include/require statements
* Remove some comments from the code, they added no value

Change-Id: I341b37f2c6795951f3285037b2fa612d767a4474
2013-07-01 17:34:19 -04:00
Dan Prince 1598196ae7 Add glance::db::postgresql class.
This allows Glance to be used with PostgreSQL.

Requires the puppetlabs/postgresql module. NOTE: I did add this
dependency to fixtures but did not add it to the Modulefile due
to the fact that the postgresql::python module hasn't been
released to puppetforge yet (although it is committed and tests
pass).

Change-Id: I3522d50935c81c8859c9f597df64aa0af6ca4e71
2013-04-23 12:58:39 -04:00
Dan Bode c4a051e99c style change
align code for readability.
2012-10-14 12:38:26 -07:00
Dan Bode c15243b82d Make glance::db::mysql dependent on mysql::server
Adding a sep that was missing when the db is
split off onto its own mode.
2012-10-03 22:08:36 -07:00
John Chilton a7dedf197a Allow override of mysql charset & small whitespace fixes and spec improvements to test this change. 2012-05-16 10:04:29 -05:00
John Chilton cbd1a0d43f Change require => mysql::server to mysql::config so the mysql is fully configured before glance database is created. 2012-05-16 10:00:13 -05:00
Dan Bode 52aae65a4c Move mysql code to db::mysql
This commit moves the mysql specific db manifests
to the namespace glance::db::mysql.

This is done for two reasons:
  - to create a directory loaction for manifests
    for all future supported datbases
  - to be consistent with other openstack projects
2012-04-22 23:54:42 -07:00
Dan Bode dd5fb3ea91 Add code for db and host_access
Glance can be configured to use a mysql db.

This commit adds the classes db and db/host_access.
2012-03-29 16:43:23 -07:00