Removed unwanted notifies.
[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         $dms = [
17                 'lightdm*',
18                 'kdm',
19                 'gdm3',
20                 'nodm',
21                 'wdm',
22                 'xdm',
23                 'slim',
24         ]
25
26         package { $dms:
27                 ensure => absent,
28                 require => Package['lxde'],
29         }
30
31         package { 'xscreensaver':
32                 ensure => absent,
33         }
34
35         $packages = [
36                 'pcmanfm',
37                 'iceweasel',
38                 'iceweasel-l10n-*',
39                 'gstreamer1.0-libav',
40                 'gstreamer1.0-plugins-good',
41                 'flashplugin-nonfree',
42                 'chromium',
43                 'chromium-l10n',
44                 'libreoffice',
45 #               'libreoffice-help-*',
46 #               'libreoffice-l10n-*',
47                 'ttf-mscorefonts-installer',
48                 'ttf-liberation',
49                 'fonts-crosextra-carlito',
50                 'fonts-crosextra-caladea',
51                 'florence',
52
53         ]
54   
55         package { $packages:
56                 ensure => installed,
57         }
58
59         file { '/etc/skel/Desktop/libreoffice-startcenter.desktop':
60                 source => '/usr/share/applications/libreoffice-startcenter.desktop',
61                 require => [
62                         Package['libreoffice'],
63                         File['/etc/skel/Desktop'],
64                 ],
65         }
66
67         file { '/etc/skel/Desktop/lxde-logout.desktop':
68                 source => '/usr/share/applications/lxde-logout.desktop',
69                 require => [
70                         Package['lxde'],
71                         File['/etc/skel/Desktop'],
72                 ],
73         }
74
75         file { '/etc/skel/Desktop/leafpad.desktop':
76                 source => '/usr/share/applications/leafpad.desktop',
77                 replace => false,
78                 require => [
79                         Package['lxde'],
80                         File['/etc/skel/Desktop'],
81                 ],
82         }
83
84         exec { 'fix-desktop-leafpad':
85                 command => '/bin/sed -i "/^Name/ s/=.*/=Notes/;" /etc/skel/Desktop/leafpad.desktop',
86                 unless => '/bin/grep -q "^Name=Notes" /etc/skel/Desktop/leafpad.desktop',
87         }
88
89         file { '/etc/skel/Desktop/galculator.desktop':
90                 source => '/usr/share/applications/galculator.desktop',
91                 replace => false,
92                 require => [
93                         Package['lxde'],
94                         File['/etc/skel/Desktop'],
95                 ],
96         }
97
98         exec { 'fix-desktop-galculator':
99                 command => '/bin/sed -i "/^Name/ s/=.*/=Calculator/;" /etc/skel/Desktop/galculator.desktop',
100                 unless => '/bin/grep -q "^Name.*=Calculator" /etc/skel/Desktop/galculator.desktop',
101         }
102
103         file { '/etc/skel/Desktop/chromium-l10n.desktop':
104                 source => '/usr/share/applications/chromium.desktop',
105                 require => [
106                         Package['chromium'],
107                         File['/etc/skel/Desktop'],
108                 ],
109         }
110         
111         file { '/etc/skel/Desktop/florence.desktop':
112                 source => '/usr/share/applications/florence.desktop',
113                 replace => false,
114                 require => [
115                         Package['florence'],
116                         File['/etc/skel/Desktop'],
117                 ],
118         }
119
120         exec { 'fix-desktop-florence':
121                 command => '/bin/sed -i "/^Name/ s/=.*/=Keyboard/;" /etc/skel/Desktop/florence.desktop',
122                 unless => '/bin/grep -q "^Name.*=Keyboard" /etc/skel/Desktop/florence.desktop',
123         }
124
125         file { '/etc/skel/Desktop/pcmanfm.desktop':
126                 source => '/usr/share/applications/pcmanfm.desktop',
127                 replace => false,
128                 require => [
129                         Package['pcmanfm'],
130                         File['/etc/skel/Desktop'],
131                 ],
132         }
133
134         exec { 'fix-desktop-pcmanfm':
135                 command => '/bin/sed -i "/^Name/ s/=.*/=Filemanager/;" /etc/skel/Desktop/pcmanfm.desktop',
136                 unless => '/bin/grep -q "^Name.*=Filemanager" /etc/skel/Desktop/pcmanfm.desktop',
137         }
138
139         file { '/etc/skel/Desktop/iceweasel.desktop':
140                 source => '/usr/share/applications/iceweasel.desktop',
141                 replace => false,
142                 require => [
143                         Package['iceweasel'],
144                         File['/etc/skel/Desktop'],
145                 ],
146         }
147
148         exec { 'fix-desktop-iceweasel':
149                 command => '/bin/sed -i "/^Name/ s/=.*/=Webbrowser/;" /etc/skel/Desktop/iceweasel.desktop',
150                 unless => '/bin/grep -q "^Name.*=Webbrowser" /etc/skel/Desktop/iceweasel.desktop',
151         }
152
153
154         file { '/etc/iceweasel/profile/prefs.js':
155                 source => 'puppet:///modules/desktop/etc/iceweasel/profile/prefs.js',
156                 require => [
157                         Package['iceweasel'],
158                 ],
159         }
160
161         group { 'guest':
162                 ensure => 'present'
163         }
164
165         user { 'guest':
166                 uid => 5000,
167                 home => '/run/user/5000/home',
168                 # password: guest
169                 password => '$6$pheeghohphaikuka$lJodCaTfZG4IhXw9.htxDsMDAiQrhOsXyJR.nvCdWc2EHgmstkTrpn/8LWi83e9Ac.WFDfzmQ1phpDII/npl/0',
170                 managehome => false,
171                 gid => 'guest',
172                 groups => [
173                                 'plugdev',
174                                 'cdrom',
175                                 'audio',
176                                 'video',
177                         ],
178                 shell => '/bin/bash',
179                 require => Group['guest'],
180                 ensure => 'present',
181         }
182
183         $packages_i386 = [
184                 'libc6:i386',
185                 'libqt4-dbus:i386',
186                 'libqt4-network:i386',
187                 'libqt4-xml:i386',
188                 'libqtcore4:i386',
189                 'libqtgui4:i386',
190                 'libqtwebkit4:i386',
191                 'libstdc++6:i386',
192                 'libx11-6:i386',
193                 'libxext6:i386',
194                 'libxss1:i386',
195                 'libxv1:i386',
196                 'libssl1.0.0:i386',
197                 'libpulse0:i386',
198                 'libasound2-plugins:i386',
199         ]
200
201         package { $packages_i386:
202                 ensure => installed,
203                 require => [
204                                 Exec['add-architecture-i386'],
205                                 Exec['apt_update'],
206                         ],
207         }
208
209         exec { 'download-skype':
210                 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',
211                 creates => '/var/cache/skype-install.deb',
212         }
213
214         package { 'skype':
215                 provider => dpkg,
216                 ensure => latest,
217                 source => '/var/cache/skype-install.deb',
218                 require => [
219                         Exec['download-skype'],
220                         Package['libc6:i386'],
221                         ],      
222         }
223
224         file { '/etc/skel/Desktop/skype.desktop':
225                 source => '/usr/share/applications/skype.desktop',
226                 require => [
227                         Package['skype'],
228                         File['/etc/skel/Desktop'],
229                 ],
230         }
231
232         exec { 'enable-guestx11':
233                 command => '/bin/systemctl enable guestx11.service',
234                 refreshonly => true,
235         }
236                 
237         exec { 'start-guestx11':
238                 command => '/bin/systemctl start guestx11.service',
239                 refreshonly => true,
240         }
241
242         file { '/usr/local/sbin/x11login':
243                 source => 'puppet:///modules/desktop/usr/local/sbin/x11login',
244                 mode => 'a=rx',
245                 ensure => file,
246         }
247
248         file { '/etc/skel':
249                 source => 'puppet:///modules/desktop/etc/skel',
250                 recurse => true,
251         }
252
253         file { '/etc/systemd/system/guestx11.service':
254                 source => 'puppet:///modules/desktop/etc/systemd/system/guestx11.service',
255                 mode => 'a=rx',
256                 require => [
257                                 Package['lxde'],
258                                 File['/etc/skel/Desktop'],
259                                 File['/usr/local/sbin/x11login'],
260                                 File['/etc/skel'],
261                         ],
262                 notify => [
263                                 Exec['enable-guestx11'],
264                                 Exec['start-guestx11'],
265                         ],
266                 ensure => file,
267         }
268         
269 }