Experiments part 20
[inetstation.git] / modules / desktop / manifests / init.pp
1 class desktop {
2
3         file { '/etc/skel/Desktop':
4                 ensure => directory,
5         }
6
7         package { 'lxde':
8                 ensure => installed,
9         }
10
11         file { '/etc/skel/Desktop/lxde-logout.desktop':
12                 source => '/usr/share/applications/lxde-logout.desktop',
13                 require => [
14                         Package['lxde'],
15                         File['/etc/skel/Desktop'],
16                 ],
17         }
18
19         file { '/etc/skel/Desktop/leafpad.desktop':
20                 source => '/usr/share/applications/leafpad.desktop',
21                 require => [
22                         Package['lxde'],
23                         File['/etc/skel/Desktop'],
24                 ],
25         }
26
27         file { '/etc/skel/Desktop/galculator.desktop':
28                 source => '/usr/share/applications/galculator.desktop',
29                 require => [
30                         Package['lxde'],
31                         File['/etc/skel/Desktop'],
32                 ],
33         }
34
35         package { 'lightdm':
36                 ensure => absent,
37                 require => Package['lxde'],
38         }
39
40         $packages = [
41                 'iceweasel',
42                 'iceweasel-l10n-*',
43         ]
44   
45         package { $packages:
46                 ensure => installed,
47         }
48
49         file { '/etc/skel/Desktop/iceweasel.desktop':
50                 source => '/usr/share/applications/iceweasel.desktop',
51                 require => [
52                         Package['iceweasel'],
53                         File['/etc/skel/Desktop'],
54                 ],
55         }
56
57         group { 'guest':
58                 ensure => 'present'
59         }
60
61         user { 'guest':
62                 uid => 5000,
63                 home => '/run/user/5000',
64                 # password: guest
65                 password => '$6$pheeghohphaikuka$lJodCaTfZG4IhXw9.htxDsMDAiQrhOsXyJR.nvCdWc2EHgmstkTrpn/8LWi83e9Ac.WFDfzmQ1phpDII/npl/0',
66                 managehome => false,
67                 gid => 'guest',
68                 groups => [ 'plugdev' ],
69                 shell => '/bin/bash',
70                 require => Group['guest'],
71                 ensure => 'present',
72         }
73
74         $packages_i386 = [
75                 'libc6:i386',
76                 'libqt4-dbus:i386',
77                 'libqt4-network:i386',
78                 'libqt4-xml:i386',
79                 'libqtcore4:i386',
80                 'libqtgui4:i386',
81                 'libqtwebkit4:i386',
82                 'libstdc++6:i386',
83                 'libx11-6:i386',
84                 'libxext6:i386',
85                 'libxss1:i386',
86                 'libxv1:i386',
87                 'libssl1.0.0:i386',
88                 'libpulse0:i386',
89                 'libasound2-plugins:i386',
90         ]
91
92         package { $packages_i386:
93                 ensure => installed,
94                 require => Exec['add-architecture-i386'],
95         }
96
97         exec { 'download-skype':
98                 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',
99                 creates => '/var/cache/skype-install.deb',
100         }
101
102         package { 'skype':
103                 provider => dpkg,
104                 ensure => latest,
105                 source => '/var/cache/skype-install.deb',
106                 require => [
107                         Exec['download-skype'],
108                         Package['libc6:i386'],
109                         ],      
110         }
111
112         file { '/etc/skel/Desktop/skype.desktop':
113                 source => '/usr/share/applications/skype.desktop',
114                 require => [
115                         Package['skype'],
116                         File['/etc/skel/Desktop'],
117                 ],
118         }
119
120         exec { 'enable-guestx11':
121                 command => '/bin/systemctl enable guestx11.service',
122                 refreshonly => true,
123         }
124                 
125         exec { 'start-guestx11':
126                 command => '/bin/systemctl start guestx11.service',
127                 refreshonly => true,
128         }
129
130         file { '/usr/local/sbin/x11login':
131                 source => 'puppet:///modules/desktop/usr/local/sbin/x11login',
132                 mode => 'a=rx',
133                 ensure => file,
134         }
135
136         file { '/etc/skel/.bashrc':
137                 source => 'puppet:///modules/desktop/etc/skel/.bashrc',
138                 mode => 'a=r',
139                 ensure => file,
140         }
141
142         file { '/etc/systemd/system/guestx11.service':
143                 source => 'puppet:///modules/desktop/etc/systemd/system/guestx11.service',
144                 mode => 'a=rx',
145                 require => [
146                                 Package['lxde'],
147                                 File['/etc/skel/Desktop'],
148                                 File['/usr/local/sbin/x11login'],
149                                 File['/etc/skel/.bashrc'],
150                         ],
151                 notify => [
152                                 Exec['enable-guestx11'],
153                                 Exec['start-guestx11'],
154                         ],
155                 ensure => file,
156         }
157
158 }