diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2012-01-28 14:09:30 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2012-01-28 14:09:30 -0200 |
commit | afade3b215bc5c10fdbf30a5d8b6d97e87302aaa (patch) | |
tree | a25deb96cf1616cda6278929a5408e31edf428e7 /manifests | |
download | puppet-qwebirc-afade3b215bc5c10fdbf30a5d8b6d97e87302aaa.tar.gz puppet-qwebirc-afade3b215bc5c10fdbf30a5d8b6d97e87302aaa.tar.bz2 |
Initial import
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/init.pp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/manifests/init.pp b/manifests/init.pp new file mode 100644 index 0000000..3e50670 --- /dev/null +++ b/manifests/init.pp @@ -0,0 +1,72 @@ +# Based on https://wiki.koumbit.net/QwebIrc +class qwebirc($ircserver = 'irc.myserver.com', $ircport = '6667', $realname = 'http://moo.com/', + $webirc_mode = 'None', $base_url = 'http://foo.foo.org/', $network_name = 'FooNet', + $sslport = false) { + + package { [ 'python-twisted', 'python-openssl', 'python-simplejson', 'mercurial' ]: + ensure => present, + } + + group { "qwebirc": + ensure => present, + allowdupe => false, + } + + user { "qwebirc": + ensure => present, + allowdupe => false, + gid => 'qwebirc', + require => Group['qwebirc'], + } + + file { '/etc/init.d/qwebirc': + ensure => present, + owner => root, + group => root, + mode => 0755, + source => 'puppet:///modules/qwebirc/qwebirc-init.d.sh', + require => Vcsrepo['/var/lib/qwebirc'], + } + + vcsrepo { "/var/lib/qwebirc": + ensure => present, + provider => hg, + source => 'https://bitbucket.org/qwebirc/qwebirc', + revision => '19d6068a1aa6', + owner => 'qwebirc', + group => 'qwebirc', + require => [ User['qwebirc'], Group['qwebirc'], Package['mercurial'] ], + notify => Service['qwebirc'], + } + + file { '/var/lib/qwebirc/config.py': + ensure => present, + owner => 'qwebirc', + group => 'qwebirc', + mode => 0640, + content => template('qwebirc/config.py.erb'), + require => Vcsrepo['/var/lib/qwebirc'], + notify => Service['qwebirc'], + } + + # See http://hg.qwebirc.org/qwebirc/issue/152/ssl + file { '/var/lib/qwebirc/qwebirc/ircclient.py': + ensure => present, + owner => 'qwebirc', + group => 'qwebirc', + mode => 0640, + source => 'puppet:///modules/qwebirc/ircclient-ssl.py', + require => Vcsrepo['/var/lib/qwebirc'], + notify => Service['qwebirc'], + } + + service { 'qwebirc': + enable => true, + ensure => running, + hasrestart => true, + hasstatus => true, + require => [ File['/etc/init.d/qwebirc', '/var/lib/qwebirc/config.py', + '/var/lib/qwebirc/qwebirc/ircclient.py'], + Package['python-twisted'] ], + } +} |