Commit Graph

64 Commits

Author SHA1 Message Date
Ghanshyam Mann 9460c5eb70 Retire openstack-chef: remove repo content
OpenStack-chef project is retiring
- https://review.opendev.org/c/openstack/governance/+/905279

this commit remove the content of this project repo

Depends-On: https://review.opendev.org/c/openstack/project-config/+/909134
Change-Id: I4892478f3e2397820e354ff15859fb992b3512e4
2024-02-17 20:49:57 -08:00
Lance Albertson ee28b08a57 Chef 17 support
- Require Chef >= 16.0
- Update to latest upstream mariadb cookbook
- Update copyright years

Depends-On: https://review.opendev.org/c/openstack/cookbook-openstack-common/+/813952
Change-Id: I4b0417acb75f10dd9a1c0a22fadcd1d849f045b9
Signed-off-by: Lance Albertson <lance@osuosl.org>
2021-10-14 09:01:42 -07:00
Christoph Albers 7190cf204c
fix gather data for data interface
- get information from the actual node attributes instead of the
  executing node

Change-Id: I2f65f28802581184cd47e7c37d21dd71e97a2c3f
2021-01-25 11:12:56 +01:00
Zuul fd0bdcb7e5 Merge "Add notify to mariadb_galera_configuration" 2020-10-13 05:20:58 +00:00
Jens Harbott 66135da448 Add notify to mariadb_galera_configuration
Need to trigger a restart after changing the galera configuration.

Change-Id: Ie148e8dce2e945ea956f6521c04bfc031f9da3f2
2020-10-12 12:36:10 +02:00
Lance Albertson f3c9fca120 Cookstyle 6.19.5 fixes
Depends-On: https://review.opendev.org/756168
Change-Id: Ia379098ac40eee7a6627fe10b9320ff59468391f
Signed-off-by: Lance Albertson <lance@osuosl.org>
2020-10-05 17:04:22 -07:00
Christoph Albers 6ae2f275b1
mariadb server config utilization
- allow overriding of some common config options

Change-Id: Ie832477216df5c1b0b94d75ba1ee6cc1bf968219
2020-09-22 11:55:37 +02:00
Jens Harbott 7ed8573899 Fix mariadb repo setup
Instead of always creating the mariadb default repository we should
only do it when requested by the node environment.

Do this implicitly via the mariadb_*_install resources that have
an option to decide whether a repo should be set up or not.

Change-Id: I4f62dd7a7df247ddb787553bef58ca81d8e062fb
2020-09-17 10:09:14 +02:00
Lance Albertson 0b08fc6142 Chef 16 updates
Depends-On: https://review.opendev.org/740342
Change-Id: Ic6385a7cb14d1f036b0cf1a6d92ecf5930f271fb
Signed-off-by: Lance Albertson <lance@osuosl.org>
2020-08-27 15:11:59 -07:00
Christoph Albers 75e4ccfae2
fix mariadb galera config
- the mariadb config looks for the first address on the wsrep_node_address_interface
  this will lead to missconfigurations when using virtual IPs - drop it
- mariadb uses when wsrep_node_incoming_address not defined bind-address
  or wsrep-node-address in that order. Since bind-address has to be
  defined by our cookbook logic, the drop of
  wsrep_node_address_interface is no problem

Change-Id: Ic3442522e8f6e02244e653017b6d161a96412425
2020-08-05 12:26:55 +02:00
Lance Albertson 38d0a27c66 Updates for Train
Changed:
- Update release to train
- Update to mariadb ~> 4.0

Fixed:
- Migrate to using Chef::Log.warn instead of the log resource to fix
  idempotency issues.
- Cookstyle

Removed:
- Unused .rubocop.yml

Depends-On: https://review.opendev.org/731851
Change-Id: Ia705cf4fb00098ba5d34f22268c0e409b82580a0
2020-05-29 17:13:44 -07:00
Dr. Jens Harbott 601c814995 Fix mariadb-cluster-server recipe
The hadn't been changed yet to use the resources provided by the new
mariadb cookbook. Also add spec testing.

Change-Id: Ib49cab07c06c4441ae811ca811f614e303024b0b
2020-04-07 14:34:39 +00:00
Lance Albertson c72c025288 Remove support for mysql
Upstream distributions have settled on using MariaDB instead of MySQL
and it's becoming more and more difficult to maintain on our end. As
such, we're removing support from this cookbook for MySQL and only leave
MariaDB as the supported platform.

