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