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
This commit is contained in:
parent
00193204a7
commit
c659733d39
@ -25,11 +25,14 @@ class swift::auth_file (
|
||||
$auth_url = 'http://127.0.0.1:5000/v2.0/'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
file { '/root/swiftrc':
|
||||
ensure => file,
|
||||
owner => 'root',
|
||||
group => 'root',
|
||||
mode => '0600',
|
||||
tag => 'swift-file',
|
||||
content =>
|
||||
"
|
||||
export ST_USER=${admin_tenant}:${admin_user}
|
||||
|
@ -84,6 +84,8 @@ class swift::bench (
|
||||
$delete = 'yes',
|
||||
){
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
swift_bench_config {
|
||||
'bench/auth': value => $auth_url;
|
||||
'bench/user': value => $swift_user;
|
||||
|
@ -12,12 +12,13 @@ class swift::client (
|
||||
$ensure = 'present'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
include ::swift::params
|
||||
|
||||
package { 'swiftclient':
|
||||
ensure => $ensure,
|
||||
name => $::swift::params::client_package,
|
||||
tag => 'openstack',
|
||||
tag => ['openstack','swift-support-package']
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ class swift::config (
|
||||
$swift_config = {},
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
validate_hash($swift_config)
|
||||
|
||||
create_resources('swift_config', $swift_config)
|
||||
|
59
manifests/deps.pp
Normal file
59
manifests/deps.pp
Normal file
@ -0,0 +1,59 @@
|
||||
# == Class: swift::deps
|
||||
#
|
||||
# swift anchors and dependency management
|
||||
#
|
||||
class swift::deps {
|
||||
# Setup anchors for install, config and service phases of the module. These
|
||||
# anchors allow external modules to hook the begin and end of any of these
|
||||
# phases. Package or service management can also be replaced by ensuring the
|
||||
# package is absent or turning off service management and having the
|
||||
# replacement depend on the appropriate anchors. When applicable, end tags
|
||||
# should be notified so that subscribers can determine if installation,
|
||||
# config or service state changed and act on that if needed.
|
||||
anchor { 'swift::install::begin': }
|
||||
-> Package<| tag == 'swift-package'|>
|
||||
~> anchor { 'swift::install::end': }
|
||||
-> anchor { 'swift::config::begin': }
|
||||
-> Swift_config<||>
|
||||
~> anchor { 'swift::config::end': }
|
||||
~> anchor { 'swift::service::begin': }
|
||||
~> Service<| tag == 'swift-service' |>
|
||||
~> anchor { 'swift::service::end': }
|
||||
~> Swift_dispersion_config<||>
|
||||
|
||||
Anchor['swift::config::begin']
|
||||
-> Swift_proxy_config<||>
|
||||
~> Anchor['swift::config::end']
|
||||
|
||||
Anchor['swift::config::begin']
|
||||
-> Swift_object_config<||>
|
||||
~> Anchor['swift::config::end']
|
||||
|
||||
Anchor['swift::config::begin']
|
||||
-> Swift_container_config<||>
|
||||
~> Anchor['swift::config::end']
|
||||
|
||||
Anchor['swift::config::begin']
|
||||
-> Swift_account_config<||>
|
||||
~> Anchor['swift::config::end']
|
||||
|
||||
Anchor['swift::config::begin']
|
||||
-> File<| tag == 'swift-file' |>
|
||||
~> Anchor['swift::config::end']
|
||||
|
||||
# Support packages need to be installed in the install phase, but we don't
|
||||
# put them in the chain above because we don't want any false dependencies
|
||||
# between packages with the swift-package tag and the swift-support-package
|
||||
# tag. Note: the package resources here will have a 'before' relationshop on
|
||||
# the swift::install::end anchor. The line between swift-support-package and
|
||||
# swift-package should be whether or not swift services would need to be
|
||||
# restarted if the package state was changed.
|
||||
Anchor['swift::install::begin']
|
||||
-> Package<| tag == 'swift-support-package'|>
|
||||
-> Anchor['swift::install::end']
|
||||
|
||||
# Installation or config changes will always restart services.
|
||||
Anchor['swift::install::end'] ~> Anchor['swift::service::begin']
|
||||
Anchor['swift::config::end'] ~> Anchor['swift::service::begin']
|
||||
|
||||
}
|
@ -80,15 +80,15 @@ class swift::dispersion (
|
||||
$dump_json = 'no'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
include ::swift::params
|
||||
|
||||
Swift_dispersion_config<||> ~> Exec['swift-dispersion-populate']
|
||||
|
||||
file { '/etc/swift/dispersion.conf':
|
||||
ensure => file,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
require => Package['swift'],
|
||||
ensure => file,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
}
|
||||
|
||||
swift_dispersion_config {
|
||||
|
@ -62,6 +62,7 @@ class swift(
|
||||
$swift_hash_suffix = undef,
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
include ::swift::params
|
||||
|
||||
if ($swift_hash_suffix == undef and $swift_hash_path_suffix == undef) {
|
||||
@ -85,7 +86,11 @@ class swift(
|
||||
ensure => $client_package_ensure;
|
||||
}
|
||||
|
||||
File { owner => 'swift', group => 'swift', require => Package['swift'] }
|
||||
File {
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
tag => 'swift-file',
|
||||
}
|
||||
|
||||
file { '/etc/swift':
|
||||
ensure => directory,
|
||||
|
@ -183,6 +183,8 @@ class swift::keystone::auth(
|
||||
$admin_address = undef,
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
if $endpoint_prefix {
|
||||
warning('The endpoint_prefix parameter is deprecated, use public_url, internal_url and admin_url instead.')
|
||||
}
|
||||
|
@ -36,6 +36,8 @@ class swift::keystone::dispersion(
|
||||
$tenant = 'services'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
keystone_user { $auth_user:
|
||||
ensure => present,
|
||||
password => $auth_pass,
|
||||
|
@ -81,6 +81,7 @@ class swift::objectexpirer(
|
||||
$service_provider = $::swift::params::service_provider
|
||||
) inherits ::swift::params {
|
||||
|
||||
include ::swift::deps
|
||||
Swift_config<| |> ~> Service['swift-object-expirer']
|
||||
Swift_object_expirer_config<||> ~> Service['swift-object-expirer']
|
||||
|
||||
|
@ -141,6 +141,7 @@ class swift::proxy(
|
||||
$service_provider = $::swift::params::service_provider
|
||||
) inherits ::swift::params {
|
||||
|
||||
include ::swift::deps
|
||||
Swift_config<| |> ~> Service['swift-proxy-server']
|
||||
|
||||
validate_bool($account_autocreate)
|
||||
|
@ -18,6 +18,9 @@
|
||||
# Configure Swift Account Quotas
|
||||
#
|
||||
class swift::proxy::account_quotas() {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_account_quotas':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/account_quotas.conf.erb'),
|
||||
|
@ -87,6 +87,8 @@ class swift::proxy::authtoken(
|
||||
$auth_admin_prefix = false,
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
if $auth_uri {
|
||||
$auth_uri_real = $auth_uri
|
||||
} else {
|
||||
@ -116,6 +118,8 @@ class swift::proxy::authtoken(
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
selinux_ignore_defaults => true,
|
||||
require => Anchor['swift::config::begin'],
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
|
||||
concat::fragment { 'swift_authtoken':
|
||||
|
@ -43,6 +43,9 @@ class swift::proxy::bulk(
|
||||
$max_deletes_per_request = '10000',
|
||||
$yield_frequency = '60',
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_bulk':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/bulk.conf.erb'),
|
||||
|
@ -22,6 +22,8 @@ class swift::proxy::cache(
|
||||
$memcache_servers = ['127.0.0.1:11211']
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
# require the memcached class if its on the same machine
|
||||
if grep(any2array($memcache_servers), '^127\.0\.0\.1') {
|
||||
Class['memcached'] -> Class['swift::proxy::cache']
|
||||
|
@ -17,6 +17,8 @@
|
||||
#
|
||||
class swift::proxy::catch_errors() {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_catch_errors':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/catch_errors.conf.erb'),
|
||||
|
@ -78,6 +78,8 @@ class swift::proxy::ceilometer(
|
||||
$group = 'ceilometer',
|
||||
) inherits swift {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
if(is_array($rabbit_hosts)) {
|
||||
$rabbit_hosts_with_creds = prefix($rabbit_hosts, "${rabbit_user}:${rabbit_password}@")
|
||||
}
|
||||
@ -106,7 +108,7 @@ class swift::proxy::ceilometer(
|
||||
|
||||
package { 'python-ceilometermiddleware':
|
||||
ensure => $ensure,
|
||||
tag => 'openstack',
|
||||
tag => ['openstack', 'swift-support-package'],
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -18,6 +18,9 @@
|
||||
# Configure Swift Container Quotas
|
||||
#
|
||||
class swift::proxy::container_quotas() {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_container_quotas':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/container_quotas.conf.erb'),
|
||||
|
@ -15,6 +15,8 @@ class swift::proxy::crossdomain (
|
||||
$cross_domain_policy = '<allow-access-from domain="*" secure="false" />',
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_crossdomain':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/crossdomain.conf.erb'),
|
||||
|
@ -34,6 +34,8 @@ class swift::proxy::dlo (
|
||||
$max_get_time = '86400'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_dlo':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/dlo.conf.erb'),
|
||||
|
@ -17,6 +17,8 @@
|
||||
#
|
||||
class swift::proxy::formpost() {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift-proxy-formpost':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/formpost.conf.erb'),
|
||||
|
@ -43,6 +43,8 @@ class swift::proxy::gatekeeper(
|
||||
$log_address = '/dev/log'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_gatekeeper':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/gatekeeper.conf.erb'),
|
||||
|
@ -15,6 +15,8 @@
|
||||
#
|
||||
class swift::proxy::healthcheck() {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_healthcheck':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/healthcheck.conf.erb'),
|
||||
|
@ -29,6 +29,8 @@ class swift::proxy::keystone(
|
||||
$reseller_prefix = 'AUTH_'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_keystone':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/keystone.conf.erb'),
|
||||
|
@ -7,6 +7,8 @@
|
||||
#
|
||||
class swift::proxy::proxy_logging {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_proxy-logging':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/proxy-logging.conf.erb'),
|
||||
|
@ -48,6 +48,8 @@ class swift::proxy::ratelimit(
|
||||
$account_ratelimit = 0
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_ratelimit':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/ratelimit.conf.erb'),
|
||||
|
@ -34,6 +34,8 @@ class swift::proxy::s3token(
|
||||
$auth_protocol = 'http'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_s3token':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/s3token.conf.erb'),
|
||||
|
@ -49,6 +49,8 @@ class swift::proxy::slo (
|
||||
$max_get_time = '86400'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift_slo':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/slo.conf.erb'),
|
||||
|
@ -18,6 +18,8 @@
|
||||
#
|
||||
class swift::proxy::staticweb() {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { 'swift-proxy-staticweb':
|
||||
target => '/etc/swift/proxy-server.conf',
|
||||
content => template('swift/proxy/staticweb.conf.erb'),
|
||||
|
@ -21,9 +21,12 @@ class swift::proxy::swauth(
|
||||
$package_ensure = 'present'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
package { 'python-swauth':
|
||||
ensure => $package_ensure,
|
||||
before => Package['swift-proxy'],
|
||||
tag => 'swift-package',
|
||||
}
|
||||
|
||||
concat::fragment { 'swift_proxy_swauth':
|
||||
|
@ -24,12 +24,13 @@ class swift::proxy::swift3(
|
||||
$ensure = 'present'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
include ::swift::params
|
||||
|
||||
package { 'swift-plugin-s3':
|
||||
ensure => $ensure,
|
||||
name => $::swift::params::swift3,
|
||||
tag => 'openstack',
|
||||
tag => ['openstack','swift-package']
|
||||
}
|
||||
|
||||
concat::fragment { 'swift_swift3':
|
||||
|
@ -81,6 +81,8 @@ class swift::proxy::tempauth (
|
||||
$storage_url_scheme = undef,
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
validate_array($account_user_list)
|
||||
|
||||
if ($reseller_prefix) {
|
||||
|
@ -52,6 +52,8 @@ class swift::proxy::tempurl (
|
||||
$outgoing_allow_headers = undef,
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
if($methods) {
|
||||
if is_array($methods) {
|
||||
$methods_real = join($methods,' ')
|
||||
|
@ -30,6 +30,7 @@ class swift::ringbuilder(
|
||||
$min_part_hours = undef
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
Class['swift'] -> Class['swift::ringbuilder']
|
||||
|
||||
swift::ringbuilder::create{ ['object', 'account', 'container']:
|
||||
|
@ -39,6 +39,8 @@ define swift::ringbuilder::create(
|
||||
$user = 'swift'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
validate_re($name, '^object|container|account$')
|
||||
|
||||
exec { "create_${name}":
|
||||
@ -46,6 +48,7 @@ define swift::ringbuilder::create(
|
||||
path => ['/usr/bin'],
|
||||
user => $user,
|
||||
creates => "/etc/swift/${name}.builder",
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ define swift::ringbuilder::rebalance(
|
||||
$seed = undef
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
validate_re($name, '^object|container|account$')
|
||||
if $seed {
|
||||
validate_re($seed, '^\d+$')
|
||||
@ -21,5 +23,6 @@ define swift::ringbuilder::rebalance(
|
||||
command => strip("swift-ring-builder /etc/swift/${name}.builder rebalance ${seed}"),
|
||||
path => ['/usr/bin'],
|
||||
refreshonly => true,
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,7 @@ class swift::ringserver(
|
||||
$max_connections = 5
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
Class['swift::ringbuilder'] -> Class['swift::ringserver']
|
||||
|
||||
if !defined(Class['rsync::server']) {
|
||||
|
@ -7,6 +7,8 @@ define swift::ringsync(
|
||||
$ring_server
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
Exec { path => '/usr/bin' }
|
||||
|
||||
rsync::get { "/etc/swift/${name}.ring.gz":
|
||||
|
@ -39,6 +39,7 @@ define swift::service(
|
||||
$service_provider = $::swift::params::service_provider,
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
include ::swift::params
|
||||
|
||||
if(! member($::swift::params::swift_init_service_names, $name)) {
|
||||
|
@ -23,6 +23,8 @@ class swift::storage(
|
||||
$storage_local_net_ip
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
if !defined(Class['rsync::server']){
|
||||
class{ '::rsync::server':
|
||||
use_xinetd => true,
|
||||
|
@ -34,6 +34,7 @@ class swift::storage::account(
|
||||
$service_provider = $::swift::params::service_provider
|
||||
) inherits ::swift::params {
|
||||
|
||||
include ::swift::deps
|
||||
Swift_config<| |> ~> Service['swift-account-reaper']
|
||||
|
||||
swift::storage::generic { 'account':
|
||||
|
@ -91,6 +91,8 @@ class swift::storage::all(
|
||||
$outgoing_chmod = 'Du=rwx,g=rx,o=rx,Fu=rw,g=r,o=r',
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
class { '::swift::storage':
|
||||
storage_local_net_ip => $storage_local_net_ip,
|
||||
}
|
||||
|
@ -40,6 +40,8 @@ class swift::storage::container(
|
||||
$service_provider = $::swift::params::service_provider
|
||||
) inherits ::swift::params {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
Swift_config<| |> ~> Service['swift-container-updater']
|
||||
|
||||
swift::storage::generic { 'container':
|
||||
|
@ -49,11 +49,15 @@ define swift::storage::disk(
|
||||
$byte_size = '1024',
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
if(!defined(File[$mnt_base_dir])) {
|
||||
file { $mnt_base_dir:
|
||||
ensure => directory,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
ensure => directory,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
require => Anchor['swift::config::begin'],
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,6 +65,7 @@ define swift::storage::disk(
|
||||
command => "parted -s ${base_dir}/${name} mklabel gpt",
|
||||
path => ['/usr/bin/', '/sbin','/bin'],
|
||||
onlyif => ["test -b ${base_dir}/${name}","parted ${base_dir}/${name} print|tail -1|grep 'Error'"],
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
|
||||
swift::storage::xfs { $name:
|
||||
|
@ -29,12 +29,14 @@ define swift::storage::ext4(
|
||||
$loopback = false
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
# does this have to be refreshonly?
|
||||
# how can I know if this drive has been formatted?
|
||||
exec { "mkfs-${name}":
|
||||
command => "mkfs.ext4 -I ${byte_size} -F ${device}",
|
||||
path => ['/sbin/'],
|
||||
refreshonly => true,
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
|
||||
swift::storage::mount { $name:
|
||||
|
@ -17,6 +17,8 @@
|
||||
define swift::storage::filter::healthcheck(
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { "swift_healthcheck_${name}":
|
||||
target => "/etc/swift/${name}-server.conf",
|
||||
content => template('swift/proxy/healthcheck.conf.erb'),
|
||||
|
@ -22,6 +22,8 @@ define swift::storage::filter::recon(
|
||||
$cache_path = '/var/cache/swift'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
concat::fragment { "swift_recon_${name}":
|
||||
target => "/etc/swift/${name}-server.conf",
|
||||
content => template('swift/recon.conf.erb'),
|
||||
|
@ -38,6 +38,7 @@ define swift::storage::generic(
|
||||
$service_provider = $::swift::params::service_provider
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
include ::swift::params
|
||||
|
||||
Class['swift::storage'] -> Swift::Storage::Generic[$name]
|
||||
@ -55,10 +56,10 @@ define swift::storage::generic(
|
||||
}
|
||||
|
||||
file { "/etc/swift/${name}-server/":
|
||||
ensure => directory,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
require => Package["swift-${name}"],
|
||||
ensure => directory,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
tag => 'swift-file',
|
||||
}
|
||||
|
||||
if $manage_service {
|
||||
|
@ -38,17 +38,23 @@ define swift::storage::loopback(
|
||||
$fstype = 'xfs'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
if(!defined(File[$base_dir])) {
|
||||
file { $base_dir:
|
||||
ensure => directory,
|
||||
ensure => directory,
|
||||
require => Anchor['swift::config::begin'],
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
}
|
||||
|
||||
if(!defined(File[$mnt_base_dir])) {
|
||||
file { $mnt_base_dir:
|
||||
ensure => directory,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
ensure => directory,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
require => Anchor['swift::config::begin'],
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
}
|
||||
|
||||
@ -57,6 +63,7 @@ define swift::storage::loopback(
|
||||
path => ['/usr/bin/', '/bin'],
|
||||
unless => "test -f ${base_dir}/${name}",
|
||||
require => File[$base_dir],
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
|
||||
$storage_params = {
|
||||
|
@ -28,6 +28,8 @@ define swift::storage::mount(
|
||||
$fstype = 'xfs'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
if($loopback){
|
||||
$options = 'noatime,nodiratime,nobarrier,loop'
|
||||
} else {
|
||||
@ -43,9 +45,11 @@ define swift::storage::mount(
|
||||
# the directory that represents the mount point
|
||||
# needs to exist
|
||||
file { "${mnt_base_dir}/${name}":
|
||||
ensure => directory,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
ensure => directory,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
require => Anchor['swift::config::begin'],
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
|
||||
mount { "${mnt_base_dir}/${name}":
|
||||
@ -64,6 +68,7 @@ define swift::storage::mount(
|
||||
unless => "grep ${mnt_base_dir}/${name} /etc/mtab",
|
||||
# TODO - this needs to be removed when I am done testing
|
||||
logoutput => true,
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
|
||||
exec { "fix_mount_permissions_${name}":
|
||||
@ -71,6 +76,7 @@ define swift::storage::mount(
|
||||
path => ['/usr/sbin', '/bin'],
|
||||
subscribe => Exec["mount_${name}"],
|
||||
refreshonly => true,
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
|
||||
# mounting in linux and puppet is broken and non-atomic
|
||||
@ -85,7 +91,7 @@ define swift::storage::mount(
|
||||
command => "restorecon ${mnt_base_dir}/${name}",
|
||||
path => ['/usr/sbin', '/sbin'],
|
||||
subscribe => Exec["mount_${name}"],
|
||||
before => Exec["fix_mount_permissions_${name}"],
|
||||
before => [Exec["fix_mount_permissions_${name}"],Anchor['swift::config::end']],
|
||||
refreshonly => true,
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,8 @@ define swift::storage::node(
|
||||
$manage_ring = true
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
validate_re($zone, '^\d+$', 'The zone parameter must be an integer')
|
||||
|
||||
Swift::Storage::Server {
|
||||
|
@ -34,6 +34,7 @@ class swift::storage::object(
|
||||
$service_provider = $::swift::params::service_provider
|
||||
) inherits ::swift::params {
|
||||
|
||||
include ::swift::deps
|
||||
Swift_config<| |> ~> Service['swift-object-updater']
|
||||
|
||||
swift::storage::generic { 'object':
|
||||
|
@ -137,6 +137,8 @@ define swift::storage::server(
|
||||
$config_file_path = "${type}-server.conf",
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
if ($incoming_chmod == '0644') {
|
||||
warning('The default incoming_chmod set to 0644 may yield in error prone directories and will be changed in a later release.')
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ define swift::storage::xfs(
|
||||
$loopback = false
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
include ::swift::xfs
|
||||
|
||||
if $device == '' {
|
||||
@ -45,9 +46,11 @@ define swift::storage::xfs(
|
||||
|
||||
if(!defined(File[$mnt_base_dir])) {
|
||||
file { $mnt_base_dir:
|
||||
ensure => directory,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
ensure => directory,
|
||||
owner => 'swift',
|
||||
group => 'swift',
|
||||
require => Anchor['swift::config::begin'],
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,6 +63,7 @@ define swift::storage::xfs(
|
||||
path => ['/sbin/', '/usr/sbin/'],
|
||||
require => Package['xfsprogs'],
|
||||
unless => "xfs_admin -l ${target_device}",
|
||||
before => Anchor['swift::config::end'],
|
||||
}
|
||||
|
||||
swift::storage::mount { $name:
|
||||
|
@ -36,8 +36,12 @@ class swift::test_file (
|
||||
$tenant = 'openstack',
|
||||
$user = 'admin'
|
||||
) {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
file { '/tmp/swift_test_file.rb':
|
||||
mode => '0755',
|
||||
content => template('swift/swift_keystone_test.erb'),
|
||||
tag => 'swift-file',
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@
|
||||
# xfs partitions
|
||||
class swift::xfs {
|
||||
|
||||
include ::swift::deps
|
||||
|
||||
$packages = ['xfsprogs', 'parted']
|
||||
ensure_packages($packages)
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
---
|
||||
prelude: >
|
||||
Add hooks for external install & svc management.
|
||||
features:
|
||||
- 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.
|
@ -50,13 +50,11 @@ describe 'basic swift' do
|
||||
part_power => '18',
|
||||
replicas => '1',
|
||||
min_part_hours => 1,
|
||||
require => Class['swift'],
|
||||
}
|
||||
class { '::swift::proxy':
|
||||
proxy_local_net_ip => '127.0.0.1',
|
||||
pipeline => ['healthcheck', 'proxy-logging', 'cache', 'authtoken', 'keystone', 'dlo', 'proxy-server'],
|
||||
account_autocreate => true,
|
||||
require => Class['swift::ringbuilder'],
|
||||
}
|
||||
class { '::swift::proxy::authtoken':
|
||||
admin_password => 'a_big_secret',
|
||||
@ -142,13 +140,11 @@ describe 'basic swift' do
|
||||
part_power => '18',
|
||||
replicas => '1',
|
||||
min_part_hours => 1,
|
||||
require => Class['swift'],
|
||||
}
|
||||
class { '::swift::proxy':
|
||||
proxy_local_net_ip => '127.0.0.1',
|
||||
pipeline => ['healthcheck', 'proxy-logging', 'cache', 'authtoken', 'keystone', 'dlo', 'proxy-server'],
|
||||
account_autocreate => true,
|
||||
require => Class['swift::ringbuilder'],
|
||||
service_provider => 'swiftinit',
|
||||
}
|
||||
class { '::swift::proxy::authtoken':
|
||||
|
@ -21,7 +21,7 @@ describe 'swift::client' do
|
||||
is_expected.to contain_package('swiftclient').with(
|
||||
:name => 'python-swiftclient',
|
||||
:ensure => p[:package_ensure],
|
||||
:tag => 'openstack'
|
||||
:tag => ['openstack','swift-support-package'],
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -31,8 +31,7 @@ describe 'swift::dispersion' do
|
||||
it { is_expected.to contain_file('/etc/swift/dispersion.conf').with(
|
||||
:ensure => 'file',
|
||||
:owner => 'swift',
|
||||
:group => 'swift',
|
||||
:require => 'Package[swift]')
|
||||
:group => 'swift',)
|
||||
}
|
||||
|
||||
shared_examples 'swift::dispersion' do
|
||||
|
@ -37,6 +37,9 @@ describe 'swift::proxy' do
|
||||
{:proxy_local_net_ip => '127.0.0.1'}
|
||||
end
|
||||
|
||||
it { is_expected.to contain_package('swift-proxy').that_requires('Anchor[swift::install::begin]')
|
||||
is_expected.to contain_package('swift-proxy').that_notifies('Anchor[swift::install::end]') }
|
||||
|
||||
it { is_expected.to contain_service('swift-proxy-server').with(
|
||||
{:ensure => 'running',
|
||||
:provider => nil,
|
||||
@ -46,6 +49,12 @@ describe 'swift::proxy' do
|
||||
:tag => 'swift-service',
|
||||
}
|
||||
)}
|
||||
it { is_expected.to contain_concat('/etc/swift/proxy-server.conf').with(
|
||||
{:ensure => 'present',
|
||||
:owner => 'swift',
|
||||
:group => 'swift',
|
||||
}
|
||||
)}
|
||||
|
||||
it 'should build the header file with all of the default contents' do
|
||||
is_expected.to contain_concat_fragment('swift_proxy').with_content('# This file is managed by puppet. Do not edit
|
||||
|
@ -30,7 +30,7 @@ describe 'swift' do
|
||||
{
|
||||
:owner => 'swift',
|
||||
:group => 'swift',
|
||||
:require => 'Package[swift]'
|
||||
:tag => 'swift-file',
|
||||
}
|
||||
end
|
||||
it {is_expected.to contain_user('swift')}
|
||||
@ -55,7 +55,9 @@ describe 'swift' do
|
||||
is_expected.to contain_swift_config(
|
||||
'swift-constraints/max_header_size').with_value('16384')
|
||||
end
|
||||
it { is_expected.to contain_package('swift').with_ensure('present') }
|
||||
it { is_expected.to contain_package('swift').with_ensure('present')
|
||||
is_expected.to contain_package('swift').that_requires('Anchor[swift::install::begin]')
|
||||
is_expected.to contain_package('swift').that_notifies('Anchor[swift::install::end]')}
|
||||
it { is_expected.to contain_file('/etc/swift/swift.conf').with_before(/Swift_config\[.+\]/) }
|
||||
end
|
||||
|
||||
|
@ -55,7 +55,8 @@ describe 'swift::storage::generic' do
|
||||
it do
|
||||
is_expected.to contain_package("swift-#{t}").with(
|
||||
:ensure => params[:package_ensure],
|
||||
:tag => ['openstack', 'swift-package']
|
||||
:tag => ['openstack', 'swift-package'],
|
||||
:notify => ['Anchor[swift::install::end]']
|
||||
)
|
||||
end
|
||||
it do
|
||||
|
Loading…
Reference in New Issue
Block a user