Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Add Debian/Ubuntu specific service naming changes.
Browse files Browse the repository at this point in the history
This patch also generalizes the service name, so that other operating
systems will also benefit from this patch by dropping in a yaml file.
  • Loading branch information
purpleidea committed May 7, 2014
1 parent e1d3c37 commit ad157b4
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 17 deletions.
3 changes: 3 additions & 0 deletions data/tree/Debian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@
gluster::params::package_glusterfs: 'glusterfs-client'
gluster::params::package_glusterfs_api: '' # doesn't exist
gluster::params::package_glusterfs_fuse: '' # doesn't exist
gluster::params::service_glusterd: 'glusterfs-server'
# TODO: the debian family of glusterd needs a reload command in the init file !
gluster::params::misc_gluster_reload: '/usr/sbin/service glusterfs-server restart'
# vim: ts=8
14 changes: 7 additions & 7 deletions manifests/host.pp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
fail("The chosen UUID: '${uuid}' is not valid.")
}

Gluster::Host[$name] -> Service['glusterd'] # glusterd requires host
Gluster::Host[$name] -> Service["${::gluster::params::service_glusterd}"] # glusterd requires host

# if we're on itself
if "${fqdn}" == "${name}" {
Expand Down Expand Up @@ -124,7 +124,7 @@
seltype => 'glusterd_var_lib_t',
seluser => 'system_u',
ensure => present,
notify => Service['glusterd'],
notify => Service["${::gluster::params::service_glusterd}"],
require => File['/var/lib/glusterd/'],
}

Expand Down Expand Up @@ -158,7 +158,7 @@
notify => [
# propagate the notify up
File['/var/lib/glusterd/peers/'],
Service['glusterd'], # ensure reload
Service["${::gluster::params::service_glusterd}"], # ensure reload
],
before => File["/var/lib/glusterd/peers/${valid_uuid}"],
alias => "gluster-host-uuid-${name}",
Expand All @@ -180,7 +180,7 @@
notify => [
# propagate the notify up
File['/var/lib/glusterd/peers/'],
Service['glusterd'], # ensure reload
Service["${::gluster::params::service_glusterd}"], # ensure reload
],
before => File["/var/lib/glusterd/peers/${valid_uuid}"],
require => Exec["gluster-host-uuid-${name}"],
Expand All @@ -194,7 +194,7 @@
notify => [
# propagate the notify up
File['/var/lib/glusterd/peers/'],
Service['glusterd'], # ensure reload
Service["${::gluster::params::service_glusterd}"], # ensure reload
],
before => File["/var/lib/glusterd/peers/${valid_uuid}"],
require => Exec["gluster-host-state-${name}"],
Expand All @@ -212,7 +212,7 @@
notify => [
# propagate the notify up
File['/var/lib/glusterd/peers/'],
Service['glusterd'], # ensure reload
Service["${::gluster::params::service_glusterd}"], # ensure reload
],
}
}
Expand Down Expand Up @@ -377,7 +377,7 @@
# them but this isn't a huge issue at the moment...
Shorewall::Rule <<| tag == 'gluster_firewall_management' |>> {
source => "${zone}", # use our source zone
before => Service['glusterd'],
before => Service["${::gluster::params::service_glusterd}"],
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@

$program_fping = '/usr/sbin/fping',

# services...
$service_glusterd = 'glusterd',

# misc...
$misc_gluster_reload = '/sbin/service glusterd reload',

Expand Down
10 changes: 5 additions & 5 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
owner => root,
group => root,
mode => 644,
#notify => Service['glusterd'], # TODO: ???
#notify => Service["${::gluster::params::service_glusterd}"], # TODO: ???
require => Package["${::gluster::params::package_glusterfs_server}"],
}

Expand Down Expand Up @@ -122,7 +122,7 @@
owner => root,
group => root,
mode => 644,
#notify => Service['glusterd'], # TODO: eventually...
#notify => Service["${::gluster::params::service_glusterd}"], # TODO: eventually...
require => File['/etc/glusterfs/glusterd.vol'],
}

Expand All @@ -134,7 +134,7 @@
owner => root,
group => root,
mode => 644,
notify => Service['glusterd'],
notify => Service["${::gluster::params::service_glusterd}"],
require => File['/var/lib/glusterd/'],
}

Expand Down Expand Up @@ -164,7 +164,7 @@
# ACCEPT ${src} $FW tcp 24009:${endport}
# ",
# comment => 'Allow 24000s for gluster',
# before => Service['glusterd'],
# before => Service["${::gluster::params::service_glusterd}"],
#}

#if $nfs { # FIXME: TODO
Expand All @@ -175,7 +175,7 @@
}

# start service only after the firewall is opened and hosts are defined
service { 'glusterd':
service { "${::gluster::params::service_glusterd}":
enable => true, # start on boot
ensure => running, # ensure it stays running
hasstatus => false, # FIXME: BUG: https://bugzilla.redhat.com/show_bug.cgi?id=836007
Expand Down
10 changes: 5 additions & 5 deletions manifests/volume.pp
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@

$require = $ping ? {
false => [
Service['glusterd'],
Service["${::gluster::params::service_glusterd}"],
File["${vardir}/volume/create-${name}.sh"],
File["${vardir}/xml.py"], # status check
Gluster::Brick[$valid_bricks],
Exec["gluster-volume-stuck-${name}"],
],
default => [
Service['glusterd'],
Service["${::gluster::params::service_glusterd}"],
File["${vardir}/volume/create-${name}.sh"],
Package["${::gluster::params::package_fping}"],
File["${vardir}/xml.py"], # status check
Expand All @@ -239,7 +239,7 @@
default => Common::Again::Delta['gluster-exec-again'],
},
require => [
Service['glusterd'],
Service["${::gluster::params::service_glusterd}"],
File["${vardir}/xml.py"], # stuck check
Gluster::Brick[$valid_bricks],
],
Expand Down Expand Up @@ -367,14 +367,14 @@
#Shorewall::Rule <<| tag == 'gluster_firewall_volume' and comment != "${fqdn}" |>> {
Shorewall::Rule <<| tag == 'gluster_firewall_volume' |>> {
source => "${zone}", # use our source zone
before => Service['glusterd'],
before => Service["${::gluster::params::service_glusterd}"],
}

Gluster::Rulewrapper <<| tag == 'gluster_firewall_volume' and match == "${name}" |>> {
#Shorewall::Rule <<| tag == 'gluster_firewall_volume' and match == "${name}" |>> {
source => "${zone}", # use our source zone
port => "${port}", # comma separated string or list
before => Service['glusterd'],
before => Service["${::gluster::params::service_glusterd}"],
}
}

Expand Down

0 comments on commit ad157b4

Please sign in to comment.