Added more firmware packages.
[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                 'firmware-ipw2x00',
63                 'firmware-realtek',
64                 'avahi-utils',
65                 'avahi-daemon',
66                 'libnss-mdns',
67                 'cups',
68                 'hplip',
69         ]
70   
71         package { $packages:
72                 ensure => installed,
73         }
74
75         include pam
76         include pam::mkhomedir
77
78         file { '/etc/pam.d/common-session':
79                 source => 'puppet:///modules/system/etc/pam.d/common-session',
80                 require => Exec['pam_auth_update'],
81         }
82
83         exec { 'systemd-reload':
84                 command => '/bin/systemctl daemon-reload',
85                 refreshonly => true,
86         }
87
88         file { '/etc/systemd/logind.conf':
89                 source => 'puppet:///modules/system/etc/systemd/logind.conf',
90                 notify => Exec['systemd-reload'],
91         }
92
93         package { 'tzdata':
94                 ensure => installed,
95         }
96
97         file { '/etc/localtime':
98                 source => 'file:///usr/share/zoneinfo/Europe/Berlin',
99                 require => Package["tzdata"],
100         }
101
102         package { 'chrony':
103                 ensure => installed,
104                 require => File['/etc/localtime'],
105         }
106
107         service { 'chrony':
108                 ensure => running,
109                 enable => true,
110                 hasstatus  => false,
111                 hasrestart => true,
112                 require => Package['chrony'],
113         }
114
115         package { 'network-manager':
116                 ensure => installed,
117         }
118
119         package { 'network-manager-gnome':
120                 ensure => installed,
121         }
122
123         file { '/etc/network/interfaces':
124                 ensure => file,
125                 source => 'puppet:///modules/system/etc/network/interfaces',
126                 mode => 'a=r',
127                 require => Package['network-manager'],
128         }
129
130         file { '/etc/NetworkManager/dispatcher.d/99-wlan':
131                 ensure => file,
132                 source => 'puppet:///modules/system/etc/NetworkManager/dispatcher.d/99-wlan',
133                 mode => 'a=rx',
134                 require => Package['network-manager'],
135         }
136
137         file { '/etc/NetworkManager/system-connections/ffm.freifunk.net':
138                 ensure => file,
139                 source => 'puppet:///modules/system/etc/NetworkManager/system-connections/ffm.freifunk.net',
140                 mode => 'a=,u=r',
141                 require => Package['network-manager'],
142         }
143
144         file { '/etc/NetworkManager/system-connections/wired':
145                 ensure => file,
146                 source => 'puppet:///modules/system/etc/NetworkManager/system-connections/wired',
147                 mode => 'a=,u=r',
148                 require => Package['network-manager'],
149         }
150
151         package { 'wicd*':
152                 ensure => absent,
153                 require => Package['network-manager'],
154         }
155
156         include '::ntp'
157
158         printer { "mfp01":
159                 ensure       => present,
160                 uri          => 'dnssd://mfp01._ipp._tcp.local/',
161                 description  => 'mfp01',
162                 location     => 'In the same network.',
163                 require      => [ 
164                                 Package['avahi-utils'],
165                                 Package['avahi-daemon'],
166                                 Package['libnss-mdns'],
167                                 Package['cups'],
168                                 Package['hplip'],
169                         ],
170                 model        => 'drv:///hpcups.drv/hp-deskjet_990c.ppd', 
171                 shared       => false,
172                 error_policy => 'abort_job',
173                 enabled      => true,
174                 page_size    => 'A4',
175         }
176 }