Change-Id: I104de18ecab5ba64f08fd39314e565ab0483c558
2020-03-30 13:50:33 -07:00
Lance Albertson 93e7380abf Stein fixes
- Cookstyle fixes
- Update documentation
- Add myself as an author and add OSU for Copyright
- Update delivery configuration to exclude integration cookbooks

Depends-On: https://review.opendev.org/701027
Depends-On: https://review.opendev.org/706101
Change-Id: Ib2ccf949d5f5bced0f6efd32b09780469316b831
2020-03-19 10:56:43 -07:00
Lance Albertson 8747a1cf96 Update to latest mariadb cookbook
This updates us to a new resource driven mariadb cookbook which
simplifies how we manage mysql. Other changes:

- Update to using MariaDB 10.3 instead of 10.1 as we need this for Stein
- Update attributes so they work better with the
  mariadb_server_configuration resource
- Remove use of the mysql2_chef_gem cookbook as it's no longer needed
  and causes issues with newer versions of MariaDB and MySQL.
- Remove use of the openstack.cnf template since we can add all
  configuration using the mariadb_server_configuration resource
- Remove RHEL mariadb-server ChefSpec as it's not needed
- Update openstack-db recipe to use the openstack_database resource
  instead of the openstack_common_database resource which was renamed

Depends-On: https://review.opendev.org/710351
Change-Id: Ia5b401cafcdf57aa84e090c745bd3e517c7251bf
2020-02-28 11:45:42 -08:00
Samuel Cassiba 0eec9ecac8 Chef 14 stable release updates and fixes
This change corrects some of the issues with resource naming[1] as well
as prunes some failing unit tests that would be obsoleted with the changes
in the service renaming[2].

[1]: https://docs.chef.io/ruby.html#use-of-hyphens
[2]: https://review.openstack.org/#/q/topic:chef_14_fixes+(status:open+OR+status:merged)

Depends-On: Ic2b6d8f1cdf719791faaebdbd7e29e789eb3f31c
Change-Id: I8efc34c220fec59826bbea51e3ebf3fbc0e5b530
2018-12-20 21:45:30 -08:00
Samuel Cassiba 2fd2b86adb Increase default connect timeout for mariadb
The mariadb cookbook imposes a default connect_timeout of 5 seconds.
This is too aggressive for services to initialize, and they error as a
result. To avoid such problems, mariadb should allow for a higher
threshold before timing out a connecting service. This change raises
that timeout to 30 seconds to be more graceful for services warming up.

Change-Id: I70775929dc49ed8c00a23bc7e354ebf9e9feb7f0
2018-06-14 13:23:19 +00:00
Jens Harbott 3731993f6a Add receipes for mariadb cluster deployment
After removal of the percona cluster receipes, add support for deploying
a galera-based mariadb cluster instead.

Change-Id: I7e4d0fc804be242302d2e7b7202159d4b7ba8c97
2018-01-12 10:24:20 +00:00
Samuel Cassiba 45a1623cb2 ops-database refactor for Pike and Chef 13
- implemented foodcritic and cookstyle corrections
- deprecated node.foo.bar method access for node['foo']['bar'] bracket syntax
- removed deprecated postgresql support
- removed percona-cluster as the Percona cookbook has not been touched since 2015
- switched default rdbms to mariadb[0]

This change was largely born out of a discussion in #sous-chefs on the Chef
Community Slack. The notion of using the vendor-provided package is preferred
in the Chef Community versus the distro version if possible, due to
inconsistencies in outcome. As a result, this cookbook focuses on MariaDB, and
specifically from mariadb.org.

[0]: https://docs.openstack.org/install-guide/environment-sql-database.html

Implements blueprint modern-chef

Change-Id: I7ee0f5eae4e79e5c70ee8de4a0094a7c34fdd18f
2018-01-11 10:36:09 -08:00
Samuel Cassiba b876cd00e5 Initial ops-database Pike updates
- Switched default linter to cookstyle
- Renamed rake tasks to better conform with Chef conventions
- Normalized template banner

Change-Id: I76bdb4149965ab7b23709762559bd6c71753cc8b
2017-08-25 09:58:14 -04:00
Samuel Cassiba fe6a3d552c Style and lint fixes for chefdk, deprecated Gemfile
- Style and lint fixes for newer chefdk
- Removed ancient Gemfile
- Rewrote metadata.rb for readability
- Adapted mariadb recipe for newer mysql2_chef_gem

