Skip to content

Commit

Permalink
Merge pull request #8 from PivitPtyLtd/codecleanup
Browse files Browse the repository at this point in the history
indentation cleanup
  • Loading branch information
tobru committed Jul 29, 2014
2 parents 826e2a5 + eaf31a1 commit 293f880
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 70 deletions.
110 changes: 55 additions & 55 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -79,65 +79,65 @@
# user => root,
# minute => '*/15';
#}
}
## Master/Standalone configuration
## collect slaves if mode is master and create Targets
## if mode is standalone, just create targets...
/^(master|standalone)$/: {
}
## Master/Standalone configuration
## collect slaves if mode is master and create Targets
## if mode is standalone, just create targets...
/^(master|standalone)$/: {

if $mode == 'master' {
# collect slaves
File <<| tag == "smokeping-slave-${master_name}" |>>
file { $smokeping::slave_dir: ensure => directory; }
concat { '/etc/smokeping/config.d/Slaves':
owner => root,
group => root,
mode => '0644',
}
concat::fragment { 'slaves-header':
target => '/etc/smokeping/config.d/Slaves',
order => 10,
content => "*** Slaves ***\nsecrets=${smokeping::slave_secrets}\n\n"
}
Concat::Fragment <<| tag == "smokeping-slave-${master_name}" |>>
if $mode =~ /^master$/ {
# collect slaves
File <<| tag == "smokeping-slave-${master_name}" |>>
file { $smokeping::slave_dir: ensure => directory; }
concat { '/etc/smokeping/config.d/Slaves':
owner => root,
group => root,
mode => '0644',
}
concat::fragment { 'slaves-header':
target => '/etc/smokeping/config.d/Slaves',
order => 10,
content => "*** Slaves ***\nsecrets=${smokeping::slave_secrets}\n\n"
}
Concat::Fragment <<| tag == "smokeping-slave-${master_name}" |>>

# collect shared secrets from slaves
concat { $smokeping::slave_secrets:
owner => smokeping,
group => $webserver_group,
mode => '0640',
}
Concat::Fragment <<| tag == "smokeping-slave-secret-${master_name}" |>>
} else {
# ensure $smokeping::slave_secret is there
file {
$smokeping::slave_secrets:
ensure => present,
owner => smokeping,
group => $webserver_group,
mode => '0640';
}
}
# collect shared secrets from slaves
concat { $smokeping::slave_secrets:
owner => smokeping,
group => $webserver_group,
mode => '0640',
}
Concat::Fragment <<| tag == "smokeping-slave-secret-${master_name}" |>>
} else {
# ensure $smokeping::slave_secret is there
file {
$smokeping::slave_secrets:
ensure => present,
owner => smokeping,
group => $webserver_group,
mode => '0640';
}
}

# create target definitions
file { $smokeping::targets_dir:
ensure => directory,
recurse => true,
purge => true,
force => true,
}
concat { '/etc/smokeping/config.d/Targets':
owner => root,
group => root,
mode => '0644',
}
concat::fragment { 'targets-header':
target => '/etc/smokeping/config.d/Targets',
order => 10,
content => template('smokeping/targets-header.erb'),
}
# create target definitions
file { $smokeping::targets_dir:
ensure => directory,
recurse => true,
purge => true,
force => true,
}
concat { '/etc/smokeping/config.d/Targets':
owner => root,
group => root,
mode => '0644',
}
concat::fragment { 'targets-header':
target => '/etc/smokeping/config.d/Targets',
order => 10,
content => template('smokeping/targets-header.erb'),
}
default: { fail("mode ${mode} unknown") }
}
default: { fail("mode ${mode} unknown") }
}

}
30 changes: 15 additions & 15 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -150,21 +150,21 @@
type => 'loss',
pattern => '>0%,*12*,>0%,*12*,>0%',
comment => 'loss 3 times in a row' } ],
$cgi_remark_top = 'Welcome to the SmokePing website of xxx Company. Here you will learn all about the latency of our network.',
$cgi_title_top = 'Network Latency Grapher',
$targets_dir = '/etc/smokeping/config.d/targets.d',
$daemon_user = 'smokeping',
$daemon_group = 'smokeping',
$path_sendmail = '/usr/sbin/sendmail',
$path_imgcache = '/var/cache/smokeping/images',
$path_imgurl = '../smokeping/images',
$path_datadir = '/var/lib/smokeping',
$path_piddir = '/var/run/smokeping',
$path_smokemail = '/etc/smokeping/smokemail',
$path_tmail = '/etc/smokeping/tmail',
$version = 'present',
$enable = true,
$start = true,
$cgi_remark_top = 'Welcome to the SmokePing website of xxx Company. Here you will learn all about the latency of our network.',
$cgi_title_top = 'Network Latency Grapher',
$targets_dir = '/etc/smokeping/config.d/targets.d',
$daemon_user = 'smokeping',
$daemon_group = 'smokeping',
$path_sendmail = '/usr/sbin/sendmail',
$path_imgcache = '/var/cache/smokeping/images',
$path_imgurl = '../smokeping/images',
$path_datadir = '/var/lib/smokeping',
$path_piddir = '/var/run/smokeping',
$path_smokemail = '/etc/smokeping/smokemail',
$path_tmail = '/etc/smokeping/tmail',
$version = 'present',
$enable = true,
$start = true,
) {
class{'smokeping::install': } ->
class{'smokeping::config': } ~>
Expand Down

0 comments on commit 293f880

Please sign in to comment.