aboutsummaryrefslogtreecommitdiff
path: root/manifests/vserver.pp
blob: 21bed2638791b7e4e8fd3015c0c0b5f9c4a7cc6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
class nodo::vserver inherits nodo {
  include timezone

  class { 'syslog-ng::vserver': }

  class { 'sshd':
    listen_address          => $sshd_listen_address,
    password_authentication => $sshd_password_authentication,
    shared_ip               => $sshd_shared_ip,
    tcp_forwarding          => $sshd_tcp_forwarding,
    hardened_ssl            => $sshd_hardened_ssl,
    print_motd              => $sshd_print_motd,
    ports                   => $sshd_ports,
    use_pam                 => $sshd_use_pam,
  }

  backupninja::sys { "sys":
    ensure     => present,
    partitions => false,
    hardware   => false,
    dosfdisk   => false,
    dohwinfo   => false,
  }

  $hosting_type = $node_hosting_type ? {
    ''      => "direct",
    default => "$node_hosting_type",
  }

  case $hosting_type {
    "direct": {
      # Apply munin and monkeysphere configuration for
      # for directly hosted nodes.
      Munin_node        <<| title == $hostname |>>
      Monkeysphere_host <<| title == $hostname |>>

      # Set proxy configuration
      $nodo_https_proxy = 'yes'
    }
    "third-party": {
      # Apply munin and monkeysphere configuration for
      # nodes hosted by third-parties.
      munin_node { "$hostname": }
      monkeysphere_host { "$hostname":
        port => $node_ssh_port,
      }

      # Nagios configuration
      class { 'monitor':
        type       => 'vserver',
        use_nagios => extlookup('vserver_use_nagios', 'false'),
      }
    }
  }

}