Commit Graph

30 Commits

Author SHA1 Message Date
Takashi Kajinami f772e96e12 Add parameter type validations
Some parameters accept only certain parameter types/values. This adds
validations in parameter input to return sensible errors to users.

Change-Id: Ie6c0cf7956c228fead74dcb59e94111402303a56
2023-12-04 14:28:21 +00:00
Takashi Kajinami 3c89736ffe Restart only specific services after config change
Currently we restart all swift services regardless of the config file
being updated. This is very redundant, because some config files affect
only specific services (eg. account-server.conf is used only by
account-* daemons).

This introduces new "sub" tags such as swift-account-service and limit
the services being restarted.

Change-Id: Idfa09b63d291b0f71686554cb7c7b0597cb8842c
2023-07-24 15:07:50 +09:00
Takashi Kajinami d1cc6938da Do not define service resource when service management is disabled
Change-Id: Ic10cd3632e1b52945195cfefe904257e66958eba
2023-03-22 17:58:09 +09:00
Takashi Kajinami 453b1a9731 Use ini provider to manage storage config files
With this change now config files for storage services(account,
container and object) are managed by ini provider instead of concat
resources. This allows us to use the default file provided by packages
instead of replacing the whole file content by our templates, and use
the $::os_service_default value instead of hard-coding own defaults.

Related-Bug: #1921319
Change-Id: I375634214e88acc5075f64090287f934ce8451d1
2022-08-16 11:27:03 +09:00
Thomas Goirand bb483f0e28 Add support for container sharder
This patch ensure that the swift-container-sharder service is started,
and provides all the facility (ie: parameters) to configure the sharder.

Change-Id: I0db7479e8634038871ce65990fd0104841d2010c
2022-02-04 08:21:21 +00:00
Takashi Kajinami b79e3c965b Fix lint errors with the latest lint packages
This change fixes the following lint errors discovered since we removed
pin of lint packages.

manifests/containerreconciler.pp:110:WARNING: absolute class name
reference
manifests/containerreconciler.pp:110:WARNING: absolute class name
reference
manifests/containerreconciler.pp:91:WARNING: class included by absolute
name (::$class)
manifests/objectexpirer.pp:159:WARNING: absolute class name reference
manifests/objectexpirer.pp:159:WARNING: absolute class name reference
manifests/objectexpirer.pp:130:WARNING: class included by absolute name
(::$class)
manifests/proxy.pp:192:WARNING: class included by absolute name
(::$class)
manifests/proxy/cache.pp:63:WARNING: absolute class name reference
manifests/proxy/cache.pp:63:WARNING: absolute class name reference
manifests/storage/account.pp:35:WARNING: class included by absolute
name (::$class)
manifests/storage/all.pp:32:WARNING: Duplicate class parameter
documentation for swift::storage::all::allow_versions
manifests/storage/all.pp:15:WARNING: Duplicate class parameter
documentation for swift::storage::all::allow_versions
manifests/storage/container.pp:41:WARNING: class included by absolute
name (::$class)
manifests/storage/object.pp:35:WARNING: class included by absolute name
(::$class)

Change-Id: Ic223f16d234c4385b95197ab460dc38eb561d16a
2021-05-11 19:03:11 +09:00
Tobias Urdin 0868b32e79 Convert all class usage to relative names
Change-Id: I0335cf49c2ce55659c49325f2c0028f1af93705d
2019-12-08 23:21:35 +01:00
Christian Schwede dede1d4494 Enable Swift containersync on Red Hat platform
The systemd service files have been merged (see [1]), thus we can enable
the containersync service now by default without a distribution check.

[1] https://review.rdoproject.org/r/6172/ merged

Change-Id: I6c1f953efe5df32160719ea1de2dd718f281cec0
2017-06-16 15:50:31 +02:00
Emilien Macchi 1b8869e6ae Pass subscribe and require into service resource
Before this update, subscribe and require could be passed
into the service class and work due to some default puppet
behaviors. This resulted in unknown variable warnings.  Removal
of these parameters would remove the required resource dependencies.

Adding new parameters 'service_subscribe' and 'service_require'
to pass in these dependencies. The 'service_' prefix is used
here because use of 'subscribe' or 'require' as parameter names
would also print a meta parameter warning.

