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