Change-Id: I3112615cec3dd80c63779d164893b4171773856c
Depends-On: I950605f384405b55737af77bc4224f1e18fee8e1
2017-08-02 13:26:22 -04:00
Jan Klare f61fca474d remove old chefdk fix for https://github.com/chef/chef-dk/issues/966
Change-Id: I0717e97c3effaffebb19e63ec6a78f2e1b7aa80d
2016-12-14 15:28:29 +01:00
Samuel Cassiba eb3c4081f1 Incremented MySQL to 5.7 for Ubuntu
- mysql default version is 5.7 on Ubuntu 16.04
- included mysql devel headers for mysql2
- incremented mysql cookbook to 8.0
- incremented database cookbook to 6.0
- pinned mysql2 gem at 0.4.4

Depends-On: I57c8729e8732161ac34caa85259de8264e99c56d
Implements blueprint newton-xenial

Change-Id: I8ee882d5b154ec0d319e6c4186ebf9f8ae68f269
2016-10-18 23:19:32 -07:00
Samuel Cassiba 3a0d36aa5a Increment mysql cookbook version
- Bump mysql to 7.2
- Bump mysql2_chef_gem to 1.1.0
- Work around https://github.com/chef/chef-dk/issues/966
- fixes minor bug in postgres-server_spec and server_spec

Change-Id: I6e906c5fad0360a7d9718fc5d5cda2983c3b768e
Depends-On: I07ad79a93642d0f0c934a864fcb9bcd7b764e35f
Implements: blueprint newton-xenial
2016-09-27 19:53:51 +00:00
Samuel Cassiba 57042a006e Style and lint fixes to support newer ChefDK
Change-Id: I7b8521a85bace612911f967fe4e35269b7b47034
Depends-On: I6ce4587caa3ae68ddbd3ef1a521aaf46f4840b2c
2016-07-01 18:10:31 -07:00
Jan Klare 794dc2050a percona cluster nodes should be sorted
* the nodes written to the my.conf returned from search should be sorted to
  avoid restarting mysql just because reordering the nodes in the template

Change-Id: I3cd70ca818be18f926b384feb1a592cb3b137ccd
2016-03-14 11:58:40 +01:00
Jan Klare 856c3a24ab add percona-cluster recipes
- add recipes and specs to deploy percona-cluster as db backend

Depends-On: Iae7e302973805af3cb44be1b29d0e61e76eb0aa0
Implements Blueprint: galera-and-percona-support
Change-Id: Ie69e71dce8fa22ef5edc17ed094840fcfb9d4c82
2016-02-24 14:36:01 +00:00
Jan Klare 866dfbb3af use bind_service attribute instead of endpoints
* adapted server recipes to use the address and port defined in the bind_service
  attribute instead of the endpoint (endpoint can be different and should only
  be used by the services connecting to the db)
* changed get_password 'user' to 'db' for consitency with common


Depends-On: Iae7e302973805af3cb44be1b29d0e61e76eb0aa0
Implements: blueprint cookbook-refactoring
Change-Id: I0afb5942c38ed4e20037f553879de8e2c1a1f75f
2016-02-23 21:38:30 +00:00
Jan Klare 69ae909123 adaptions to work with refactored cookbooks
* adapted mariadb, mysql and postgresql server recipes to work with net endpoint
  logic
* removed suse support

Depends-On: I0547182085eed91d05384fdd7734408a839a9a2c
Impements: blueprint cookbook-refactoring
Change-Id: Ia7fd927f42f4a1e484e8f2d34c52b1dc6d0ce6dd
2016-02-08 10:31:51 +01:00
Jan Klare 1886e38a03 switched from db_create_with_user to lwrp openstack_common_database
- replaced db_create_with_user with lwrp from common
- utilized new common attribute openstack.common.services to
dry recipe
- TODO: create test for rescue log message

related-Change-Id: I1940cd63aa1ae95586e6ecbed9476f7ce5fe19ab

Change-Id: Idb47c9b7e3ce954ddd1a544b71b96eed734e46e5
2015-06-16 21:02:57 +02:00
Yi Ming Yin 9a864936c4 Add mariadb database configuration support
1. Add 2 new recipes to configure mariadb client and server
2. Partially reuse existing code for mysql support
3. Add delete empty user and users with empty password workaround.
Current mysql cookbook can do this, but mariadb cookbook doesn't.

blueprint: mariadb-support
Change-Id: I034cedb07f8bf11f271fc351f9a7ad534067b95a
2015-03-27 14:28:35 +08:00
wenchma 6295eb1242 Support db creation for openstack-bare-metal cookbook
Depends on the patch https://review.openstack.org/#/c/148458/

blueprint bare-metal-enablement

Change-Id: I627eb4e5f65bfd377ffee960edbc2f42b9b074cd
2015-03-05 04:48:40 +00:00
Mark Vanderwiel baa3b76fcb MySql cookbook ver 6 changes
mysql cookbook is now provider driven, and no longer has default
attributes, like server_root_password.
For the password, now always using the Common password methods.

