Commit Graph

147 Commits

Author SHA1 Message Date
Ghanshyam Mann fb7c035bf3 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: I07e16dd10769a13ae587b94f1387efacda01fdb2
2024-02-17 20:52:17 -08:00
Lance Albertson d50c4ad40d Chef 17 support
- Require Chef >= 16.0
- Enable unified_mode
- Update to latest upstream cookbooks for etcd, mariadb and memcached
- Update copyright years

Depends-On: https://review.opendev.org/c/openstack/openstack-chef/+/813950
Change-Id: Ib410ed28388725751a6295c58ce1f5e89c529b28
Signed-off-by: Lance Albertson <lance@osuosl.org>
2021-10-13 23:28:32 -07:00
Lance Albertson 8d07e9acee Cookstyle 6.19.5 fixes
Also remove unused database resources that somehow got imported in
https://review.opendev.org/701027.

Change-Id: I5241e0f1eb3bf44158bc64019a3880d83a6d4bdc
Depends-On: https://review.opendev.org/756168
Signed-off-by: Lance Albertson <lance@osuosl.org>
2020-10-05 17:02:11 -07:00
Lance Albertson 4882fb05bb Workaround issue with >= 16.5 when requiring `addressable/uri`
A change made in 16.5 causes an issue when trying to require `addressable/uri`.
This has been filed upstream with this issue [1]. As a workaround, it seems
using `autoload` fixes the problem.

[1] https://github.com/chef/chef/issues/10452

Change-Id: Iae337a8ff1784c46e8171fc54eb00ef28f11561a
Depends-On: https://review.opendev.org/753102
Signed-off-by: Lance Albertson <lance@osuosl.org>
2020-09-21 10:51:14 -07:00
Henrique Santos 455790e1e9 Adds provides method to define name of resources
In Chef Infra Client 16.2, resources have to be named using the provides
method. The resource_name method has not been changed in order to be
compatible with Chef Infra Client <16.2.

Also fix URI.encode and URI.decode deprecations.

Update etcd depends to ~> 6.0 to fix Chef 16 deprecation warnings.

Depends-On: https://review.opendev.org/747503
Change-Id: I24be89a3214207bac2df9eb360124871e0d8242f
Closes-Bug: #1886985
Signed-off-by: Henrique Santos <hfigueiredosantos@tecnico.ulisboa.pt>
Signed-off-by: Lance Albertson <lance@osuosl.org>
2020-08-27 16:50:23 -07:00
Lance Albertson a45cea15d7 Updates for Train
Added:
- Placement service

Changed:
- Update release to train
- Cookstyle fixes
- Update to mariadb ~> 4.0

Removed:
- Unused rubocop rules

Fixed:
- ChefSpec for wrapper now correctly works with node.role?

Depends-On: https://review.opendev.org/731849
Change-Id: I3e809350541e9c7beab311e5b3e768df1612d9f5
2020-05-29 17:29:10 -07:00
Lance Albertson abab7d0ecb Stein fixes
- Switch to Stein release
- Cookstyle fixes
- Update cookbook etcd to ~> 5.6
- Update README
- Add myself to author list and OSU Copyright
- Properly fix completions recipe and ensure it works
- Create and start the etcd service in the etcd recipe
- Update delivery configuration to exclude integration cookbooks
- Refactor and update RenderConfigFileMatcher to work with newer
  ChefSpec. This fixes output which was passing but showing error
  messages.

Depends-On: https://review.opendev.org/701027
Change-Id: Iba3eeabe85ab9303147e43eeb550212a46d190f3
2020-03-19 10:52:29 -07:00
Lance Albertson ea8684d2cf Switch to using mariadb user and database resources
This updates the mariadb cookbook dependency which pulls in mariadb_user
and mariadb_database resources that do not require the mysql2 gem. In
addition, this removes all of the imported mysql libraries and resources.

Other fixes include:
- Rename openstack_common_database resource to openstack_database
- Convert LWRP to a custom resource

