ee04b0bd14e01fb3e397a59f85d286a9da426641
[chaosvm.git] / modules / common / manifests / init.pp
1 class common {
2
3   # define admin contact mail address
4   
5   # aschiermeier@asl:~$ sudo cat /home/apt-dater/.ssh/authorized_keys
6   # ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAp+P0huFZ8h5GjZhtN2ZzM78pc30u2ZVrbmjLoGq9vYXBk2/jCIEWqg+L63EWg2EZcDsbxuKaf4/CYYnB213FYjhlhi8kvt/Gt3GTOxpf1/vEx+VZWpafeTDiTlKzqDHuFMHe+pEMe/OwIuK561ubttUAk6raixgkjxk0WYQX8HWLrO+jyyXstPmqs6lvQ7TYQajC8HmHb5vQWWSNWdcoeybMY+iD7H6e+4oAINs3yVMJN7Lfso7CySN1eYlFfsKExWJ59U1CrUbOgGfz5K6ommtSUqtxl+DOfmXVO40lpQ8iuTZ3YFZPuVunkw5Ce185DfZhKCSQqr+k+gKy2UFnVw== noc.cash-zone.de
7   # aschiermeier@asl:~$ sudo cat /root/.ssh/authorized_keys
8   # no-port-forwarding,no-X11-forwarding,no-agent-forwarding,from="5.231.239.2,::ffff:5.231.239.2" ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAygsqWq5lKygdAqO+GZGRB3t2P5FeQO8a3FZHKCOTpiI8CTycDZpiQnc6a/IsTHP4YvqhX9Swofu9jFDlVQXAExvuKmOlg5HZWAlCPxwMRarwN4QJvOowx+zoK0GVh3X/uNzMwKaNtk4GWek64KaLNx3TmO/UNBJhz9MxsUYvzCTTwi7361Nytko3v9BoJOGYLBYwbnseHsu3oLOYThL+KK8gNFuEMuCTIYK5wipbMbtIcCAIlnNrZTFJz0/6fbEj2A59oCeV98JWWYjmoIDqGTR5RflkuTS1LQnd/NlD+vCJdzf81hIBCbYXsy7+wc1bWj9SJuc2Lt91Qaf1DbT9Lw== backuppc@backup01
9   
10 # apt-dater ALL=NOPASSWD: /usr/bin/apt-get
11
12   $packages = [ 'git-core',
13                 'puppet',
14                 'sudo',
15                 'screen',
16                 'rsync',
17                 'vim',
18                 'lsof',
19                 'pv',
20                 'tcpdump',
21                ]
22   
23   package { $packages:
24     ensure => installed,
25   }
26   
27   # Zeitabgleich
28   package { 'chrony':
29     ensure => installed,
30   }
31   
32   service { 'chrony':
33     ensure => running,
34     enable => true,
35     hasstatus  => false,
36     hasrestart => true,
37   }
38
39   # E-Mail via Smart Host
40   package { 'nullmailer':
41     ensure => installed,
42   }
43   
44   file { '/etc/nullmailer/adminaddr':
45     ensure => present,
46     content => "infra@ccc-ffm.de\n",
47     require => Package['nullmailer'],
48     notify => Service['nullmailer'],
49   }
50
51   file { '/etc/nullmailer/defaultdomain':
52     ensure => present,
53     content => "ccc-ffm.de\n",
54     require => Package['nullmailer'],
55     notify => Service['nullmailer'],
56   }
57
58   file { '/etc/nullmailer/remotes':
59     ensure => present,
60     content => "mx01.ccc-ffm.de\n",
61     require => Package['nullmailer'],
62     notify => Service['nullmailer'],
63   }
64
65   service { 'nullmailer':
66     ensure => running,
67     enable => true,
68     hasstatus  => true,
69     hasrestart => true,
70   }
71
72   # Software Updates
73   package { 'apt-dater':
74     ensure => installed,
75   }
76   
77   file { '/etc/sudoers.d/apt-dater-host':
78     ensure => present,
79     content => "# apt-dater may run aptitude as root\napt-dater ALL=NOPASSWD: /usr/bin/apt-get\n",
80     require => [ Package['nullmailer'], Package['sudo'] ],
81   }
82   
83   user { 'apt-dater':
84     ensure => $ensure,
85     comment => $comment,
86     gid => 'nogroup',
87     membership => inclusive,
88     home => "/home/apt-dater",
89     managehome => true,
90     shell => '/bin/bash',
91     system => true,
92     require => Package['nullmailer'],
93   }
94   
95   ssh_authorized_key { 'apt-dater noc.cash-zone.de':
96     ensure => present,
97     user => 'apt-dater',
98     type => 'ssh-rsa',
99     key => 'AAAAB3NzaC1yc2EAAAABIwAAAQEAp+P0huFZ8h5GjZhtN2ZzM78pc30u2ZVrbmjLoGq9vYXBk2/jCIEWqg+L63EWg2EZcDsbxuKaf4/CYYnB213FYjhlhi8kvt/Gt3GTOxpf1/vEx+VZWpafeTDiTlKzqDHuFMHe+pEMe/OwIuK561ubttUAk6raixgkjxk0WYQX8HWLrO+jyyXstPmqs6lvQ7TYQajC8HmHb5vQWWSNWdcoeybMY+iD7H6e+4oAINs3yVMJN7Lfso7CySN1eYlFfsKExWJ59U1CrUbOgGfz5K6ommtSUqtxl+DOfmXVO40lpQ8iuTZ3YFZPuVunkw5Ce185DfZhKCSQqr+k+gKy2UFnVw==',
100   }
101   
102   ssh_authorized_key { 'backuppc systemgemisch':
103     ensure => present,
104     user => 'root',
105     type => 'ssh-rsa',
106     options => 'no-port-forwarding,no-X11-forwarding,no-agent-forwarding,from="5.231.239.2,::ffff:5.231.239.2"',
107     key => 'AAAAB3NzaC1yc2EAAAABIwAAAQEAygsqWq5lKygdAqO+GZGRB3t2P5FeQO8a3FZHKCOTpiI8CTycDZpiQnc6a/IsTHP4YvqhX9Swofu9jFDlVQXAExvuKmOlg5HZWAlCPxwMRarwN4QJvOowx+zoK0GVh3X/uNzMwKaNtk4GWek64KaLNx3TmO/UNBJhz9MxsUYvzCTTwi7361Nytko3v9BoJOGYLBYwbnseHsu3oLOYThL+KK8gNFuEMuCTIYK5wipbMbtIcCAIlnNrZTFJz0/6fbEj2A59oCeV98JWWYjmoIDqGTR5RflkuTS1LQnd/NlD+vCJdzf81hIBCbYXsy7+wc1bWj9SJuc2Lt91Qaf1DbT9Lw==',
108   }
109   
110   include common::users
111   
112 }