For the other mysql attributes we used, these were moved into the
attributes mysql.rb file.

The attribute name space was changed from
[mysql][**attr**]  and [mysql][tunable][**attr**]  to
[openstack][mysql][**attr**]

This patch requires updates to the database and mysql-chef-gem cookbooks.mysql cookbook ver 6 changes

Change-Id: I05d27de80de0371503c5fa71591b4600bbeb2ca9
Implements: blueprint trusty-juno
2015-02-13 08:10:31 -06:00
Mark Vanderwiel 408ad33b3f Cleanup CHEF-3694 cloning warnings
* lookup mysql service resource instead of re-declaring it
* use unique name for flush resource as it's two separate uses

Change-Id: I8746e5001ea5cefc497049111f4d2e5e250f26de
Partial-Bug: #1409921
2015-01-12 15:59:24 -06:00
Mark Vanderwiel a27cfab06e Allow max_connections to be overridden for mysql server
The default of 151 is very small for most openstack use cases.
Picked a higher recommended default that can be overridden as
necessary.
Added stub for newer postgresql cookbook level spec tests.

Change-Id: I0d7b0893d143202f55f04ddcdbc8618aaaacef25
Closes-Bug: #1398527
2014-12-02 15:28:39 -06:00
John Warren 24092e6851 Set mysql root password directly on resource
Set the mysql root password directly on the server resource, so it
does not need to be an attribute.  This keeps passwords sourced from
encrypted data bags out of node attributes. Note that as indicated
in https://github.com/opscode-cookbooks/mysql/issues/215 all recipes
will be removed from the mysql cookbook in favor of having consumers
work with the resources directly, thereby providing more flexibility
in terms of how the various configuration settings are sourced.
Including the "server" recipe is not going to be a viable option
once that has happened, so this change not only addresses the
attribute issue, but it will also make upcoming changes to the
mysql cookbook more seamless.  Note that the reference to the
default_version_for function had to be removed, because it is no
longer in the cookbook and therefore the build failed. It is no
longer necessary to set the version, as described in the README.md
file:

When [the version parameter is] omitted, it will install the
default MySQL version for the target platform.

Note that the code that sets node attributes in
spec/mysql-server_spec.rb was removed because it was interfering
with the new test and it did not seem to serve any purpose--there
were no failures after it was removed.

blueprint no-secret-attributes

Change-Id: I72be1e2131a107ddc43754bc5cf40a4ce7face95
2014-09-16 14:30:45 -04:00
bradkwadsworth 66b73078b0 Update database and mysql dependency.
Now depends on mysql ~> 5.3 and database ~> 2.2.
The mysql-server recipe now uses the mysql cookbook
wrapper method.

Blueprint: move-to-mysql-v5
Change-Id: I74111ead1555c46d32c3e096c380fec27b3ef593
2014-07-15 15:15:49 -05:00
Ionuț Arțăriși 74b71a35a9 use new python_packages attributes from -common
*_python_packages attributes are being moved to -common in order to
remove the duplication from all the cookbooks which are using them

Change-Id: I848690a84f53b3c6c5e54f4b19f56d5494890f1b
Implements: blueprint move-python-db-client-attrs-to-common
2014-07-02 16:05:00 +02:00
Jenkins 8579522b78 Merge "Add ability to specify IP for service" 2014-03-14 16:17:34 +00:00
Jenkins 6d5e7043b4 Merge "Rename openstack-metering to openstack-telemetry" 2014-03-14 02:24:06 +00:00
Chen Zhiwei 786129543f Rename openstack-metering to openstack-telemetry
update cookbook attribute name, change metering to telemetry

Change-Id: I76b1a398a600ba824e379ddbe14309dd3940d0db
2014-03-13 03:45:05 -04:00
Scott Lampert 8b3c4a7b3b Fix mysql-server ignoring root_user_use_databag attribute.
Addresses: bug #1273353

The mysql-server recipe was not checking the
default['openstack']['db']['root_user_use_databag'] attribute to see if
it should use the node['mysql']['server_root_password'] attribute or
check a databag for the mysql root password.

Change-Id: I589f7e43fc1f15c072d3e50dab6cef25f367075b
2014-03-12 16:47:38 -06:00
Chris Dearborn e76386f81c Add ability to specify IP for service
The problem that this change addresses is that the address_for method
will not work correctly if there are multiple IP address associated
with the specified interface.