Change-Id: I723740b53fe772cf17e65acfb62d5f82e107b7ea
2020-02-27 15:37:45 -08:00
Lance Albertson 4000e8aa96 Improve ChefSpec test speed by enabling caching
This updates all references of let(:chef_run) to cached(:chef_run) to speed up
tests. By doing this, we have to create a new cached(:chef_run) block whenever
we need to adjust node attributes for testing.

Some additional fixes include:
- Add default['openstack']['common']['search_count_max'] attribute to allow speed
  ups during testing.
- Improved a few tests
- Adjusted some formatting
- Remove deprecated ChefSpec::Coverage.start function
- Show warnings
- Use major version for redhat platform
- Update to Ubuntu 18.04

Speed was improved from 4 minutes 16 seconds to 41.98 seconds.

Change-Id: Icb9147036a01f92ec48a24c692dd022258e294c0
2020-01-06 11:34:18 -08:00
Manuel Torrinha cace34613e Fixes issues with `rabbit_transport_url` method
When using rabbit_transport_url in a multi node environment, the address
used is the bind_address if we do not use a mq cluster, where it should
be the rabbit server endpoint hostname, if not we can end up with some
transport_url configurations as rabbit://<...>@0.0.0.0:<...>, if the
rabbit server is configured to listen on all interfaces.

Change-Id: I617f54030ca3610638e6fd1bd3215dc2e7b23841
Signed-off-by: Manuel Torrinha <manuel.torrinha@tecnico.ulisboa.pt>
2019-10-23 17:29:45 +01:00
Jens Harbott 29e07f27b2 Clean up URI handling
The two functions auth_uri_transform() and identity_uri_transform()
implicitly assume that the identity endpoint has no path component other
than 'v2.0'. This blocks modern deployment designs, so drop these
functions.

Probably will need some dependencies to clean up consumers of these
functions.

Change-Id: I711ff0c0f8d35c581d2a419debe50425ec0d51c2
2019-07-17 08:18:17 +00:00
Jens Harbott 6fd3db1717 Drop admin endpoints
The admin endpoints offer no special functionality, users may talk to
the public endpoints instead. The only historic use case has been the
keystone v2 admin endpoint, but with keystone v3 API, even that is no
longer needed.

Also drop the attribute for setting an auth version, as keystone only
supports v3 now.

[0]
https://opendev.org/openstack/openstack-chef-specs/src/branch/master/specs/ocata/all/drop-admin-endpoints.rst

Depends-On: https://review.opendev.org/656289
Depends-On: https://review.opendev.org/656514
Depends-On: https://review.opendev.org/656518
Change-Id: Id8fa969af80bcb1cb6f3ce743b1861f26c36523f
2019-04-30 13:55:33 +00:00
Samuel Cassiba 34c61367ae Increment etcd to 5.5
- etcd does not take any arguments. the default is create.
- remove use_inline_resources in preparation for custom resources

Change-Id: Ic9c98978587cf81bfd430bd5b712cf537c3fb9a0
Depends-On: I161af1074cd17f2e3d2d2cf0b37a0c5fa1015fd3
2018-07-16 15:17:21 -07:00
Samuel Cassiba 7740328325 Simplify identity endpoint
Per the Keystone Install Guide[1] the admin endpoint is superseded in
favor of a single public endpoint. As a result, the admin endpoint is no
longer deployed by default.

[1] https://docs.openstack.org/keystone/queens/install/keystone-install-ubuntu.html#install-and-configure-components

