12 Commits

Author SHA1 Message Date
Takashi Kajinami
e4b68e9ad6 Generate password hash from password
Currently openstacklib only accepts password_hash instead of password
for db credentials, thus we should implement hashing process in each
modules, with including puppet-mysql and puppet-postgresql.
This patch migrates that hash generation to puppet-openstacklib, so
that all logics related to db is gathered in one module.

In addition, because postgresql_password function was deprecated in
favor of postgresql::postgresql_password in puppet-postgresql
6.5.0[1], this patch also deals with that deprecation.

[1] 700d2c5bb5

Change-Id: I898d31e88188bfd3476412a37f48fc918122a98a
2020-05-18 14:29:39 +09:00
Damien Ciabrini
f4e9903458 mysql: allow specifying the authentication method
MySQL users can be configured to require a specific authentication
method when connecting to the MySQL server, e.g. GSSAPI, SHA-256
or ed25519.

Expose a new attribute $plugin, that is passed to puppetlabs-mysql
When creating/updating a user in the MySQL database.

Change-Id: I1c7b40d110190eba861ed466d2644c2f1abbf7b0
Related-Bug: #1866093
2020-03-25 19:47:11 +00:00
Tobias Urdin
4d08ab70cb Cleanup spec testing
Change-Id: I3c13fc2f8bc3582fd72206b3c711ff5863943b09
2018-11-01 17:54:51 +01:00
Juan Antonio Osorio Robles
83653d442e Add tls options to mysql user creation
This enables us to set several TLS requirements for the users created
by the host_access resource.

Change-Id: If550f184f85f8fdbc197fc9f930d4446de67090a
2016-12-16 07:58:13 +02:00
Alex Schultz
d91a4c7b36 Add ability to skip mysql user/grants
Previously if you wanted to use the openstack::db::mysql for to create a
database and use the same user for multiple databases, the catalog would
fail due to a duplicate mysql_user definition. This change adds the
ability to disable the user creation as well as the grant if the user
does not need it.

Change-Id: Id04a622cc900254fe60bc257a9e42d16c676bf40
Related-Bug: 1649341
2016-12-12 14:46:07 -07:00
Alex Schultz
525d77195e Improve tests with rspec-puppet-facts
This change updates the tests to use rspec-puppet-facts when doing
different OS testing. Additionally as part of this change, there are
improvements to the openstacklib::policycrd testing which uncovered
issues with the verify_contents catalog test. The verify_contents calls
have been replaced with heredocs to better test when multiple services
are excluded.

Change-Id: I86bae2b16026e15b6e4445f3749419b8802bc94d
2016-10-26 17:49:59 -06:00
Emilien Macchi
6122ac4ebb 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: I7ceecaa3e7fe964e53714cfd4c6fd2b8ff90fce0
Closes-bug: #1446375
2015-04-22 08:59:26 -04:00
Gael Chamoulaud
3fa6399cad spec: updates for rspec-puppet 2.x and rspec 3.x
This patch aim to update our specs test in order to work with the rspec-puppet
release 2.0.0, in the mean time, we update rspec syntax order to be prepared
for rspec 3.x move.

In details:
* Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
* Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
* Fix spec tests for rspec-puppet 2.0.0
* Clean Gemfile (remove over-specificication of runtime deps of
  puppetlabs_spec_helper)

Change-Id: Ice356e35a65204a62e47f49dd4f5816208a6dace
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-31 12:13:33 +02:00
Mathieu Gagné
4d3e668360 Improve openstacklib::db::mysql test coverage
* Add tests for openstacklib::db::mysql::host_access
* Add tests for other overridable parameters in db::mysql
* Do not test implementation details of host_access from
  within openstacklib::db::mysql tests.

Change-Id: Ifcf3820a575f932313a62b9d294ebd92a5055cf5
2014-09-29 17:12:08 -04:00
Mathieu Gagné
7467b6aaa2 Greatly reduce code duplication in rspec tests of db::mysql
Use shared examples to avoid duplicating tests for both platforms.

Change-Id: I16a77a284070e243c2a46675af419e635a139969
2014-09-29 16:27:29 -04:00
Mathieu Gagné
a71ac3d371 Use host_access to provision mysql_user and mysql_grant
Improve logic to be able to reuse host_access for both the initial
mysql user/grant and the additional ones for allowed_hosts.

Change-Id: Ia42833a99ee0fab41a571cccaeb31f740176fce3
2014-09-29 16:18:34 -04:00
Colleen Murphy
dd25406b9e Add db::mysql and db::mysql::host_access to openstacklib
The openstacklib::db::mysql resource is a library resource that can be used by
nova, cinder, ceilometer, etc., rather than replicating equivalent
functionality across all of these modules.

This resource reimplements most of the functionality of the puppetlabs
mysql::db resource. The primary purpose of writing this code from scratch
rather than using the mysql::db resource is to allow the use of a password
hash rather than a plaintext password as a parameter. Other differences from
the mysql::db implementation are:

* It does not have an ensure parameter, we will assume the db should be present
* It does not accept and execute arbitrary SQL because the db sync exec manages
  the state of the db
* It does not use ensure_resource because the database and user should only be
  created from within this resource and creating them elsewhere should be an
  error

Implements: blueprint commmon-openstack-database-resource

Change-Id: I76bd93d1579179932d1f48cea4bb80a2576a7fba
2014-07-15 10:27:28 -07:00