Change-Id: I33d2d6028347bbe50dc9b3f36b3f86b217db7c0c
2016-11-21 23:35:23 +00: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
Sergii Golovatiuk 1c91097780 Replace File with Concat in dependencies
Up to 2.0.0 concat was done as a define which contains File. Starting
from 2.0.0 concat::fragment define was rewritten as provider. This patch
replaces dependencies to File from concat::fragment with Concat to
enable concat ~> 2.0.0

Change-Id: Ifccc1bf2260dbbceb75b6bbe1d6b5bbbbb657a12
2016-04-18 17:17:46 +02:00
Adam Vinsh 2ffbf45277 Notify related services on config file change
Adds service restarts for the following:
account-reaper, container-updater, object-updater,
container-sync, (account/container/object)-auditor.
Each will now be reloaded if their related config file
is updated.

Change-Id: I546bba253bbd0fe890fb77bb9a9f1e632fea242c
2016-01-07 22:46:56 -05:00
Christian Schwede 7f7e4c5952 Define ${name}-auditors in storage/generic.pp
All three storage servers need an auditor, thus it is possible to
reuse the same template for all of them and reducing duplicate code.

Added a new test to ensure auditor services are defined.

Also update notifications to include the replicators as well.

Change-Id: I1fcbf55d1326790b35cd620196ca7e373b40df1a
2015-12-17 18:58:23 -05:00
Adam Vinsh 5a7d18975f Manage swift with swiftinit service provider
The 'swiftinit' provider is a custom provider of the service type
that manages swift services using swift-init.

Use of the swiftinit service provider is optional, the default is
to use service providers specified in params file. This provider
also manages swift services starting at boot by adding or removing
a templated init or services file and making systemctl calls.
See README for more detail.

A wrapper defined type 'swift::service' has been created to simplify
use of the swiftinit provider without adding logic to every class.
this wrapper also aids in input validation and testing of the
swiftinit provider.

Two extra runs of apply_manifest have been added to the
basic_swift_spec acceptance test. The service_provider
is set to "swiftinit".  The first run catches any errors upgrading
to the swiftinit service provider and the second run tests
idempotency.

This patch is an initial step towards using swift-init to manage
multiple swift services out of different configuration files such
as is needed to run a separate replication network.

Change-Id: I2f71c82c7a6c463f8c76a193409c0a17daa15bda
2015-12-07 16:00:50 -05:00
Emilien Macchi c0a1195f53 Improve File resources idempotency
* use selinux_ignore_defaults parameter for directory to avoid this kind
  of issue:
(...) seltype: seltype changed 'swift_var_run_t' to 'var_run_t'

