48 Commits

Author SHA1 Message Date
Takashi Kajinami
8ab7ef4044 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: Ie564c3ae6023a36f317b963872059509754970e5
2020-05-19 20:14:26 +09:00
Tobias Urdin
fa11274b2f Convert all class usage to relative names
Change-Id: Ia631adf31be1eeadb7ab0f12b75f1eaed73d5fbf
2019-12-08 23:09:22 +01:00
Tobias Urdin
7fea7a2145 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/

Depends-On: https://review.openstack.org/#/c/639215/
Change-Id: Idd720f18893bea0ec1d26859e0a6907a5daa8980
2019-02-25 23:02:21 +00:00
Tobias Urdin
16f2265203 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: I82ecf608820f940cffc53b679545d3e9aee71195
2019-02-08 12:14:47 +01:00
ZhongShengping
5f5eb4c369 Cleanup documentation
Make sure documentation is the same and follow
the standard which we are trying to enforce on
all modules.

Change-Id: I215f28f4ce417a3c098cbf4be21967b2ed4013bb
2018-12-13 17:11:02 +08:00
zhubingbing
487af5db88 Fix annotations
Change-Id: Ieef783b15ad2f5fb23567720d3cc248eda9b98a5
2018-06-15 15:07:37 +08:00
ZhongShengping
b563459e37 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: Icd2700fe8c27a647dab8d91a4f9c20eda930b4e1
Closes-Bug: #1755102
2018-03-12 16:33:08 +08:00
ZhongShengping
62e59cc67d Add the setting log level
Increase the setting log level in the synchronization database.

Change-Id: I36f0fb16a1f810f37e6d07a6f888adcc9e53612d
Closes-Bug: #1683567
2017-04-18 11:18:36 +08:00
Sharat Sharma
28c04297b2 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: Ia9d09515435618624919ad715ffa3df833a50a7a
Closes-Bug: #1628580
2016-09-29 09:12:49 +00:00
iberezovskiy
c0fcdb5a0e Changes around keystone-manage commands
* perform all keystone-manage commands only as keystone user
* as it possible to override keystone user in init class
  we should also have an ability to override it in db::sync class
* ensure that fernet key directory is created before fernet
  setup command and it's owned by keystone user

Closes-bug: #1604884

Change-Id: Ib90d8e2259b9a650a2edb5f0baf0e68451b9abf6
2016-07-21 19:49:06 +03:00
Matt Fischer
a5da52ec52 Keystone hooks support
This code moves all deps to an external class so that Keystone can be
installed with mechanisms besides packages (like venv or docker). This
also cleans-up the dependency tree by removing false or confusing
dependencies.

Change-Id: If69cd7cba267f75faad51fdbc80a58b24d2095d8
Co-Author: Clayton O'Neill <clayton.oneill@twcable.com>
2016-03-15 20:11:25 -06:00
Emilien Macchi
b68858f7fe Drop User/group resource dependency
This patch is a squash between:
* I35187a857ae6e67b301d62e30525eaab75707161
* I30d759697ed42dc35f8df8e231c9e012d2762894

It entirely drops the usage of User resource dependency.

Note: since beaker jobs were failing with sepeparated patches, we
decided to use one patchset so Beaker job can pass the CI.

Change-Id: Id69eca0ce73ba7c16aca939821234717618f5ec4
Closes-bug: #1458915
Co-Authored-By: Drew Fisher <drew.fisher@oracle.com>
2016-02-23 11:30:48 +00:00
Swapnil Kulkarni (coolsvap)
25905128a0 Update typos
Change-Id: Id44ff95e32fa80aef8ec5a786d327fca7ac78c62
2016-01-04 14:51:30 +05:30
Matt Fischer
d79020d163 Remove deprcated mysql_module
This has been deprecated and non-functional for awhile, remove it.

Change-Id: Ibc556b1d5c698d343853e1414c4e7861b0999e66
2015-10-21 21:30:39 -06:00
Mike Dorman
ea12fb2d54 Allow customization of db sync command line
Add $extra_params parameter to keystone::db::sync class to allow
end-users to add command line parameters to the db_sync command.

Change-Id: I3965a4d0d4974e7ee925c99207d4d6d4510a517f
Closes-bug: 1472740
2015-09-21 09:07:49 -06:00
Emilien Macchi
1e4ede1730 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: I2d5fc688c75c54703624797eb1829973623ef916
Closes-bug: #1446375
2015-04-21 18:54:56 -04:00
Sebastien Badia
a3bdaad473 Add missing puppetdoc and lint all parameter documentation
Un-pin puppet-lint gem and add puppet-lint-param-docs, this commit also
add missing puppetdoc and fixes lint issues.