The approach to solving this problem and moving towards the overall
goal of having one place where service networking information is
stored is to convert address_for calls into endpoints, and add a
address() method to the endpoints interface for IP address resolution.

The address() method has the following behavior: if the
bind_interface of an endpoint is set, then the IP is looked up on
the interface.  Otherwise, the IP specified in the host attribute is
returned.  This allows the caller to choose either method of
determining what IP a service will be bound to.

This initial change switches both the openstack-ops-database and
openstack-ops-messaging cookbooks over to use endpoints instead of
address_for.  The other cookbooks will be switched over time.

blueprint increase-ip-binding-flexibility

Change-Id: I2d1c40ec79a2533be150c5b4ea6e1f396c500e9d
2014-03-10 13:26:13 -04:00
Darren Birkett c2e1b2e539 Fix issue with mysql not restarting on new bind_ip - RHEL/CENTOS
Addresses: bug #1277041
Implements: blueprint centos-rhel-for-ops-database

By default mysql binds to 127.0.0.1. Setting the bind_ip attribute to
something else, as we do in the ops-database cookbook before calling the
mysql::server recipe, causes the my.cnf to be populated with the correct IP.

However, because of this bug in the upstream mysql cookbook:
https://tickets.opscode.com/browse/COOK-4161
mysql does not get restarted (it only gets reloaded)
and so the new bind_ip does not take effect.

This commit adds a workaround until the upstream bug is fixed. The
workaround directly modifies the template resource from the resource
collection to add a 'restart mysql' notification.

** This particular patchset builds on the last by adding support for
rhel/centos which use a different name for the my.cnf template resource **

Change-Id: I357bf1458a1781189922032cdc8da8ad9e0a03a7
2014-02-07 10:26:42 +00:00
Darren Birkett 0ae59969eb Fix issue with mysql not restarting on new bind_ip
Addresses: bug #1277041

By default mysql binds to 127.0.0.1. Setting the bind_ip attribute to
something else, as we do in the ops-database cookbook before calling the
mysql::server recipe, causes the my.cnf to be populated with the correct IP.

However, because of this bug in the upstream mysql cookbook:
https://tickets.opscode.com/browse/COOK-4161
mysql does not get restarted (it only gets reloaded)
and so the new bind_ip does not take effect.

This commit adds a workaround until the upstream bug is fixed. The
workaround directly modifies the template resource from the resource
collection to add a 'restart mysql' notification.

Change-Id: I4f59e9f7fecb5040532948d0bb07d49385280a48
2014-02-06 14:53:11 +00:00
Christopher H. Laco d5d685bfb1 Upgrade/Update rubocop
Now that almost all of the rubocop blueprints have been completed, make
one final pass through all of the cookbooks ensuring they're all in
sync with each other.

- Upgrade rubocop to 0.18.1
- Fix violations caused by 0.18.1 upgrade
- Move Excludes for non-existent folders to Includes so they
  automatically cover future additions

Change-Id: I08e8822a7ad7a5330881c14ffb07db3842bd5d9c
Implements: blueprint lint-and-unit-testing-for-havana
2014-02-04 15:57:23 -05:00
Andy McCrae 11cd04ded1 Update recipes to be rubocop compliant
- Update .rubocop.yml to include recipes/**
- Update recipes to be rubocop compliant

Change-Id: Ibb2113e266427b1d9b509d1e66389462e1ff0189
Addresses: blueprint rubocop-for-ops-database
2014-01-29 10:31:38 +00:00
Matt Thompson 5eaff5f970 Clean up cookbook for bp/clean-up-attr-for-mq-and-db
This change removes the attributes we'll be moving to openstack-common
and changes reference of those attributes to reflect new (more
consistent) namespace.

Change-Id: I5f324ed2494a643d27bb2922361e21f4a1ce2a1f
Implements: blueprint clean-up-attr-for-mq-and-db
2014-01-24 10:53:17 +00:00
Andy McCrae 009969d977 Fix bug on get_password for "heat"
- Add appropriate variables for "get_password" call for heat db.
- Fix stub in spec test to catch this in future.

Change-Id: Ic653dde525bbe7c56e8cf1a6694a06885a1e3c88
2014-01-20 10:30:45 +00:00
Andy McCrae aae68f9848 Move to use "get_password" instead of "{user,service,db}_password"
The user_password, service_password and db_password functions are redundant
since they simply call "secret". Creates a get_password function that will
accept a "type" of db, service or user.

All instances of these calls have been changed to call get_password

Change-Id: I8e1e25e73eb01cbea30435fe7c6c53cab7a15c04
Partial-Bug: #1195915
2014-01-17 16:52:31 +00:00