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