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