diff options
Diffstat (limited to 'modules/ii/manifests/init.pp')
| -rw-r--r-- | modules/ii/manifests/init.pp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/modules/ii/manifests/init.pp b/modules/ii/manifests/init.pp index f1ea271b..2947c75d 100644 --- a/modules/ii/manifests/init.pp +++ b/modules/ii/manifests/init.pp @@ -1,36 +1,37 @@ class ii { class base { - package { ["ii", "perl-Proc-Daemon"]: } + package {['ii', + 'perl-Proc-Daemon']: } - file { "/var/lib/ii/": + file { '/var/lib/ii/': ensure => directory, - owner => nobody, + owner => 'nobody', } } - define bot($server = 'irc.freenode.net', - $channel) { + define bot( $server = 'irc.freenode.net', + $channel) { $nick = $name include ii::base - # a custom wrappper is needed since ii do not fork in the + # a custom wrapper is needed since ii does not fork in the # background, and bash is not able to properly do it - local_script { "ii_$nick": - content => template("ii/ii_wrapper.pl"), + mga_common::local_script { "ii_${nick}": + content => template('ii/ii_wrapper.pl'), require => Class['ii::base'], } service { 'ii': provider => base, - start => "/usr/local/bin/ii_$nick", - require => Local_script["ii_$nick"], + start => "/usr/local/bin/ii_${nick}", + require => Mga_common::Local_script["ii_${nick}"], } - exec { "join channel $nick": - command => "echo '/j $channel' > /var/lib/ii/$nick/$server/in", - user => nobody, - creates => "/var/lib/ii/$nick/$server/$channel/in", + exec { "join channel ${nick}": + command => "echo '/j ${channel}' > /var/lib/ii/${nick}/${server}/in", + user => 'nobody', + creates => "/var/lib/ii/${nick}/${server}/${channel}/in", require => Service['ii'], } } |
