summaryrefslogtreecommitdiffstats
path: root/manifests/host.pp
diff options
context:
space:
mode:
authorJames Shubin <james@shubin.ca>2012-07-26 16:01:22 -0400
committerJames Shubin <james@shubin.ca>2012-07-26 16:01:22 -0400
commit04b30ca4c784e2bfaadeea28f33214e666f1222b (patch)
tree6c6166c067cde426a421da9c4c45133238056dd7 /manifests/host.pp
parent61cf89af55bd57a224f0e600746a05a71fdb4c95 (diff)
downloadpuppet-gluster-04b30ca4c784e2bfaadeea28f33214e666f1222b.tar.gz
puppet-gluster-04b30ca4c784e2bfaadeea28f33214e666f1222b.tar.xz
puppet-gluster-04b30ca4c784e2bfaadeea28f33214e666f1222b.zip
Change tabs to spaces as per bodepd's insistence :)
Diffstat (limited to 'manifests/host.pp')
-rw-r--r--manifests/host.pp120
1 files changed, 60 insertions, 60 deletions
diff --git a/manifests/host.pp b/manifests/host.pp
index e1b7876..00f6a18 100644
--- a/manifests/host.pp
+++ b/manifests/host.pp
@@ -16,66 +16,66 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
define gluster::host(
- $uuid
+ $uuid
) {
- # if we're on itself
- if ( "${fqdn}" == "${name}" ) {
- # set a unique uuid per host
- file { '/var/lib/glusterd/glusterd.info':
- content => template('gluster/glusterd.info.erb'),
- owner => root,
- group => root,
- mode => 644, # u=rw,go=r
- ensure => present,
- require => File['/var/lib/glusterd/'],
- }
- } else {
- # set uuid=
- exec { "/bin/echo 'uuid=${uuid}' >> '/var/lib/glusterd/peers/${uuid}'":
- logoutput => on_failure,
- unless => "/bin/grep -qF 'uuid=' '/var/lib/glusterd/peers/${uuid}'",
- notify => File['/var/lib/glusterd/peers/'], # propagate the notify up
- before => File["/var/lib/glusterd/peers/${uuid}"],
- alias => "gluster-host-uuid-${name}",
- # FIXME: doing this causes a dependency cycle! adding
- # the Package[] require doesn't. It would be most
- # correct to require the peers/ folder, but since it's
- # not working, requiring the Package[] will still give
- # us the same result. (Package creates peers/ folder).
- # NOTE: it's possible the cycle is a bug in puppet or a
- # bug in the dependencies somewhere else in this module.
- #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,
- unless => "/bin/grep -qF 'state=' '/var/lib/glusterd/peers/${uuid}'",
- notify => File['/var/lib/glusterd/peers/'], # propagate the notify up
- before => File["/var/lib/glusterd/peers/${uuid}"],
- 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,
- unless => "/bin/grep -qF 'hostname1=' '/var/lib/glusterd/peers/${uuid}'",
- notify => File['/var/lib/glusterd/peers/'], # propagate the notify up
- 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,
- notify => File['/var/lib/glusterd/peers/'], # propagate the notify up
- owner => root,
- group => root,
- # NOTE: this mode was found by inspecting the process
- mode => 600, # u=rw,go=
- }
- }
+ # if we're on itself
+ if ( "${fqdn}" == "${name}" ) {
+ # set a unique uuid per host
+ file { '/var/lib/glusterd/glusterd.info':
+ content => template('gluster/glusterd.info.erb'),
+ owner => root,
+ group => root,
+ mode => 644, # u=rw,go=r
+ ensure => present,
+ require => File['/var/lib/glusterd/'],
+ }
+ } else {
+ # set uuid=
+ exec { "/bin/echo 'uuid=${uuid}' >> '/var/lib/glusterd/peers/${uuid}'":
+ logoutput => on_failure,
+ unless => "/bin/grep -qF 'uuid=' '/var/lib/glusterd/peers/${uuid}'",
+ notify => File['/var/lib/glusterd/peers/'], # propagate the notify up
+ before => File["/var/lib/glusterd/peers/${uuid}"],
+ alias => "gluster-host-uuid-${name}",
+ # FIXME: doing this causes a dependency cycle! adding
+ # the Package[] require doesn't. It would be most
+ # correct to require the peers/ folder, but since it's
+ # not working, requiring the Package[] will still give
+ # us the same result. (Package creates peers/ folder).
+ # NOTE: it's possible the cycle is a bug in puppet or a
+ # bug in the dependencies somewhere else in this module.
+ #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,
+ unless => "/bin/grep -qF 'state=' '/var/lib/glusterd/peers/${uuid}'",
+ notify => File['/var/lib/glusterd/peers/'], # propagate the notify up
+ before => File["/var/lib/glusterd/peers/${uuid}"],
+ 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,
+ unless => "/bin/grep -qF 'hostname1=' '/var/lib/glusterd/peers/${uuid}'",
+ notify => File['/var/lib/glusterd/peers/'], # propagate the notify up
+ 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,
+ notify => File['/var/lib/glusterd/peers/'], # propagate the notify up
+ owner => root,
+ group => root,
+ # NOTE: this mode was found by inspecting the process
+ mode => 600, # u=rw,go=
+ }
+ }
}