Change-Id: I1eefc743c68c75eb54a65b3cc539922ef3a3b04d
2015-03-15 18:09:16 +01:00
Sebastien Badia
ac2d812862 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: If748f8ff57d8aece1b4050bc4b841495088b2972
Implements: blueprint commmon-openstack-database-resource
2014-12-30 21:54:00 +01:00
Colleen Murphy
6e108f23b8 Migrate mysql backend to use openstacklib::db::mysql
Implements: blueprint commmon-openstack-database-resource
Change-Id: I5dc293c1b8033000523fae504f789199599cf447
2014-08-28 08:56:55 -05:00
Risto Laurikainen
e1e3f094a9 Require Class['mysql::server'], not Service['mysqld'] when creating DB.
When using version >= 2.2 of the MySQL module, setting up
the database for Keystone depended on the MySQL service
(Service['mysqld']). However, if the service is not managed
by Puppet (e.g. it is managed through Pacemaker instead),
this would cause catalog compilation to fail because there
is no Service['mysqld']. This is the case when the MySQL
module is called with service_manage => false. Requiring
Class['mysql::server'] instead fixes this.

Change-Id: Ia1b34051dd6e4fc0916ac788d6027c1f987418a8
Closes-Bug: 1349316
2014-07-28 12:28:38 +03:00
Chris Hoge
be78133b73 Fixed database service resource
Version 2.2+ of the puppetlabs-mysql moudule starts the MySQL database
with the Service resource name mysqld [1]. The puppet-keystone module
lists a requirement for a Service resource with name mysql. This will
lead to an undefined resource error.

This patch corrects the dependency.

[1] https://github.com/puppetlabs/puppetlabs-mysql/blob/master/manifests/server/service.pp#L15

Change-Id: I2165b2c0529c0ecd9e9ba9853f3d15d5f86b0135
2014-04-23 14:30:00 -07:00
Mark T. Voelker
d9aac2f782 Fix deprecated section header in keystone.conf
In Icehouse, the [sql] section in keystone.conf has been replaced with
a section called [database] instead to improve consistency across projects.
This patch modifies the puppet-keystone module so that it populates
the [database] section instead of the [sql] section.

Change-Id: I452601cc41d57a78b3390e9516b0b0bef44ceb19
Closes-Bug: #1308861
2014-04-17 02:03:25 -04:00
Ivan Chavero
496d73df18 Change keystone mysql default charset to utf8
Changed the default charset to uf8 and the
collation to utf8_unicode_ci.

Change-Id: I3818955c8f28691432d4869fd999bcae05e592d7
2014-03-31 22:45:16 -07:00
Hunter Haugen
7813820abd Use correct variable for host_access dependency
The keystone::db::mysql resource declares resources using
`$real_allowed_hosts` which is a copy of `$allowed_hosts` minus `$host`.
But then it declares dependencies using `$allowed_hosts` which includes
`$host` and will fail catalog compilation due to a missing dependency

This bug only affects users if the value of `$host` is included in the
array of `$allowed_hosts`

Change-Id: Ifdd8793bcf36178efd1a083ee35649d56dc3d768
2014-03-26 18:19:52 -07:00
Michael Chapman
36d87e0fc7 Add support for puppetlabs-mysql 2.2
Puppetlabs-mysql has been rewritten to be much
cleaner. This patch adds a new parameter for the
keystone mysql and init classes allowing users to
use the new version. Previous behavior will continue
as normal when using the old version (0.9)

Change-Id: Idf7c46d9aab8db7cca7d8377431c60b24ae4c9c6
Closes-bug: #1266241
2014-03-18 15:43:32 +11:00
Matthew Black
2d8a7504e0 Moved keystone db sync to its own class
This will decouple allowing for additions, like the apache wsgi
patch, so it can be included or triggered elsewhere.

Original author is François Charlier<francois.charlier@enovance.com>

Change-Id: I9ae544d58034ca30ddb0a4c616ff794ccd432d7f
2013-11-06 10:43:49 -05:00
Dan Bode
215730d791 Update default db username to keystone
The current default db username for keystone is
keystone_admin. This is inconsistent with the default
db username for every other service which use the
same name as the name of the service.

