From 4ff3e18f3a338f9667649f52af1057a5099f799b Mon Sep 17 00:00:00 2001 From: Dan Bode Date: Mon, 23 Jan 2012 13:12:57 -0800 Subject: [PATCH] Split example manifests into separate files This commit splits the example manifest into separate files all and pre and removes the node declarations --- README.markdown | 6 ++- examples/all.pp | 81 ++++++++++++++++++++++++++++++++++++ examples/pre.pp | 23 +++++++++++ examples/site.pp | 105 ----------------------------------------------- 4 files changed, 108 insertions(+), 107 deletions(-) create mode 100644 examples/all.pp create mode 100644 examples/pre.pp delete mode 100644 examples/site.pp diff --git a/README.markdown b/README.markdown index 03ad88ab..29aba5fc 100644 --- a/README.markdown +++ b/README.markdown @@ -146,9 +146,11 @@ There are a few known issues with this code: This example can be used as follows: - puppet apply examples/site.pp --certname pre_swift + # set up pre-reqs + puppet apply examples/pre.pp - puppet apply examples/site.pp --certname swift_all + # install all swift components on a single node + puppet apply examples/all.pp # Verifying installation # diff --git a/examples/all.pp b/examples/all.pp new file mode 100644 index 00000000..02793088 --- /dev/null +++ b/examples/all.pp @@ -0,0 +1,81 @@ +# +# 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 } + +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'], +} + diff --git a/examples/pre.pp b/examples/pre.pp new file mode 100644 index 00000000..036c150d --- /dev/null +++ b/examples/pre.pp @@ -0,0 +1,23 @@ +# this file +# contains puppet resources +# that I used to set up my +# environment before installing swift + +# set up all of the pre steps +# this shoud be run + +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'], +} diff --git a/examples/site.pp b/examples/site.pp deleted file mode 100644 index cc6989ff..00000000 --- a/examples/site.pp +++ /dev/null @@ -1,105 +0,0 @@ -# -# 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'], - } - -} -