]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/ganeti2/manifests/init.pp
add ganeti3
[dsa-puppet.git] / modules / ganeti2 / manifests / init.pp
1 class ganeti2 {
2
3         package { 'ganeti2':
4                 ensure => installed
5         }
6
7         package { 'ganeti-instance-debootstrap':
8                 ensure => installed
9         }
10
11         package { 'ganeti-htools':
12                 ensure => installed
13         }
14
15         case $::cluster {
16                 'ganeti2.debian.org': {
17                         package { 'drbd8-utils':
18                                 ensure => installed
19                         }
20
21                         @ferm::rule { 'dsa-ganeti-noded-v4':
22                                 description => 'allow ganeti-noded communication',
23                                 rule        => 'proto tcp mod state state (NEW) dport (1811) @subchain \'ganeti-noded\' { saddr ($HOST_GANETI_V4) daddr ($HOST_GANETI_V4) ACCEPT; }',
24                                 notarule    => true,
25                         }
26
27                         @ferm::rule { 'dsa-ganeti-confd-v4':
28                                 description => 'allow ganeti-confd communication',
29                                 rule        => 'proto udp mod state state (NEW) dport (1814) @subchain \'ganeti-confd\' { saddr ($HOST_GANETI_V4) daddr ($HOST_GANETI_V4) ACCEPT; }',
30                                 notarule    => true,
31                         }
32
33                         @ferm::rule { 'dsa-ganeti-rapi-v4':
34                                 description => 'allow ganeti-rapi communication',
35                                 rule        => 'proto tcp mod state state (NEW) dport (5080) @subchain \'ganeti-rapi\' { saddr ($HOST_GANETI_V4) daddr ($HOST_GANETI_V4) ACCEPT; }',
36                                 notarule    => true,
37                         }
38
39                         @ferm::rule { 'dsa-ganeti-drbd-v4':
40                                 description => 'allow ganeti drbd communication',
41                                 rule        => 'proto tcp mod state state (NEW) dport (11000:11999) @subchain \'ganeti-drbd\' { saddr ($HOST_GANETI_BACKEND_V4) daddr ($HOST_GANETI_BACKEND_V4) ACCEPT; }',
42                                 notarule    => true,
43                         }
44
45                         @ferm::rule { 'dsa-ganeti-kvm-migration-v4':
46                                 description => 'allow ganeti kvm migration ',
47                                 rule        => 'proto tcp dport 8102 @subchain \'ganeti-kvm-migration\' { saddr ($HOST_GANETI_BACKEND_V4) daddr ($HOST_GANETI_BACKEND_V4) ACCEPT; }',
48                                 notarule    => true,
49                         }
50
51                         @ferm::rule { 'dsa-ganeti-ssh-v4':
52                                 description => 'allow ganeti to ssh around',
53                                 rule        => 'proto tcp dport ssh @subchain \'ganeti-ssh\' { saddr ( $HOST_GANETI_V4 $HOST_GANETI_BACKEND_V4) ACCEPT; }',
54                                 notarule    => true,
55                         }
56                 }
57                 'ganeti3.debian.org': {
58                         package { 'drbd8-utils':
59                                 ensure => installed
60                         }
61
62                         @ferm::rule { 'dsa-ganeti-noded-v4':
63                                 description => 'allow ganeti-noded communication',
64                                 rule        => 'proto tcp mod state state (NEW) dport (1811) @subchain \'ganeti-noded\' { saddr ($HOST_GANETI_MANDA_V4) daddr ($HOST_GANETI_MANDA_V4) ACCEPT; }',
65                                 notarule    => true,
66                         }
67
68                         @ferm::rule { 'dsa-ganeti-confd-v4':
69                                 description => 'allow ganeti-confd communication',
70                                 rule        => 'proto udp mod state state (NEW) dport (1814) @subchain \'ganeti-confd\' { saddr ($HOST_GANETI_MANDA_V4) daddr ($HOST_GANETI_MANDA_V4) ACCEPT; }',
71                                 notarule    => true,
72                         }
73
74                         @ferm::rule { 'dsa-ganeti-rapi-v4':
75                                 description => 'allow ganeti-rapi communication',
76                                 rule        => 'proto tcp mod state state (NEW) dport (5080) @subchain \'ganeti-rapi\' { saddr ($HOST_GANETI_MANDA_V4) daddr ($HOST_GANETI_MANDA_V4) ACCEPT; }',
77                                 notarule    => true,
78                         }
79
80                         @ferm::rule { 'dsa-ganeti-drbd-v4':
81                                 description => 'allow ganeti drbd communication',
82                                 rule        => 'proto tcp mod state state (NEW) dport (11000:11999) @subchain \'ganeti-drbd\' { saddr ($HOST_GANETI_MANDA_BACKEND_V4) daddr ($HOST_GANETI_MANDA_BACKEND_V4) ACCEPT; }',
83                                 notarule    => true,
84                         }
85
86                         @ferm::rule { 'dsa-ganeti-kvm-migration-v4':
87                                 description => 'allow ganeti kvm migration ',
88                                 rule        => 'proto tcp dport 8102 @subchain \'ganeti-kvm-migration\' { saddr ($HOST_GANETI_MANDA_BACKEND_V4) daddr ($HOST_GANETI_MANDA_BACKEND_V4) ACCEPT; }',
89                                 notarule    => true,
90                         }
91
92                         @ferm::rule { 'dsa-ganeti-ssh-v4':
93                                 description => 'allow ganeti to ssh around',
94                                 rule        => 'proto tcp dport ssh @subchain \'ganeti-ssh\' { saddr ( $HOST_GANETI_MANDA_V4 $HOST_GANETI_MANDA_BACKEND_V4) ACCEPT; }',
95                                 notarule    => true,
96                         }
97                 }
98         }
99
100         file {
101                 '/etc/ganeti/instance-debootstrap/variants.list':
102                         content => template('ganeti2/instance-debootstrap/variants.list.erb'),
103                         ;
104                 '/etc/ganeti/instance-debootstrap/variants/dsa.conf':
105                         content => template('ganeti2/instance-debootstrap/variants/dsa.conf.erb'),
106                         ;
107                 '/etc/ganeti/instance-debootstrap/hooks/00-dsa-configure-networking':
108                         content => template('ganeti2/instance-debootstrap/hooks/00-dsa-configure-networking.erb'),
109                         mode   => '0555',
110                         ;
111                 '/etc/ganeti/instance-debootstrap/hooks/10-dsa-install-extra-packages':
112                         content => template('ganeti2/instance-debootstrap/hooks/10-dsa-install-extra-packages.erb'),
113                         mode   => '0555',
114                         ;
115                 '/etc/ganeti/instance-debootstrap/hooks/20-dsa-install-bootloader':
116                         content => template('ganeti2/instance-debootstrap/hooks/20-dsa-install-bootloader.erb'),
117                         mode   => '0555',
118                         ;
119                 '/etc/ganeti/instance-debootstrap/hooks/30-dsa-install-ssh-keys':
120                         content => template('ganeti2/instance-debootstrap/hooks/30-dsa-install-ssh-keys.erb'),
121                         mode   => '0555',
122                         ;
123                 '/etc/ganeti/instance-debootstrap/hooks/40-dsa-setup-swapfile':
124                         content => template('ganeti2/instance-debootstrap/hooks/40-dsa-setup-swapfile.erb'),
125                         mode   => '0555',
126                         ;
127                 '/etc/ganeti/instance-debootstrap/hooks/clear-root-password':
128                         mode   => '0444',
129                         ;
130                 '/etc/ganeti/instance-debootstrap/hooks/xen-hvc0':
131                         mode   => '0444',
132                         ;
133         }
134
135 }