Fixed libreoffice link.
[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         $dms = [
57                 'lightdm*',
58                 'kdm',
59                 'gdm3',
60                 'nodm',
61                 'wdm',
62                 'xdm',
63                 'slim',
64         ]
65
66         package { $dms:
67                 ensure => absent,
68                 require => Package['lxde'],
69         }
70
71         $packages = [
72                 'iceweasel',
73                 'iceweasel-l10n-*',
74                 'gstreamer1.0-libav',
75                 'gstreamer1.0-plugins-good',
76                 'flashplugin-nonfree',
77                 'chromium',
78                 'chromium-l10n',
79                 'libreoffice',
80                 'libreoffice-help-*',
81                 'libreoffice-l10n-*',
82                 'ttf-mscorefonts-installer',
83                 'ttf-liberation',
84                 'fonts-crosextra-carlito',
85                 'fonts-crosextra-caladea',
86         ]
87   
88         package { $packages:
89                 ensure => installed,
90         }
91
92         file { '/etc/skel/Desktop/iceweasel.desktop':
93                 source => '/usr/share/applications/iceweasel.desktop',
94                 require => [
95                         Package['iceweasel'],
96                         File['/etc/skel/Desktop'],
97                 ],
98         }
99
100         file { '/etc/iceweasel/profile/prefs.js':
101                 source => 'puppet:///modules/desktop/etc/iceweasel/profile/prefs.js',
102                 require => [
103                         Package['iceweasel'],
104                 ],
105         }
106
107         group { 'guest':
108                 ensure => 'present'
109         }
110
111         user { 'guest':
112                 uid => 5000,
113                 home => '/run/user/5000/home',
114                 # password: guest
115                 password => '$6$pheeghohphaikuka$lJodCaTfZG4IhXw9.htxDsMDAiQrhOsXyJR.nvCdWc2EHgmstkTrpn/8LWi83e9Ac.WFDfzmQ1phpDII/npl/0',
116                 managehome => false,
117                 gid => 'guest',
118                 groups => [
119                                 'plugdev',
120                                 'cdrom',
121                                 'audio',
122                                 'video',
123                         ],
124                 shell => '/bin/bash',
125                 require => Group['guest'],
126                 ensure => 'present',
127         }
128
129         $packages_i386 = [
130                 'libc6:i386',
131                 'libqt4-dbus:i386',
132                 'libqt4-network:i386',
133                 'libqt4-xml:i386',
134                 'libqtcore4:i386',
135                 'libqtgui4:i386',
136                 'libqtwebkit4:i386',
137                 'libstdc++6:i386',
138                 'libx11-6:i386',
139                 'libxext6:i386',
140                 'libxss1:i386',
141                 'libxv1:i386',
142                 'libssl1.0.0:i386',
143                 'libpulse0:i386',
144                 'libasound2-plugins:i386',
145         ]
146
147         package { $packages_i386:
148                 ensure => installed,
149                 require => [
150                                 Exec['add-architecture-i386'],
151                                 Exec['apt_update'],
152                         ],
153         }
154
155         exec { 'download-skype':
156                 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',
157                 creates => '/var/cache/skype-install.deb',
158         }
159
160         package { 'skype':
161                 provider => dpkg,
162                 ensure => latest,
163                 source => '/var/cache/skype-install.deb',
164                 require => [
165                         Exec['download-skype'],
166                         Package['libc6:i386'],
167                         ],      
168         }
169
170         file { '/etc/skel/Desktop/skype.desktop':
171                 source => '/usr/share/applications/skype.desktop',
172                 require => [
173                         Package['skype'],
174                         File['/etc/skel/Desktop'],
175                 ],
176         }
177
178         exec { 'enable-guestx11':
179                 command => '/bin/systemctl enable guestx11.service',
180                 refreshonly => true,
181         }
182                 
183         exec { 'start-guestx11':
184                 command => '/bin/systemctl start guestx11.service',
185                 refreshonly => true,
186         }
187
188         file { '/usr/local/sbin/x11login':
189                 source => 'puppet:///modules/desktop/usr/local/sbin/x11login',
190                 mode => 'a=rx',
191                 ensure => file,
192         }
193
194         file { '/etc/skel':
195                 source => 'puppet:///modules/desktop/etc/skel',
196                 recurse => true,
197         }
198
199         file { '/etc/systemd/system/guestx11.service':
200                 source => 'puppet:///modules/desktop/etc/systemd/system/guestx11.service',
201                 mode => 'a=rx',
202                 require => [
203                                 Package['lxde'],
204                                 File['/etc/skel/Desktop'],
205                                 File['/usr/local/sbin/x11login'],
206                                 File['/etc/skel'],
207                         ],
208                 notify => [
209                                 Exec['enable-guestx11'],
210                                 Exec['start-guestx11'],
211                         ],
212                 ensure => file,
213         }
214
215 }