added florence package sagain
[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         ]
96   
97         package { $packages:
98                 ensure => installed,
99         }
100
101         file { '/etc/skel/Desktop/iceweasel.desktop':
102                 source => '/usr/share/applications/iceweasel.desktop',
103                 require => [
104                         Package['iceweasel'],
105                         File['/etc/skel/Desktop'],
106                 ],
107         }
108
109         file { '/etc/iceweasel/profile/prefs.js':
110                 source => 'puppet:///modules/desktop/etc/iceweasel/profile/prefs.js',
111                 require => [
112                         Package['iceweasel'],
113                 ],
114         }
115
116         group { 'guest':
117                 ensure => 'present'
118         }
119
120         user { 'guest':
121                 uid => 5000,
122                 home => '/run/user/5000/home',
123                 # password: guest
124                 password => '$6$pheeghohphaikuka$lJodCaTfZG4IhXw9.htxDsMDAiQrhOsXyJR.nvCdWc2EHgmstkTrpn/8LWi83e9Ac.WFDfzmQ1phpDII/npl/0',
125                 managehome => false,
126                 gid => 'guest',
127                 groups => [
128                                 'plugdev',
129                                 'cdrom',
130                                 'audio',
131                                 'video',
132                         ],
133                 shell => '/bin/bash',
134                 require => Group['guest'],
135                 ensure => 'present',
136         }
137
138         $packages_i386 = [
139                 'libc6:i386',
140                 'libqt4-dbus:i386',
141                 'libqt4-network:i386',
142                 'libqt4-xml:i386',
143                 'libqtcore4:i386',
144                 'libqtgui4:i386',
145                 'libqtwebkit4:i386',
146                 'libstdc++6:i386',
147                 'libx11-6:i386',
148                 'libxext6:i386',
149                 'libxss1:i386',
150                 'libxv1:i386',
151                 'libssl1.0.0:i386',
152                 'libpulse0:i386',
153                 'libasound2-plugins:i386',
154         ]
155
156         package { $packages_i386:
157                 ensure => installed,
158                 require => [
159                                 Exec['add-architecture-i386'],
160                                 Exec['apt_update'],
161                         ],
162         }
163
164         exec { 'download-skype':
165                 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',
166                 creates => '/var/cache/skype-install.deb',
167         }
168
169         package { 'skype':
170                 provider => dpkg,
171                 ensure => latest,
172                 source => '/var/cache/skype-install.deb',
173                 require => [
174                         Exec['download-skype'],
175                         Package['libc6:i386'],
176                         ],      
177         }
178
179         file { '/etc/skel/Desktop/skype.desktop':
180                 source => '/usr/share/applications/skype.desktop',
181                 require => [
182                         Package['skype'],
183                         File['/etc/skel/Desktop'],
184                 ],
185         }
186
187         exec { 'enable-guestx11':
188                 command => '/bin/systemctl enable guestx11.service',
189                 refreshonly => true,
190         }
191                 
192         exec { 'start-guestx11':
193                 command => '/bin/systemctl start guestx11.service',
194                 refreshonly => true,
195         }
196
197         file { '/usr/local/sbin/x11login':
198                 source => 'puppet:///modules/desktop/usr/local/sbin/x11login',
199                 mode => 'a=rx',
200                 ensure => file,
201         }
202
203         file { '/etc/skel':
204                 source => 'puppet:///modules/desktop/etc/skel',
205                 recurse => true,
206         }
207
208         file { '/etc/systemd/system/guestx11.service':
209                 source => 'puppet:///modules/desktop/etc/systemd/system/guestx11.service',
210                 mode => 'a=rx',
211                 require => [
212                                 Package['lxde'],
213                                 File['/etc/skel/Desktop'],
214                                 File['/usr/local/sbin/x11login'],
215                                 File['/etc/skel'],
216                         ],
217                 notify => [
218                                 Exec['enable-guestx11'],
219                                 Exec['start-guestx11'],
220                         ],
221                 ensure => file,
222         }
223
224 }