Commit Graph

12 Commits

Author SHA1 Message Date
Takashi Kajinami 0f7bdd733a replace validate_legacy
the validate_legacy function is marked for deprecation in
v9.0.0 from puppetlabs-stdlib.

Change-Id: I920294342c9c2c0567796f345cbfa9e39bb1f1d3
2023-09-19 13:33:00 +00:00
Takashi Kajinami e0d56b30f6 Fix wrong usage of validate_legacy
The current usage is causing the following error in puppet 8.

validate_legacy(validate_re) expects an Integer value, got String
at ["/.../modules/swift/manifests/ringbuilder/rebalance.pp", 23]:

Change-Id: I60fcea3c1a04456898816b844bf9e555a790d1d4
2023-06-06 14:14:40 +09:00
Takashi Kajinami 11b193cab8 Fix type validation warning for storage policy rings
Since 63688a14e5 was merged, this module
support configuring storage policies.

When multiple storage policies are used, we need to create multiple
object rings like object.ring.gz, object-1.ring.gz. However the current
regexp to validate the ring name does not consider this format and
shows the type validation warning when creating a non-default policy
rings.

This change updates the regexp used in validation to accept that
object-<number> format as well.

Closes-Bug: #1987260
Change-Id: Ibc7479e7defbfa4c49bf3c9f1574cdcf61b90ab9
2022-08-22 19:37:40 +09:00
Tobias Urdin 0868b32e79 Convert all class usage to relative names
Change-Id: I0335cf49c2ce55659c49325f2c0028f1af93705d
2019-12-08 23:21:35 +01:00
Tobias Urdin ba1ec6d40c 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: I5661c2d685b4bf2422936326db1c3d543a49f92a
2019-02-25 22:49:42 +01:00
Christian Schwede c64538ef83 Fix raising an error on rebalance warnings
If the ring has been rebalanced recently, the next call to rebalance
will not rebalance again if the time passed is shorter than
min_part_time. swift-ring-builder returns an exit code of 1 in this
case, which is a warning, but not a hard error (errors will use an exit
code of 2).

It makes sense therefore to expect an exit code of 0 or 1 and only fail
if it's different.

Closes-Bug: 1677588
Change-Id: I03dd075c590344a920099c57b6a7530f103e0ede
2017-03-30 14:39:04 +02:00
Adam Vinsh c659733d39 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: I00cf4846bb933291469be94c9debed425eddf798
2016-05-25 08:52:47 -04:00
Dan Prince b8b443416d Add seed parameter to ringbuilder::rebalance.
This patch adds an optional seed parameter to the
swift::ringbuilder::rebalance definition. The seed
parameter can be useful if you want to (manually)
generate rings on independant servers and ensure that
the partition assignments are the same.

Change-Id: I840b8fe0125ed25e84f7681fada1b1102e48f32b
2015-01-08 17:36:24 -05:00
Dan Bode 18d681943e Add inline docs to manifests
This commit adds some initial inline documentation
of the manifests.

It also performs some basic whitespace cleanup.
2012-02-13 15:39:18 -08:00
Dan Bode 8c13cd147f Fix mispelling of container
In swift::ringbuilder::rebalance there was a typo
in the $name validation code.

This commit updates the spelling to be correct.
2012-01-23 11:45:36 -08:00
Dan Bode de50a0923b Update misnamed ringbuilder defines
the defined resource types ringbuilder::create
and ringbuilder::rebalance were incorrectly
named.

This commit updates them to the correct names:
  - swift::ringbuilder::create
  - swift::ringbuilder::rebalance
2012-01-23 11:45:18 -08:00
Dan Bode 917426380e Implement ringbuilder
This commit adds a class, defined resources and
native types that can be used together to manage
the creation, configuration, and rebalancing of
rings.

Creates the following native types:

  ring_account_device
  ring_container_device
  ring_object_device

The implementation of these types is provided
by swift-ring-builder and most of the functionality
is provided by the parent provider (SwiftRingBuilder)

Each of the providers is hard-coded to find the
relevent ring database in /etc/swift. This directory
location can currently not be configured.

Each provider implements self.instances so the
current state can of the ring can be queried from
puppet.

These providers do not handle either the creation
or the rebalancing of the rings, they are intended
to be used in combination with defined resource types
that perform that functionality:

  swift::ringbuilder::create
  swift::ringbuilder::rebalance

The swift::ringbuilder class is also created as
a part of this commit. This class does the following:

  - creates object, account, and container rings
(it uses the same parameters to create these rings)
  - creates the rebalance defines
  - sets up the following relationships:
    for each ring type, create should be applied before
    the native types which should refresh the rebalance
2012-01-23 11:42:42 -08:00