0d99924b3d2d92717faf2f938438ad0c4c9cbf26
[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         package { 'lightdm':
41                 ensure => absent,
42                 require => Package['lxde'],
43         }
44
45         $packages = [
46                 'iceweasel',
47                 'iceweasel-l10n-*',
48         ]
49   
50         package { $packages:
51                 ensure => installed,
52         }
53
54         file { '/etc/skel/Desktop/iceweasel.desktop':
55                 source => '/usr/share/applications/iceweasel.desktop',
56                 require => [
57                         Package['iceweasel'],
58                         File['/etc/skel/Desktop'],
59                 ],
60         }
61
62         group { 'guest':
63                 ensure => 'present'
64         }
65
66         user { 'guest':
67                 uid => 5000,
68                 home => '/run/user/5000/home',
69                 # password: guest
70                 password => '$6$pheeghohphaikuka$lJodCaTfZG4IhXw9.htxDsMDAiQrhOsXyJR.nvCdWc2EHgmstkTrpn/8LWi83e9Ac.WFDfzmQ1phpDII/npl/0',
71                 managehome => false,
72                 gid => 'guest',
73                 groups => [
74                                 'plugdev',
75                                 'cdrom',
76                                 'audio',
77                                 'video',
78                         ],
79                 shell => '/bin/bash',
80                 require => Group['guest'],
81                 ensure => 'present',
82         }
83
84         $packages_i386 = [
85                 'libc6:i386',
86                 'libqt4-dbus:i386',
87                 'libqt4-network:i386',
88                 'libqt4-xml:i386',
89                 'libqtcore4:i386',
90                 'libqtgui4:i386',
91                 'libqtwebkit4:i386',
92                 'libstdc++6:i386',
93                 'libx11-6:i386',
94                 'libxext6:i386',
95                 'libxss1:i386',
96                 'libxv1:i386',
97                 'libssl1.0.0:i386',
98                 'libpulse0:i386',
99                 'libasound2-plugins:i386',
100         ]
101
102         package { $packages_i386:
103                 ensure => installed,
104                 require => [
105                                 Exec['add-architecture-i386'],
106                                 Exec['aptget-update'],
107                         ],
108         }
109
110         exec { 'download-skype':
111                 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',
112                 creates => '/var/cache/skype-install.deb',
113         }
114
115         package { 'skype':
116                 provider => dpkg,
117                 ensure => latest,
118                 source => '/var/cache/skype-install.deb',
119                 require => [
120                         Exec['download-skype'],
121                         Package['libc6:i386'],
122                         ],      
123         }
124
125         file { '/etc/skel/Desktop/skype.desktop':
126                 source => '/usr/share/applications/skype.desktop',
127                 require => [
128                         Package['skype'],
129                         File['/etc/skel/Desktop'],
130                 ],
131         }
132
133         exec { 'enable-guestx11':
134                 command => '/bin/systemctl enable guestx11.service',
135                 refreshonly => true,
136         }
137                 
138         exec { 'start-guestx11':
139                 command => '/bin/systemctl start guestx11.service',
140                 refreshonly => true,
141         }
142
143         file { '/usr/local/sbin/x11login':
144                 source => 'puppet:///modules/desktop/usr/local/sbin/x11login',
145                 mode => 'a=rx',
146                 ensure => file,
147         }
148
149         file { '/etc/skel':
150                 source => 'puppet:///modules/desktop/etc/skel',
151                 recurse => true,
152         }
153
154         file { '/etc/systemd/system/guestx11.service':
155                 source => 'puppet:///modules/desktop/etc/systemd/system/guestx11.service',
156                 mode => 'a=rx',
157                 require => [
158                                 Package['lxde'],
159                                 File['/etc/skel/Desktop'],
160                                 File['/usr/local/sbin/x11login'],
161                                 File['/etc/skel'],
162                         ],
163                 notify => [
164                                 Exec['enable-guestx11'],
165                                 Exec['start-guestx11'],
166                         ],
167                 ensure => file,
168         }
169
170 }