Added Debian proposed updates.
[inetstation.git] / modules / system / manifests / init.pp
1 class system {
2
3         class { 'apt':
4                 purge => {
5                         'sources.list' => true,
6                         'sources.list.d' => true,
7                         'preferences' => true,
8                         'preferences.d' => true,
9                 },
10                 sources => {
11                         'debian' => {
12                                 location => 'http://ftp.de.debian.org/debian/',
13                                 release => "${lsbdistcodename}",
14                                 repos => 'main non-free contrib',
15                         },
16                         'debian-security' => {
17                                 location => 'http://security.debian.org/',
18                                 release => "${lsbdistcodename}/updates",
19                                 repos => 'main non-free contrib',
20                         },
21                         'debian-updates' => {
22                                 location => 'http://ftp.de.debian.org/debian/',
23                                 release => "${lsbdistcodename}-updates",
24                                 repos => 'main non-free contrib',
25                         },
26                         'debian-proposed-updates' => {
27                                 location => 'http://ftp.de.debian.org/debian/',
28                                 release => "${lsbdistcodename}-proposed-updates",
29                                 repos => 'main non-free contrib',
30                         },
31                 },
32                 update => {
33                         frequency => 'always',
34                 },
35         }
36         
37
38         exec { 'add-architecture-i386':
39                 command => '/usr/bin/dpkg --add-architecture i386',
40                 unless => '/bin/fgrep -q i386 /var/lib/dpkg/arch',
41                 notify => Exec['apt_update'],
42         }
43
44         exec { 'aptget-update':
45                 command => '/usr/bin/apt-get update',
46                 refreshonly => true,
47         }
48
49         $packages = [
50                 'sudo',
51                 'lsof',
52                 'vim',
53                 'screen',
54                 'rsync',
55                 'tcpdump',
56                 'pv',
57                 'openssh-server',
58                 'locales-all',
59                 'libpam-tmpdir',
60                 'broadcom-sta-dkms',
61                 'firmware-iwlwifi',
62         ]
63   
64         package { $packages:
65                 ensure => installed,
66         }
67
68         include pam
69         include pam::mkhomedir
70
71         file { '/etc/pam.d/common-session':
72                 source => 'puppet:///modules/system/etc/pam.d/common-session',
73                 require => Exec['pam_auth_update'],
74         }
75
76         exec { 'systemd-reload':
77                 command => '/bin/systemctl daemon-reload',
78                 refreshonly => true,
79         }
80
81         file { '/etc/systemd/logind.conf':
82                 source => 'puppet:///modules/system/etc/systemd/logind.conf',
83                 notify => Exec['systemd-reload'],
84         }
85
86         package { 'chrony':
87                 ensure => installed,
88         }
89
90         service { 'chrony':
91                 ensure => running,
92                 enable => true,
93                 hasstatus  => false,
94                 hasrestart => true,
95                 require => Package['chrony'],
96         }
97
98         package { 'network-manager':
99                 ensure => installed,
100         }
101
102         package { 'network-manager-gnome':
103                 ensure => installed,
104         }
105
106         file { '/etc/network/interfaces':
107                 ensure => file,
108                 source => 'puppet:///modules/system/etc/network/interfaces',
109                 mode => 'a=r',
110                 require => Package['network-manager'],
111         }
112
113         file { '/etc/NetworkManager/dispatcher.d/99-wlan':
114                 ensure => file,
115                 source => 'puppet:///modules/system/etc/NetworkManager/dispatcher.d/99-wlan',
116                 mode => 'a=rx',
117                 require => Package['network-manager'],
118         }
119
120         file { '/etc/NetworkManager/system-connections/ffm.freifunk.net':
121                 ensure => file,
122                 source => 'puppet:///modules/system/etc/NetworkManager/system-connections/ffm.freifunk.net',
123                 mode => 'a=,u=r',
124                 require => Package['network-manager'],
125         }
126
127         file { '/etc/NetworkManager/system-connections/wired':
128                 ensure => file,
129                 source => 'puppet:///modules/system/etc/NetworkManager/system-connections/wired',
130                 mode => 'a=,u=r',
131                 require => Package['network-manager'],
132         }
133
134         package { 'wicd*':
135                 ensure => absent,
136                 require => Package['network-manager'],
137         }
138
139         printer { "mfp01":
140                 ensure       => present,
141                 uri          => 'dnssd://mfp01._ipp._tcp.local/',
142                 description  => 'mfp01',
143                 location     => 'In the same network.',
144                 require      => [ 
145                                 Package['avahi-utils'],
146                                 Package['avahi-daemon'],
147                                 Package['libnss-mdns'],
148                                 Package['cups'],
149                                 Package['hplip'],
150                         ],
151                 model        => 'drv:///hpcups.drv/hp-deskjet_990c.ppd', 
152                 shared       => false,
153                 error_policy => 'abort_job',
154                 enabled      => true,
155                 page_size    => 'A4',
156         }
157 }