diff options
author | James Shubin <james@shubin.ca> | 2012-07-27 14:48:57 -0400 |
---|---|---|
committer | James Shubin <james@shubin.ca> | 2012-07-27 14:48:57 -0400 |
commit | a473b314b5072396aa8b6b61e3affcc0ed5d3e3b (patch) | |
tree | 460440599699d9c4b5cb0a043d78adebe07bf49d /manifests | |
parent | d079937ce30238fe9c3f89b9bf0700ad7ac6019a (diff) | |
download | puppet-gluster-a473b314b5072396aa8b6b61e3affcc0ed5d3e3b.tar.gz puppet-gluster-a473b314b5072396aa8b6b61e3affcc0ed5d3e3b.tar.xz puppet-gluster-a473b314b5072396aa8b6b61e3affcc0ed5d3e3b.zip |
Whitespace cleanup.
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/brick.pp | 34 | ||||
-rw-r--r-- | manifests/client.pp | 6 | ||||
-rw-r--r-- | manifests/host.pp | 6 | ||||
-rw-r--r-- | manifests/server.pp | 12 | ||||
-rw-r--r-- | manifests/volume.pp | 18 |
5 files changed, 38 insertions, 38 deletions
diff --git a/manifests/brick.pp b/manifests/brick.pp index e0b12de..71cf450 100644 --- a/manifests/brick.pp +++ b/manifests/brick.pp @@ -34,29 +34,29 @@ define gluster::brick( if ! ( "${host}:${mount}" == "${name}" ) { fail('The brick $name must match a $host-$mount pattern.') } - + Gluster::Host[$host] -> Gluster::Brick[$name] # brick requires host - + $ro_bool = $ro ? { # this has been added as a convenience true => 'ro', default => 'rw', } - + $valid_labeltype = $labeltype ? { #'msdos' => 'msdos', # TODO default => 'gpt', } - + $valid_fstype = $fstype ? { 'ext4' => 'ext4', # TODO default => 'xfs', } - + $force_flag = $force ? { true => 'f', default => '', } - + # XFS mount options: # http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/filesystems/xfs.txt;hb=HEAD if ( $valid_fstype == 'xfs' ) { @@ -96,34 +96,34 @@ define gluster::brick( } $options_list = ["${option01}", "${option02}"] - + } elsif ( $valid_fstype == 'ext4' ) { # exec requires include gluster::brick::ext4 $exec_requires = [Package['e2fsprogs']] - + # mkfs w/ uuid command $exec_mkfs = "/sbin/mkfs.${valid_fstype} -U '${fsuuid}' `/bin/readlink -e ${dev}`1" - + # mount options $options_list = [] # TODO } - + # put all the options in an array, remove the empty ones, and join with # commas (this removes ',,' double comma uglyness) # adding 'defaults' here ensures no ',' (leading comma) in mount command $mount_options = inline_template('<%= (["defaults"]+options_list).delete_if {|x| x.empty? }.join(",") %>') - + $exec_noop = $areyousure ? { true => false, default => true, } - + # if we're on itself if ( "${fqdn}" == "${host}" ) { - + # first get the device ready - + # the scary parted command to run... $exec_mklabel = "/sbin/parted -s -m -a optimal ${dev} mklabel ${valid_labeltype}" $exec_mkpart = "/sbin/parted -s -m -a optimal ${dev} mkpart primary 0% 100%" @@ -133,7 +133,7 @@ define gluster::brick( message => "${scary_exec}", } } - + exec { "${scary_exec}": logoutput => on_failure, unless => [ # if one element is true, this *doesn't* run @@ -146,7 +146,7 @@ define gluster::brick( noop => $exec_noop, alias => "gluster-brick-make-${name}", } - + # make an empty directory for the mount point file { "${mount}": ensure => directory, # make sure this is a directory @@ -155,7 +155,7 @@ define gluster::brick( force => false, # don't purge subdirs and links require => Exec["gluster-brick-make-${name}"], } - + mount { "${mount}": atboot => true, ensure => mounted, diff --git a/manifests/client.pp b/manifests/client.pp index b4123e9..47a577f 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -36,12 +36,12 @@ define gluster::client( # true => 'suid', # default => 'nosuid', #} - + $mounted_bool = $mounted ? { true => mounted, default => unmounted, } - + # make an empty directory for the mount point file { "${name}": ensure => directory, # make sure this is a directory @@ -49,7 +49,7 @@ define gluster::client( purge => false, # don't purge unmanaged files force => false, # don't purge subdirs and links } - + # Mount Options: # * backupvolfile-server=server-name # * fetch-attempts=N (where N is number of attempts) diff --git a/manifests/host.pp b/manifests/host.pp index 00f6a18..b2e4171 100644 --- a/manifests/host.pp +++ b/manifests/host.pp @@ -47,7 +47,7 @@ define gluster::host( #require => File['/var/lib/glusterd/peers/'], require => Package['glusterfs-server'], } - + # set state= exec { "/bin/echo 'state=3' >> '/var/lib/glusterd/peers/${uuid}'": logoutput => on_failure, @@ -57,7 +57,7 @@ define gluster::host( require => Exec["gluster-host-uuid-${name}"], alias => "gluster-host-state-${name}", } - + # set hostname1=... exec { "/bin/echo 'hostname1=${name}' >> '/var/lib/glusterd/peers/${uuid}'": logoutput => on_failure, @@ -66,7 +66,7 @@ define gluster::host( before => File["/var/lib/glusterd/peers/${uuid}"], require => Exec["gluster-host-state-${name}"], } - + # tag the file so it doesn't get removed by purge file { "/var/lib/glusterd/peers/${uuid}": ensure => present, diff --git a/manifests/server.pp b/manifests/server.pp index 2a77917..e45535f 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -29,7 +29,7 @@ class gluster::server( package { 'glusterfs-server': ensure => present, } - + # NOTE: not that we necessarily manage anything in here at the moment... file { '/etc/glusterfs/': ensure => directory, # make sure this is a directory @@ -42,7 +42,7 @@ class gluster::server( #notify => Service['glusterd'], # TODO: ??? require => Package['glusterfs-server'], } - + file { '/etc/glusterfs/glusterd.vol': content => template('gluster/glusterd.vol.erb'), # NOTE: currently no templating is being done owner => root, @@ -51,7 +51,7 @@ class gluster::server( ensure => present, require => File['/etc/glusterfs/'], } - + file { '/var/lib/glusterd/': ensure => directory, # make sure this is a directory recurse => false, # TODO: eventually... @@ -63,7 +63,7 @@ class gluster::server( #notify => Service['glusterd'], # TODO: eventually... require => File['/etc/glusterfs/glusterd.vol'], } - + file { '/var/lib/glusterd/peers/': ensure => directory, # make sure this is a directory recurse => true, # recursively manage directory @@ -75,7 +75,7 @@ class gluster::server( notify => Service['glusterd'], require => File['/var/lib/glusterd/'], } - + if $shorewall { if $allow == 'all' { $net = 'net' @@ -138,7 +138,7 @@ class gluster::server( ", comment => 'Allow nfs for gluster'} } } - + # start service only after the firewall is opened and hosts are defined service { 'glusterd': enable => true, # start on boot diff --git a/manifests/volume.pp b/manifests/volume.pp index 54716d4..21d7fb4 100644 --- a/manifests/volume.pp +++ b/manifests/volume.pp @@ -28,23 +28,23 @@ define gluster::volume( 'tcp,rdma' => 'tcp,rdma', default => 'tcp', } - + $valid_replica = $replica ? { '1' => '', default => "replica ${replica} ", } - + $valid_stripe = $stripe ? { '1' => '', default => "stripe ${stripe} ", } - + #Gluster::Brick[$bricks] -> Gluster::Volume[$name] # volume requires bricks - + # get the bricks that match our fqdn, and append /$name to their path. # return only these paths, which can be used to build the volume dirs. $volume_dirs = split(inline_template("<%= bricks.find_all{|x| x.split(':')[0] == '${fqdn}' }.collect {|y| y.split(':')[1].chomp('/')+'/${name}' }.join(' ') %>"), ' ') - + file { $volume_dirs: ensure => directory, # make sure this is a directory recurse => false, # don't recurse into directory @@ -53,10 +53,10 @@ define gluster::volume( before => Exec["gluster-volume-create-${name}"], require => Gluster::Brick[$bricks], } - + # add /${name} to the end of each: brick:/path entry $brick_spec = inline_template("<%= bricks.collect {|x| ''+x.chomp('/')+'/${name}' }.join(' ') %>") - + # EXAMPLE: gluster volume create test replica 2 transport tcp annex1.example.com:/storage1a/test annex2.example.com:/storage2a/test annex3.example.com:/storage3b/test annex4.example.com:/storage4b/test annex1.example.com:/storage1c/test annex2.example.com:/storage2c/test annex3.example.com:/storage3d/test annex4.example.com:/storage4d/test # NOTE: this should only happen on one host # FIXME: there might be a theoretical race condition if this runs at @@ -71,7 +71,7 @@ define gluster::volume( #require => Gluster::Brick[$bricks], alias => "gluster-volume-create-${name}", } - + # TODO: #if $shorewall { # shorewall::rule { 'gluster-TODO': @@ -82,7 +82,7 @@ define gluster::volume( # before => Service['glusterd'], # } #} - + if $start == true { # try to start volume if stopped exec { "/usr/sbin/gluster volume start ${name}": |