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 ### 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. * 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: class { '::swift::storage::account':
service_provider => 'swiftinit',
* swift::storage:all }
* swift::storage:node class { '::swift::storage::container':
* swift::storage:server service_provider => 'swiftinit',
* swift::storage::(account|container|object) }
* swift::proxy 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. 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' # *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. # 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( class swift::storage::all(
$storage_local_net_ip, $storage_local_net_ip,
$devices = '/srv/node', $devices = '/srv/node',
@@ -99,8 +91,7 @@ class swift::storage::all(
$log_requests = true, $log_requests = true,
$incoming_chmod = '0644', $incoming_chmod = '0644',
$outgoing_chmod = '0644', $outgoing_chmod = '0644',
$service_provider = $::swift::params::service_provider, ) {
) inherits ::swift::params {
if (!$mount_check) { 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.') 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_level => $log_level,
log_udp_host => $log_udp_host, log_udp_host => $log_udp_host,
log_udp_port => $log_udp_port, log_udp_port => $log_udp_port,
service_provider => $service_provider,
} }
swift::storage::server { $account_port: swift::storage::server { $account_port:

View File

@@ -38,14 +38,6 @@
# (optional) The IP address of the storage server. # (optional) The IP address of the storage server.
# Defaults to '127.0.0.1'. # 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 # ==== DEPRECATED PARAMETERS
# #
# [*manage_ring*] # [*manage_ring*]
@@ -59,7 +51,6 @@ define swift::storage::node(
$group = 'swift', $group = 'swift',
$max_connections = 25, $max_connections = 25,
$storage_local_net_ip = '127.0.0.1', $storage_local_net_ip = '127.0.0.1',
$service_provider = $::swift::params::service_provider,
# DEPRECATED PARAMETERS # DEPRECATED PARAMETERS
$manage_ring = true $manage_ring = true
) { ) {
@@ -72,7 +63,6 @@ define swift::storage::node(
max_connections => $max_connections, max_connections => $max_connections,
owner => $owner, owner => $owner,
group => $group, group => $group,
service_provider => $service_provider
} }
swift::storage::server { "60${name}0": swift::storage::server { "60${name}0":

View File

@@ -111,14 +111,6 @@
# Starting at the path "/etc/swift/" # Starting at the path "/etc/swift/"
# Defaults to "${type}-server.conf" # 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( define swift::storage::server(
$type, $type,
$storage_local_net_ip, $storage_local_net_ip,
@@ -145,7 +137,6 @@ define swift::storage::server(
$log_requests = true, $log_requests = true,
# this parameters needs to be specified after type and name # this parameters needs to be specified after type and name
$config_file_path = "${type}-server.conf", $config_file_path = "${type}-server.conf",
$service_provider = $::swift::params::service_provider
) { ) {
if ($incoming_chmod == '0644') { if ($incoming_chmod == '0644') {
@@ -177,12 +168,9 @@ define swift::storage::server(
fail ('log_udp_port requires log_udp_host to be set') fail ('log_udp_port requires log_udp_host to be set')
} }
class { "::swift::storage::${type}" : include "::swift::storage::${type}"
service_provider => $service_provider
}
include ::concat::setup include ::concat::setup
include ::swift::params
validate_re($name, '^\d+$') validate_re($name, '^\d+$')
validate_re($type, '^object|container|account$') validate_re($type, '^object|container|account$')

View File

@@ -125,7 +125,15 @@ describe 'basic swift' do
zone => '2', zone => '2',
storage_local_net_ip => '127.0.0.1', storage_local_net_ip => '127.0.0.1',
require => Swift::Storage::Loopback[2] , 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': class { '::swift::ringbuilder':
part_power => '18', part_power => '18',