trottelbehebung
[inetstation.git] / modules / desktop / manifests / init.pp
1 class desktop {
2
3         file { '/etc/skel/Desktop':
4                 ensure => directory,
5         }
6
7         package { 'xinit':
8                 ensure => installed,
9         }
10
11         package { 'lxde':
12                 ensure => installed,
13                 require => Package['xinit'],
14         }
15
16         file { '/etc/skel/Desktop/libreoffice-startcenter.desktop':
17                 source => '/usr/share/applications/libreoffice-startcenter.desktop',
18                 require => [
19                         Package['libreoffice'],
20                         File['/etc/skel/Desktop'],
21                 ],
22         }
23
24         file { '/etc/skel/Desktop/lxde-logout.desktop':
25                 source => '/usr/share/applications/lxde-logout.desktop',
26                 require => [
27                         Package['lxde'],
28                         File['/etc/skel/Desktop'],
29                 ],
30         }
31
32         file { '/etc/skel/Desktop/leafpad.desktop':
33                 source => '/usr/share/applications/leafpad.desktop',
34                 require => [
35                         Package['lxde'],
36                         File['/etc/skel/Desktop'],
37                 ],
38         }
39
40         file { '/etc/skel/Desktop/galculator.desktop':
41                 source => '/usr/share/applications/galculator.desktop',
42                 require => [
43                         Package['lxde'],
44                         File['/etc/skel/Desktop'],
45                 ],
46         }
47
48         file { '/etc/skel/Desktop/chromium-l10n.desktop':
49                 source => '/usr/share/applications/chromium.desktop',
50                 require => [
51                         Package['chromium'],
52                         File['/etc/skel/Desktop'],
53                 ],
54         }
55         
56         file { '/etc/skel/Desktop/florence.desktop':
57                 source => '/usr/share/applications/florence.desktop',
58                 require => [
59                         Package['florence'],
60                         File['/etc/skel/Desktop'],
61                 ],
62         }
63
64         $dms = [
65                 'lightdm*',
66                 'kdm',
67                 'gdm3',
68                 'nodm',
69                 'wdm',
70                 'xdm',
71                 'slim',
72         ]
73
74         package { $dms:
75                 ensure => absent,
76                 require => Package['lxde'],
77         }
78
79         $packages = [
80                 'iceweasel',
81                 'iceweasel-l10n-*',
82                 'gstreamer1.0-libav',
83                 'gstreamer1.0-plugins-good',
84                 'flashplugin-nonfree',
85                 'chromium',
86                 'chromium-l10n',
87                 'libreoffice',
88                 'libreoffice-help-*',
89                 'libreoffice-l10n-*',
90                 'ttf-mscorefonts-installer',
91                 'ttf-liberation',
92                 'fonts-crosextra-carlito',
93                 'fonts-crosextra-caladea',
94                 'florence',
95                 'avahi-utils',
96                 'avahi-daemon',
97                 'libnss-mdns',
98                 'cups',
99                 'hplip',
100
101         ]
102   
103         package { $packages:
104                 ensure => installed,
105         }
106
107         file { '/etc/skel/Desktop/iceweasel.desktop':
108                 source => '/usr/share/applications/iceweasel.desktop',
109                 require => [
110                         Package['iceweasel'],
111                         File['/etc/skel/Desktop'],
112                 ],
113         }
114
115         file { '/etc/iceweasel/profile/prefs.js':
116                 source => 'puppet:///modules/desktop/etc/iceweasel/profile/prefs.js',
117                 require => [
118                         Package['iceweasel'],
119                 ],
120         }
121
122         group { 'guest':
123                 ensure => 'present'
124         }
125
126         user { 'guest':
127                 uid => 5000,
128                 home => '/run/user/5000/home',
129                 # password: guest
130                 password => '$6$pheeghohphaikuka$lJodCaTfZG4IhXw9.htxDsMDAiQrhOsXyJR.nvCdWc2EHgmstkTrpn/8LWi83e9Ac.WFDfzmQ1phpDII/npl/0',
131                 managehome => false,
132                 gid => 'guest',
133                 groups => [
134                                 'plugdev',
135                                 'cdrom',
136                                 'audio',
137                                 'video',
138                         ],
139                 shell => '/bin/bash',
140                 require => Group['guest'],
141                 ensure => 'present',
142         }
143
144         $packages_i386 = [
145                 'libc6:i386',
146                 'libqt4-dbus:i386',
147                 'libqt4-network:i386',
148                 'libqt4-xml:i386',
149                 'libqtcore4:i386',
150                 'libqtgui4:i386',
151                 'libqtwebkit4:i386',
152                 'libstdc++6:i386',
153                 'libx11-6:i386',
154                 'libxext6:i386',
155                 'libxss1:i386',
156                 'libxv1:i386',
157                 'libssl1.0.0:i386',
158                 'libpulse0:i386',
159                 'libasound2-plugins:i386',
160         ]
161
162         package { $packages_i386:
163                 ensure => installed,
164                 require => [
165                                 Exec['add-architecture-i386'],
166                                 Exec['apt_update'],
167                         ],
168         }
169
170         exec { 'download-skype':
171                 command => '/usr/bin/wget -qO/var/cache/.skype-install.deb.part http://www.skype.com/go/getskype-linux-deb && /bin/mv /var/cache/.skype-install.deb.part /var/cache/skype-install.deb',
172                 creates => '/var/cache/skype-install.deb',
173         }
174
175         package { 'skype':
176                 provider => dpkg,
177                 ensure => latest,
178                 source => '/var/cache/skype-install.deb',
179                 require => [
180                         Exec['download-skype'],
181                         Package['libc6:i386'],
182                         ],      
183         }
184
185         file { '/etc/skel/Desktop/skype.desktop':
186                 source => '/usr/share/applications/skype.desktop',
187                 require => [
188                         Package['skype'],
189                         File['/etc/skel/Desktop'],
190                 ],
191         }
192
193         exec { 'enable-guestx11':
194                 command => '/bin/systemctl enable guestx11.service',
195                 refreshonly => true,
196         }
197                 
198         exec { 'start-guestx11':
199                 command => '/bin/systemctl start guestx11.service',
200                 refreshonly => true,
201         }
202
203         file { '/usr/local/sbin/x11login':
204                 source => 'puppet:///modules/desktop/usr/local/sbin/x11login',
205                 mode => 'a=rx',
206                 ensure => file,
207         }
208
209         file { '/etc/skel':
210                 source => 'puppet:///modules/desktop/etc/skel',
211                 recurse => true,
212         }
213
214         file { '/etc/systemd/system/guestx11.service':
215                 source => 'puppet:///modules/desktop/etc/systemd/system/guestx11.service',
216                 mode => 'a=rx',
217                 require => [
218                                 Package['lxde'],
219                                 File['/etc/skel/Desktop'],
220                                 File['/usr/local/sbin/x11login'],
221                                 File['/etc/skel'],
222                         ],
223                 notify => [
224                                 Exec['enable-guestx11'],
225                                 Exec['start-guestx11'],
226                         ],
227                 ensure => file,
228         }
229         
230         printer { "mfp01":
231                 ensure       => present,
232                 uri          => "dnssd://mfp01._ipp_tcp.local/",
233                 description  => "mfp01",
234                 location     => "here",
235                 require      => [ 
236                         Package['avahi-utils'],
237                         Package['avahi-daemon'],
238                         Package['libnss-mdns'],
239                         Package['cups'],
240                         Package['hplip'],
241                         ],
242                 model        => "drv://hpcups.drv/hp-deskjet_990c.ppd", 
243                 shared       => false, # Printer will be shared and published by CUPS
244                 error_policy => abort_job, # underscored version of error policy
245                 enabled      => true, # Enabled by default
246                 page_size    => 'A4',
247
248         }
249 }