aboutsummaryrefslogtreecommitdiffstats
path: root/modules/ii
diff options
context:
space:
mode:
Diffstat (limited to 'modules/ii')
-rw-r--r--modules/ii/manifests/init.pp30
1 files changed, 30 insertions, 0 deletions
diff --git a/modules/ii/manifests/init.pp b/modules/ii/manifests/init.pp
new file mode 100644
index 00000000..0c80db40
--- /dev/null
+++ b/modules/ii/manifests/init.pp
@@ -0,0 +1,30 @@
+class ii {
+ class base {
+ package { "ii": }
+
+ file { "/var/lib/ii/":
+ ensure => directory,
+ owner => nobody,
+ }
+ }
+
+ define bot($server = 'irc.freenode.net',
+ $channel) {
+
+ $nick = $name
+
+ include ii::base
+
+ service { 'ii':
+ provider => base,
+ start => "su nobody -c 'ii -n $nick -i /var/lib/ii/$nick -s $server'",
+ notify => "join channel",
+ }
+
+ exec { "join channel":
+ command => "echo '/j $channel' > /var/lib/ii/$nick/$server/in",
+ user => nobody,
+ refreshonly => true,
+ }
+ }
+}