* Do not manage ownership for /etc/swift/*-server to avoid this kind of
  issue:
(...) owner changed 'root' to 'swift'

* Do not manage /etc/init.d/swift-container-sync file, already managed
  by packaging:
~ dpkg -S /etc/init.d/swift-container-sync
swift-container: /etc/init.d/swift-container-sync

Change-Id: I1d742d118943fb0b11c47fd322052f50156e2994
2015-09-29 18:40:49 +00:00
Yanis Guenane da4a0dd2ae Add tag to package and service resources
In order to be able to take an action after all the packages of the
module have been installed/updated or all the services have been
started/restarted, we set a 'swift-package' and 'swift-service' tag
for each package and service of this module.

At the moment, there is a generic openstack tag that is not specific
enough if one wants to take action upon a single module change.

Use case :

If an action needs to be taken after all the packages have been
installed or updated : Package <| tag == 'swift-package' |> -> X

Change-Id: I1632bc0cee2a1c4cd5cc5d270a6d22919377c36b
2015-07-22 23:32:14 +02:00
Emilien Macchi 6dc85b0f79 Notify services if swift.conf is modified
swift.conf contains the hash_suffix. With the current module, we have a
race condition where services can start *before* having the right hash
in swift.conf, so some objects mays be put in quarantine.

When usint swift_config (which affect swift.conf), we should restart all
services to ensure our ring is running correctly.

Change-Id: I1087ba4ec079ca9c43bea9ff0511347632871ec2
Closes-bug: #1442329
2015-04-09 17:03:07 -04:00
Sebastien Badia dc8657e203 Add Puppet 4.x lint checks
This changes the puppet-lint requirement to 1.1.x, so that we can use
puppet-lint plugins. Most of these plugins are for 4.x compat, but some
just catch common errors.

Change-Id: I9b41f170a782fecf88f241dc12288670b552b433
2015-03-25 13:46:00 +01:00
Sebastien Badia 77be0932fc Upgrade puppet-lint and fix metadata, parameter and style lint issues
This patch bump puppet-lint gem and add metadata and parameters checks.
Metadata lint issues (SPDX ID), missing parameters documentation and
syntaxe lint issues was also fixed in this patch

Doc for metadata syntax.
https://docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html

Change-Id: Ia6bb3483b3ffdbeed60b58702a36e0c7b31ffb86
2015-03-24 15:18:28 +01:00
Martin Mágr 22f09aed4f Add manage_service feature
puppet-swift lacks of disabling service managing. This patch adds
$manage_service and $enabled parameter to all relevant classes.

Closes-bug: #1359823
Change-Id: I3d632e3a26e9394d03d94089ae704904bf77aa51
2014-10-31 15:24:50 +01:00
Chris Ricker 2cce66ef44 swift classes need to include swift::params
Some of the swift classes use parameterized settings defined in
swift::params but do not include the swift::params class.

Change-Id: I7704bf42db4554566d27b510bbbedb8afe0fe7b3
Closes-Bug: #1288252
2014-03-05 08:58:10 -08:00
Mathieu Gagné 0098067226 Fix puppet-lint warnings about ensure
Fix warning: "ensure found on line but it's not the first attribute"

Change-Id: Iecc0cd4fe267c40fbef9a84ff1da2eaff5aa45a7
2013-08-25 23:29:34 -04:00
Mathieu Gagné 178f4b18dc Various Puppet lint fixes
* Fix following warnings:
    * double quoted string containing no variables
    * indentation of => is not properly aligned
    * mode should be represented as a 4 digit octal value or symbolic mode
    * string containing only a variable
    * top-scope variable being used without an explicit namespace
    * unquoted file mode
    * variable not enclosed in {}
* Fix following errors:
    * trailing whitespace found
    * two-space soft tabs not used
* Remove quotes around class in include/require statements

Change-Id: Ia920d848e1955612a6486ec8731309e6d3a70f63
2013-08-02 11:51:57 -04:00
Radim Kubacki 3a0413f7f5 Customizable allowed_sync_hosts in container-server.conf
Insert default value into .conf file (127.0.0.1) or use
custom value if specified.

Change-Id: I9caec9657a2a3ad789b7dab646e505f609c25655
2013-05-29 12:39:21 +02:00
Derek Higgins 90f58f8f92 Start swift support services on Red Hat
Now starting these services on all distros
swift-account-auditor swift-container-auditor swift-object-auditor
swift-account-reaper swift-container-updater swift-object-updater

Change-Id: I98cfcef3b43a2bdad6f359e4e4098a6113245353
2013-04-24 06:16:59 -04:00
Mehdi Abaakouk 0dcde3563a Fix swift storage service start on debian
Some services only start on ubuntu system,
so add debian support for that services

Change-Id: I6e050af98fda5e162278130b4e1116402c3d2ae3
2013-04-11 08:50:55 +02:00
Dan Bode 3d2462bd78 add upstart symlink
the service upstart provider does not
work unless the init script is a symlink
to /lib/init/upstart-job for at least older
versions of Puppet.

This commit adds this symlink to avoid
run time apply failures.
2013-01-11 14:47:21 -08:00
Sergio Rubio 5d68f7e260 Prevent some race conditions by requiring the storage server package 2012-09-24 15:22:16 +02:00
Sergio Rubio 403a88a05f Manage missing Swift storage server services
Before this fix the following services where missing:

    root@swift-storage-01:~# swift-init status all|grep ^No
    No container-updater running
    No account-auditor running
    No object-auditor running
    No object-expirer running
    No container-auditor running
    No account-reaper running
    No container-sync running
    No object-updater running

After this commit:

    root@swift-storage-01:/etc/init# swift-init status all|grep ^No
    No proxy-server running
    No object-expirer running

It's OK for the proxy-server to be stopped since it's a storage
.
You only need to manage one object-expirer per cluster, so this not

place to manage it either. See:

http://docs.openstack.org/developer/swift/overview_expiring_objects.html
2012-09-20 11:10:18 +02:00
Dan Bode 5083e19bc4 Decouple storage server types from each other
Previously, all of the storage server types
(account, container, proxy) were always
configured to be installed on the same node.

It often makes sense to only have the account and
container together, and to put the object server on
a different node. (or its possible that other
configurations make sense)

This commit refactors the swift module so that
each of the types of nodes can be built
independently of each other.
2012-03-02 20:01:49 -08:00