class bitlbee_srv($name, $certname) { # Partially copied from sid3windr http://pastebin.com/DsCqn0CY apt::source { "bitlbee": location => "http://code.bitlbee.org/debian/devel/${lsbdistcodename}/${architecture}/", release => "./", repos => "", include_src => false, key => { "id" => "FC7345337B5B29D8DAA1A88E94EEA1F2C7E50436", "server" => "pgp.mit.edu", }, } # TODO(wilmer): Translation from $lsbdistcodename to Debian_x.x if I'm ever sufficiently bored? apt::source { "jgeboski": location => "http://download.opensuse.org/repositories/home:/jgeboski/Debian_8.0", release => "./", repos => "", include_src => false, key => { "id" => "1E7BF737CB8709F0F740625B12C6ADA61C85BB5E", "server" => "pgp.mit.edu", }, } package { ["bitlbee", "stunnel4"]: ensure => latest; #"bitlbee-facebook", "bitlbee-steam" } service { ["bitlbee", "stunnel4"]: ensure => running, } exec { "stunnel-reload": command => "/etc/init.d/stunnel4 reload", refreshonly => true, require => Service["stunnel4"], } letsencrypt::cert { "$certname": notify => Exec["stunnel-reload"], } file { "/etc/bitlbee/bitlbee.conf": content => template("bitlbee_srv/bitlbee.conf"), mode => 0640, owner => "root", group => "bitlbee", notify => Service["bitlbee"], #requires => Package["bitlbee"], # for bitlbee group ... except this feature apparently doesn't exist? } file { "/etc/bitlbee/motd.txt": content => template("bitlbee_srv/motd-${name}.txt"), } file { "/etc/stunnel/stunnel.conf": content => template("bitlbee_srv/stunnel.conf"), notify => Exec["stunnel-reload"], } augeas { "stunnel-start": context => "/files/etc/default/stunnel4", changes => "set ENABLED 1", } }