Files
puppet-swift/examples/site.pp
Dan Bode ece1d8407f Refactor of example site.pp
This commit refactors the previous site.pp example.

Adds ring building types and removes the ringbuilding
file.

Remove unnessary comments.

Adds requirement that swift proxy is only configured
after the ring is built.
2012-01-23 11:44:22 -08:00

106 lines
2.3 KiB
Puppet

#
# This example file is almost the
# same as what I have been using
# to build swift in my environment (which is based on vagrant)
$proxy_local_net_ip='127.0.0.1'
$swift_shared_secret='changeme'
Exec { logoutput => true }
# set up all of the pre steps
# this shoud be run
node pre_swift {
class { 'apt':}
# use the swift trunk ppa
class { 'swift::repo::trunk':}
# use our apt repo
apt::source { 'puppet':
location => 'http://apt.puppetlabs.com/ubuntu',
release => 'natty',
key => '4BD6EC30',
}
# install the latest version of Puppet
package { 'puppet':
ensure => latest,
require => Apt::Source['puppet'],
}
}
node swift_all {
package { 'curl': ensure => present }
class { 'ssh::server::install': }
class { 'memcached':
listen_ip => $proxy_local_net_ip,
}
class { 'swift':
# not sure how I want to deal with this shared secret
swift_hash_suffix => $swift_shared_secret,
package_ensure => latest,
}
swift::storage::loopback { ['1', '2', '3']:
require => Class['swift'],
}
Ring_object_device { weight => 1 }
Ring_container_device { weight => 1 }
Ring_account_device { weight => 1 }
ring_object_device { '127.0.0.1:6010':
zone => 1,
device_name => '1',
}
ring_object_device { '127.0.0.1:6020':
zone => 2,
device_name => '2',
}
ring_object_device { '127.0.0.1:6030':
zone => 3,
device_name => '3',
}
ring_container_device { '127.0.0.1:6011':
zone => 1,
device_name => '1',
}
ring_container_device { '127.0.0.1:6021':
zone => 2,
device_name => '2',
}
ring_container_device { '127.0.0.1:6031':
zone => 3,
device_name => '3',
}
ring_account_device { '127.0.0.1:6012':
zone => 1,
device_name => '1',
}
ring_account_device { '127.0.0.1:6022':
zone => 2,
device_name => '2',
}
ring_account_device { '127.0.0.1:6032':
zone => 3,
device_name => '3',
}
class { 'swift::ringbuilder':
part_power => '18',
replicas => '3',
min_part_hours => 1,
require => Class['swift'],
}
class { 'swift::storage': }
# TODO should I enable swath in the default config?
class { 'swift::proxy':
account_autocreate => true,
require => Class['swift::ringbuilder'],
}
}