Untitled

From Flying Motmot, 7 Years ago, written in Plain Text, viewed 529 times.
URL https://p.gaa.st/view/5665728 Embed
Download Paste or View Raw
  1. class bitlbee_srv($name, $certname) {
  2.         # Partially copied from sid3windr http://pastebin.com/DsCqn0CY
  3.         apt::source {
  4.                 "bitlbee":
  5.                         location => "http://code.bitlbee.org/debian/devel/${lsbdistcodename}/${architecture}/",
  6.                         release => "./",
  7.                         repos => "",
  8.                         include_src => false,
  9.                         key      => {
  10.                                 "id"     => "FC7345337B5B29D8DAA1A88E94EEA1F2C7E50436",
  11.                                 "server" => "pgp.mit.edu",
  12.                         },
  13.         }
  14.        
  15.         # TODO(wilmer): Translation from $lsbdistcodename to Debian_x.x if I'm ever sufficiently bored?
  16.         apt::source {
  17.                 "jgeboski":
  18.                         location => "http://download.opensuse.org/repositories/home:/jgeboski/Debian_8.0",
  19.                         release => "./",
  20.                         repos => "",
  21.                         include_src => false,
  22.                         key      => {
  23.                                 "id"     => "1E7BF737CB8709F0F740625B12C6ADA61C85BB5E",
  24.                                 "server" => "pgp.mit.edu",
  25.                         },
  26.         }
  27.  
  28.         package {
  29.                 ["bitlbee", "stunnel4"]:
  30.                         ensure => latest;
  31.                 #"bitlbee-facebook", "bitlbee-steam"
  32.         }
  33.  
  34.         service {
  35.                 ["bitlbee", "stunnel4"]:
  36.                         ensure => running,
  37.         }
  38.  
  39.         exec { "stunnel-reload":
  40.                 command => "/etc/init.d/stunnel4 reload",
  41.                 refreshonly => true,
  42.                 require => Service["stunnel4"],
  43.         }
  44.        
  45.         letsencrypt::cert { "$certname":
  46.                 notify => Exec["stunnel-reload"],
  47.         }
  48.        
  49.         file { "/etc/bitlbee/bitlbee.conf":
  50.                 content => template("bitlbee_srv/bitlbee.conf"),
  51.                 mode => 0640,
  52.                 owner => "root",
  53.                 group => "bitlbee",
  54.                 notify => Service["bitlbee"],
  55.                 #requires => Package["bitlbee"], # for bitlbee group ... except this feature apparently doesn't exist?
  56.         }
  57.        
  58.         file { "/etc/bitlbee/motd.txt":
  59.                 content => template("bitlbee_srv/motd-${name}.txt"),
  60.         }
  61.        
  62.         file { "/etc/stunnel/stunnel.conf":
  63.                 content => template("bitlbee_srv/stunnel.conf"),
  64.                 notify => Exec["stunnel-reload"],
  65.         }
  66.  
  67.         augeas {
  68.                 "stunnel-start":
  69.                 context => "/files/etc/default/stunnel4",
  70.                 changes => "set ENABLED 1",
  71.         }
  72. }
  73.  

Reply to "Untitled"

Here you can reply to the paste above