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