The documented installation instruction for keystone
also use keystone as the database user.

This commit updates the default to use keystone instead of
keyston_admin.

Change-Id: I1cfaf3fbbc691ff9dbef415b69492f9f965dc113
2013-09-10 23:15:07 -07:00
Mathieu Gagné
48ac3fb090 Fail puppet-lint on warnings
Puppet-lint will now fail if there is any warnings.

Disable 'class_inherits_from_params_class' check.

Change-Id: Ia1d7fa5109178f040b00abcdb3f7d84c4bdf58b4
2013-08-28 18:00:15 -04:00
Xingchao Yu
49b248344f Update allowed_hosts conditional statement
In the origin keystone::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 keystone::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
keystone::db::mysql::host_access

Fix bug 1206444

Change-Id: I8701aea9344a9151ce3d7ac8fa5792895a5aac6c
2013-08-01 14:48:31 +08:00
danehans
21d91fde33 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: Ifb0fa261f9f5921cf9fe5b309decceab608d4726
2013-07-18 22:38:28 +00:00
Mathieu Gagné
ce84d712de Various Puppet lint fixes
* Fixes following warnings:
    * indentation of => is not properly aligned
    * string containing only a variable
* Fixes following errors:
    * tab character found
    * two-space soft tabs not used
* Remove quotes around class in include/require statements

Change-Id: I7e17d9153d413792e32f9d7c430dfbd37852ba51
2013-07-01 17:07:54 -04:00
Dan Bode
49796d3e10 remove trailing whitespace
Change-Id: I1982e0deac14a829daacbc64a1d89a2277e18a93
2013-05-08 14:13:55 -07:00
Dan Prince
4821c6420d Add tests on keystone:db::postgresql.
Adds missing tests on the keystone::db::postgresql class. Also,
removes some unsupported options from the class.

Change-Id: Ifab6d06dcd388df07cc9cc06bb8e938d3af90c62
2013-04-23 12:41:06 -04:00
Joe Topjian
1090ee2ea7 Removed quotes in allowed_hosts as it was causing a failure when allowed_hosts is an array of hosts 2013-03-24 21:43:29 +00:00
Dan Bode
a9eb27ea8b Merge remote-tracking branch 'origin/folsom' 2013-03-19 10:33:27 -07:00
Flaper Fesp
29c3fac28c Removed last , 2013-01-15 14:06:48 +01:00
Vladimir Kuklin
adab1bd0b1 Ensure that mysql users are created before keystone-manage db_sync.
Otherwise keystone-manage might not have rights to populate keystone DDL.
2012-11-12 19:32:31 +04:00
Dan Bode
3e3201c15e Updates modules documentation. 2012-10-31 12:34:22 -07:00
Dan Bode
11b39e2bab minor style refactor
move reps to top of manifest
2012-10-23 15:32:40 -07:00
Dan Bode
5c86b6417c unset password defaults.
setting passwords by default in the keystone
manifest is a potential security risk.

This commit unsets them to force users to set their own.
2012-10-23 15:32:40 -07:00
Dan Bode
38153d15b0 remove trailing whitespace 2012-10-23 15:32:40 -07:00
Joe Topjian
83406ecb9c Setup better db reps
Ensure that mysql is installed before we configure
keystone to use it.
2012-10-23 15:32:39 -07:00
Etienne Pelletier
568c74ab64 Added postgresql support. 2012-06-13 15:01:27 -05:00
John Chilton
96bd60ed06 Allow override of mysql charset. 2012-05-16 09:31:37 -05:00
John Chilton
990522b8d8 Depend on mysql::config instead of mysql::server in order to allow mysql to fully configured before creating database. 2012-05-16 09:01:38 -05:00
François Charlier
64e77ac38f Update to use keystone::db::mysql::host_access 2012-04-24 12:55:18 +02:00
François Charlier
18c611bd76 Allow the database to be on another host
Without any keystone package
Handling allowed_hosts
2012-04-24 12:47:50 +02:00
Dan Bode
8d21eb9121 Move mysql to db::mysql
Since keystone can use different databases, it makes
sense to move the mysql classes to db::mysql. This way
there is a clear standard for where other DB implementations
should be located.

This commit moves keystone::mysql to keystone::db::mysql
and keystone::mysql::access to keystone::db::mysql::host_access.
2012-04-23 21:59:58 -07:00