Use include for swift::storage::${type}

Require operator specify swiftinit provider
on supported components rather then pass it through.

Change-Id: I7e35c0a49f51e252573f46af9ba2a8eda968e3e2
Closes-Bug: #1524381
This commit is contained in:
Adam Vinsh 2015-12-09 10:13:28 -05:00
parent c58ed14ef0
commit 67df8085d0
5 changed files with 28 additions and 43 deletions

View File

@ -264,14 +264,23 @@ a templated init or services file. This is managed by this provider. For EL and
### Using the swiftinit service provider
* To use the swiftinit service provider set "service_provider" on the supported components you have defined in your config manifest.
Setting: `service_provider => 'swiftinit'`
Is supported on the following components:
* swift::storage:all
* swift::storage:node
* swift::storage:server
* swift::storage::(account|container|object)
* swift::proxy
```
class { '::swift::storage::account':
service_provider => 'swiftinit',
}
class { '::swift::storage::container':
service_provider => 'swiftinit',
}
class { '::swift::storage::object':
service_provider => 'swiftinit',
}
class {'::swift::objectexpirer':
service_provider => 'swiftinit',
}
class { '::swift::proxy':
service_provider => 'swiftinit',
}
```
Moving from the default service providers to the swiftinit service provider is supported. On the next puppet run after setting the swiftinit service provider swift services are stopped on the old provider and immediately started using swift-init. This provides a supported upgrade path with no down time.

View File

@ -73,14 +73,6 @@
# *NOTE*: Recommended parameter: 'Du=rwx,g=rx,o=rx,Fu=rw,g=r,o=r'
# This mask translates to 0755 for directories and 0644 for files.
#
# [*service_provider*]
# (optional)
# To use the swiftinit service provider to manage swift services, set
# service_provider to "swiftinit". When set to 'swiftinit' the
# "manage_boot" defined type is used to populate boot files that start
# swift using swift-init at boot. See README for more details.
# Defaults to $::swift::params::service_provider.
#
class swift::storage::all(
$storage_local_net_ip,
$devices = '/srv/node',
@ -99,8 +91,7 @@ class swift::storage::all(
$log_requests = true,
$incoming_chmod = '0644',
$outgoing_chmod = '0644',
$service_provider = $::swift::params::service_provider,
) inherits ::swift::params {
) {
if (!$mount_check) {
warning('The default for the mount_check parameter will change from false to true in the next release to match upstream. To disable this warning, set mount_check=false.')
@ -121,7 +112,6 @@ class swift::storage::all(
log_level => $log_level,
log_udp_host => $log_udp_host,
log_udp_port => $log_udp_port,
service_provider => $service_provider,
}
swift::storage::server { $account_port:

View File

@ -38,14 +38,6 @@
# (optional) The IP address of the storage server.
# Defaults to '127.0.0.1'.
#
# [*service_provider*]
# (optional)
# To use the swiftinit service provider to manage swift services, set
# service_provider to "swiftinit". When set to 'swiftinit' the
# "manage_boot" defined type is used to populate boot files that start
# swift using swift-init at boot. See README for more details.
# Defaults to $::swift::params::service_provider.
#
# ==== DEPRECATED PARAMETERS
#
# [*manage_ring*]
@ -59,7 +51,6 @@ define swift::storage::node(
$group = 'swift',
$max_connections = 25,
$storage_local_net_ip = '127.0.0.1',
$service_provider = $::swift::params::service_provider,
# DEPRECATED PARAMETERS
$manage_ring = true
) {
@ -72,7 +63,6 @@ define swift::storage::node(
max_connections => $max_connections,
owner => $owner,
group => $group,
service_provider => $service_provider
}
swift::storage::server { "60${name}0":

View File

@ -111,14 +111,6 @@
# Starting at the path "/etc/swift/"
# Defaults to "${type}-server.conf"
#
# [*service_provider*]
# (optional)
# To use the swiftinit service provider to manage swift services, set
# service_provider to "swiftinit". When enable is true the provider
# will populate boot files that start swift using swift-init at boot.
# See README for more details.
# Defaults to $::swift::params::service_provider.
#
define swift::storage::server(
$type,
$storage_local_net_ip,
@ -145,7 +137,6 @@ define swift::storage::server(
$log_requests = true,
# this parameters needs to be specified after type and name
$config_file_path = "${type}-server.conf",
$service_provider = $::swift::params::service_provider
) {
if ($incoming_chmod == '0644') {
@ -177,12 +168,9 @@ define swift::storage::server(
fail ('log_udp_port requires log_udp_host to be set')
}
class { "::swift::storage::${type}" :
service_provider => $service_provider
}
include "::swift::storage::${type}"
include ::concat::setup
include ::swift::params
validate_re($name, '^\d+$')
validate_re($type, '^object|container|account$')

View File

@ -125,7 +125,15 @@ describe 'basic swift' do
zone => '2',
storage_local_net_ip => '127.0.0.1',
require => Swift::Storage::Loopback[2] ,
service_provider => 'swiftinit',
}
class { '::swift::storage::account':
service_provider => 'swiftinit',
}
class { '::swift::storage::container':
service_provider => 'swiftinit',
}
class { '::swift::storage::object':
service_provider => 'swiftinit',
}
class { '::swift::ringbuilder':
part_power => '18',