Change-Id: Ied0fb46ae8c10273fde31691b910dc2748845faf
Implements: blueprint simplify-identity-endpoint
2018-06-14 21:05:25 -07:00
Samuel Cassiba b2881c3a80 common refactor for Pike and Chef 13
- changed the default RDBMS to MariaDB in accordance with install docs[0]
- removed deprecated database, apt and yum cookbooks
- incorporated `database' and MySQL-specific abstractions from database
  cookbook
- implemented foodcritic and cookstyle corrections
- deprecated node.foo.bar method access for node['foo']['bar'] bracket syntax
- updated default recipe for core apt resource
- use /etc/apt/apt.conf.d on Ubuntu instead of passing the dpkg overrides as
  command line options in every cookbook

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

Implements blueprint modern-chef

Change-Id: I143e0ed0a2bdd76269fc0c402052696426d96d81
Depends-On: I00e2237cef0c9aa35f78d3ccec04a1c7b9271ce8
Depends-On: I7ee0f5eae4e79e5c70ee8de4a0094a7c34fdd18f
2018-01-11 17:42:41 +00:00
Roger Luethi d232f34b4c Extend openstack_command
This patch extends openstack_command to accept an array in addition to a
string as an argument.

This allows the use of openstack_command in cases where an argument
contains protected spaces.

Examples:

mistral execution-create my_workflow \
    '{"names": ["John", "Mistral", "Ivan", "Crystal"]}'

barbican secret list --name chef_test_secret --format value -c"Secret href"

Without this patch, all arguments have to be passed as a single string
which openstack_command splits on white space regardless of any
quotation marks. Therefore, the examples above will fail.

Change-Id: I0419a1526beb103839a3cf235eba6c41d9d946d5
Closes-Bug: #1723949
2017-10-20 12:26:29 +02:00
Samuel Cassiba ffbf83d17f Initial common Pike updates
- Bumped chefdk to 1.6.1
- Switched release to pike
- Added is_release attribute for testing, defaults to false
- Added RDO deps repo for testing pre-release packages
- Added ubuntu-cloud proposed repo for testing pre-release packages
- Switched the default linter to cookstyle
- Normalized the banner message
- Dropped pip installation method for python-openstackclient since the
  packages are fresh enough

Change-Id: I7a67ba2520b8e44efec6edd8506f96b0e0dc913b
2017-09-11 23:38:26 -07:00
Samuel Cassiba 479af11fd7 Fixes for Ocata, define socket for MySQL
- bumped chefdk to 1.5
- bumped mariadb to 1.5
- style fixes to make rubocop/foodcritic happy
- rewrote metadata.rb for readability
- removed ancient Gemfile
- removed openshift rubygems mirror since it doesn't help us

Change-Id: I950605f384405b55737af77bc4224f1e18fee8e1
2017-08-02 16:24:48 -04:00
Christoph Albers b6f06c34af Transport url fix
- added possibility to add more then one rabbit host
- edited rubocop constraints due to transport_url complexity

Change-Id: I9540b40c0dba46a62c21242b94089b81921700ca
2017-01-09 04:25:57 +00:00
Christoph Albers 57fa9ecef7 Tempest / Integration fixes
- added needed attributes to get glance image id
- edited specs in favor of identity v3

Change-Id: I9b87834190f013191cddaeffd1547278543e0dad
2017-01-02 15:36:24 +00:00
Christoph Albers 6401b89019 RPC_backend / transport_url workover
- added rabbit_transport_url method to endpoints library
  usage i.e for block-storage will be
  node.default['openstack']['block-storage']['conf_secrets']
       ['DEFAULT']['transport_url'] = rabbit_transport_url 'block-storage'

Change-Id: I0a6da37e3f2b839590b6349fd906d47c5206fbb3
2016-12-13 15:28:51 +00:00
Samuel Cassiba da21e16aa0 Convert command line clients to openstackclient
A prerequisite for Newton is to move to openstackclient for interfacing
with the OpenStack services.

Change-Id: I80a10bc1a3a50501306c16e278b960e43e9e9a59
Implements: blueprint openstackclient
2016-08-02 22:25:35 -07:00
Samuel Cassiba 51ac5f8b9f Style and lint fixes to support newer ChefDK
- bumps ChefDK release to 0.15.15 in bootstrap

Change-Id: I6ce4587caa3ae68ddbd3ef1a521aaf46f4840b2c
2016-07-01 18:16:19 -07:00
Mark Vanderwiel 7a51c3b952 Add some debug output for cli's
Add debug output for cli results.

Change-Id: Ief6b040970017b734eaec0932014e56d68d52109
2016-05-11 16:52:25 -05:00
Jan Klare 323bf575b7 added helper method bind_address
* helper method bind_address should return the address for a given service
config, if an :interface is defined, it should return the address on the
interface, else it will just return the :host

Change-Id: I80ba506f7d9a745c3f4c47a78099199195abd9ad
2016-02-23 11:36:36 +01:00
Jan Klare e198fd4eab invert the order of endpoint and bind_service attributes
* endpoint type (admin, internal, public) and service (identitiy, network etc.)
  was switched during refactoring, this patch reverts this unintended switching

Change-Id: Iec485deaf415e4187a323435cce2b6bbadfc5d42
2016-02-12 20:13:24 +01:00
Jan Klare 1858c025b2 library cleanup and refactoring
* version bump to 13.0.0 for mitaka release
* removed suse support
* removed general endpoint method, since we should be able to always specify
  which endpoint we need
* removed fallbacks in specific_endpoint method, since this behaviour is not a
  very obvious one to the user and it should rather return an error than an
  unexpected result
* dry public, internal and admin endpoint methods
* removed obsolete private methods
* adapted method calls for admin_endpoint in libraries/cli.rb
* refactored set_endpoints_by_interface recipe to directly call address_for
  instead of address, since the recipe already checks for an existing attribute
  ..['bind_interface'] and therefore address would redirect to address_for
  anyways
* moved the nested hash order for the public, internal and admin attributes to
  to be more clear and to break all existing calls to fix them during the
  refactoring process of all cookbooks
  e.g: node['openstack']['endpoints']['internal']['identity'] is now
  node['openstack']['endpoints']['identity']['internal'] and can be moved into
  the identity cookbook. This also streamlines these endpoint attributes with
  the bind_interface and host attributes
* removed dependency on openstack-identity cookbooks by moving openrc recipe to
  opentack-identity (same for corrensponding specs and template)
* removed address method and use the address (or hostname) defined in the
  endpoints hash directly (logic to set this attribute should rather be
  done in a wrapper (with a fitting method) instead of a static and predefined
  one)
* removed set_endpoints_by_interface recipe since logic for defining the
  endpoints will be moved to wrapper cookbooks
* added helper method merge_config_options for generation of config hashes used
  in service config templates
* added template for openstack-service.conf.erb which can be used by all service
  cookbooks
* deleted all endpoints attibutes, since these are moved to the service
  cookbooks for easier dependency handling

Implements: blueprint cookbook-refactoring
Change-Id: I0547182085eed91d05384fdd7734408a839a9a2c
2016-02-05 08:38:07 +01:00
JJ Asghar 9218fee097 Initial Liberty Updates
MetaData Changes:
- bump metadata version to 12

Other codes changes
- change juno to kilo where appropriate
- rubocop todo file updates
- removed db2 refs

Bootstrap Changes
- Updated to 0.7.0 release of the ChefDK

Change-Id: I65745eae2e430ced0c25e8f05dd490fdad840623
2015-08-28 09:43:49 -05:00
Jenkins 2955ee7ac3 Merge "Add database slave connection support" 2015-08-15 20:48:16 +00:00
Min Min Ren 375cdcde14 Add database slave connection support
- Add new attributes for database slave connection
- Change db_uri method to generate slave connection db_uri

Implements: blueprint sql-slave-connection-support
Change-Id: I9996e4944e58264b5195d625c98adaf28a04acd7
2015-07-16 21:45:22 -05:00
Jens Rosenboom fe58d5394e Add failure for missing interface
This will fail with a useful error message in case the interface we are
trying to get an address for does not exist. Currently the user will
only get an unspecific "undefined method [] for nil" error.

Change-Id: I392564324fb5203df3ce390aff990ff976058320
2015-07-16 16:53:40 +02:00
Jan Klare e7b8676b0d add support for percona-cluster as db backend
- added percona-cluster as option to the proper openstack attributes

Change-Id: I0ccdc6efbdfa3d72bdc63a49b3cd0fd1630babe1
Implements Blueprint: galera-and-percona-support
2015-07-06 10:28:24 +02:00
Mark Vanderwiel f92bb380fd Replace deprecated get_secret
Use get_password 'token' instead.

Change-Id: I9c60955fe4ed444b9cd70384fa8fb7829b1f0c47
Partial-Bug: #1467662
2015-06-23 09:00:31 -05:00
Min Min Ren 2785880a8c Add galera-mysql cluster support openstack-common
1. Add a new db service_type as 'galera'
2. Reuse compatible code for mysql to support 'galera'

Change-Id: I7de9a7eab3523d8acdf4627a571335b59be0e0ee
Implements: blueprint galera-and-percona-support
2015-06-16 20:35:11 -05:00
Jan Klare 2aa0ab9115 replaced libraries/database with lwrp
- defined lwrp openstack_common_database
- removed libraries/database.rb
- created _openstack_common_database_spec.rb recipe for testing the
  provider
- comments for db2 in provider since this resource does not exist in any
  availabe or linked opensource cookbook
- updated README.md

related-Change-Id: Idb47c9b7e3ce954ddd1a544b71b96eed734e46e5

Change-Id: I1940cd63aa1ae95586e6ecbed9476f7ce5fe19ab
2015-06-08 10:58:13 +02:00
Mark Vanderwiel fc217f6ce4 Cleanup minor rubocop offenses
Cleaned up all the minor rubocop issues, the ones left relate to
complex logic and what I think is a bug in rubocop for nested
vs compact modules/class definitions.

Change-Id: Ic0c0677de44642e0994c0b95a3c270cbd4749b40
2015-06-02 11:45:59 -05:00
Jan Klare 6e0b3f2ce3 refactor libraries/network.rb
- splitted the address_for method into address_for and get_address
- added the option to search for an address from another node
- added an optional filter for virtual ips in get_address
- refactored network specs

Change-Id: I4678969045b317071296b1d7dc8e7d13505f4db7
2015-05-08 11:42:15 +02:00
Mark Vanderwiel 348aaf4033 Move role and recipe include methods to Common
These small wrappers are now needed by other cookbooks. They
provide a easy way to create a clean spec test.
Will put these into the Common openstack library module namespace
for easy use across the cookbooks.

Added common role defintion for compute worker.  Eventually all
the role definitions should be moved here.
Added new spec for these wrappers.

Change-Id: If548a9d63a42799e1401b18540878eca5ba2a0e1
Related-Bug: #1448255
2015-04-28 10:51:42 -05:00
Mark Vanderwiel 5e37dea389 Fix render_config_file with_section_content to handle dup sections
Since duplicate sections are allowed within openstack conf files,
need to be able to handle them in some cases.  The first case of
this is in network where the ml2 conf is including the openvswitch
conf within it and there are a couple dup sections.  This
allows the spec tests to handle those cases.

Change-Id: I8d2733a248a6a13ab87c286ff620c71955726f86
Closes-Bug: #1444696
2015-04-15 16:22:52 -05:00
Mark Vanderwiel 22d8885367 Add identity_uri_transform to help move to identity_uri
Starting on the identity_uri blueprint.  A difference
between the public auth_uri and the admin identity_uri is that
the identity_uri does not include the path/version (/v2.0).
And the auth_uri has to modify the version depending upon
the needs of the environment.
There existed a helper routine called, auth_uri_transform, so
to be consistent and make this easy to follow, I created a
identity_uri_transform which simply removes the path/version
from the uri given.

This helper will then be used thru out the cookbooks to make
the switch to the identity_uri very easy.

I guess the alturnatives are messing with our generic endpoint
definitions/methods, but since they are used for many different
purposes, I think having another matching transform method is the
right way to go here.

Bumped version for adding new method which other cookbooks will
depend upon.

Change-Id: I035a4491945c600dea8feb317b357a1a69da28cd
Implements: blueprint identity-uri
2015-03-27 09:50:39 -05:00
Yi Ming Yin 79b561353f Add mariadb database support to openstack-common
1. Add a new db.service_type as 'mariadb'
2. Reuse compatible code for mysql to support mariadb
3. Set mariadb as default database type for RHEL family

Change-Id: Ib537dc921b6e9d05cb79ef3e95dac558a7180816
blueprint: mariadb-support
2015-03-25 22:03:34 +08:00
Mark Vanderwiel ea8dfaa401 Initial kilo updates
MetaData changes
- bump metadata versions to 11

Gemfile changes
- bump robocop to 0.29.1
- bump chef to 11.18.6  close to 12 but not quite (need infra changes for 12)
- bump berks to 3.2.1 to get fix for running twice (destination already exists)

Rubocop changes
- add .robucop_todo.yml for future cleanup
    - rubocop --auto-gen-config and add an inherit_from: .rubocop_todo.yml in your .rubocop.yml
- add .bundle/**/* to .rubocop.yml
- add .cookbooks/**/* to robocop.yml
- fixup berks-cookbooks/** with /**/*

Changelog changes
- delete Changelog.rb

Other codes changes
- change juno to kilo where appropriate
- cleanup any obvious old deprecated code

Change-Id: I146aa7f7ba4024115c1297103e176a72336fbe5d
Partial-Bug: #1426424
2015-03-04 08:30:52 -06:00
Jenkins 62aafd5602 Merge "Fix up some files modes" 2015-02-14 22:18:59 +00:00
Mark Vanderwiel 89c99e47be MySql cookbook ver 6 changes
mysql cookbook is now provider driver, and no longer has default
attributes, like server_root_password.
For the password, now always using the Common password methods.
Therefore the ['openstack']['db']['root_user_use_databag'] attribute
was removed, it's now the default path.

For the other mysql attributes we used, these were moved into the
ops-database cookbook.  See that patch for more info.

This patch requires updates to the database and mysql-chef-gem cookbooks.

Change-Id: I817030cd7fb56cb025e1a8e21dc2b956b0ad7911
Implements: blueprint trusty-juno
2015-02-13 08:11:49 -06:00
Mark Vanderwiel acae85611f Fix up some files modes
Correct some source files to mode 00644

Change-Id: I58a11ce44eea995be35a65f613f9e4a0cb440b51
2015-02-06 15:16:49 -06:00
Mark Vanderwiel 3c55a8fc31 Fix bug wth missing username on database_user resource
I missed a commit with last change to this part.  The
change was to make the resource unique, but the username attribute
was not added to the resource so it will fail.

Change-Id: I78e84078ab1f1e2919131a6a443a14d8815c02a6
Related-Bug: #1409921
2015-01-30 11:56:36 -06:00
Jenkins f361c37b89 Merge "Cleanup CHEF-3694 cloning warnings" 2015-01-29 20:11:28 +00:00
Ken Thomas 8d73989865 specific_endpoint can return incorrect values
There's a bug in the common library specific_endpoint routine that
was just merged. If there's a defined endpoint for any one of the
specified types ('internal', 'admin', 'public') it causes the code
to incorrectly think that any name of that same type actually
exists.  This leads to an empty string being returned rather than
picking up the general endpoint.

For example:
['endpoints']['admin']['foo'] has been set
['endpoints']['bar'] has been set

The admin_endpoint('bar') routine should see that there's no 'bar'
under 'admin' and return the general endpoint. Instead, it's
returning an empty string simply because there's an 'admin' subhash
there for 'foo'.

Change-Id: Ifd4ee6108b4c7b0f66bd56cc817b5ea646e82a68
Partial-Bug: 1412919
2015-01-27 20:03:36 +00:00
Mark Vanderwiel 15eddd2a78 Cleanup CHEF-3694 cloning warnings
Use unique name for database resources.

Change-Id: Ibff252c7e35d532cd2ad133068387701ef9bb2c4
Partial-Bug: #1409921
2015-01-26 10:26:33 -06:00
Ken Thomas 0bd8983212 Allow different URLs for internal/public endpoints
Provide new endpoint routines for admin_endpoint, internal_endpoint,
and public_endpoint. These will allow folks to specify different URLs
for those endpoints if they wish.

This is the first part of the fix. After the routines have been merged,
I'll start working on using the routines in the various component
recipies.

Change-Id: I5b3b90324ee0f9bf6b2c5278ad60724856d43321
Partial-Bug: 1412919
2015-01-21 22:29:08 +00:00