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