Experiments part 27
[inetstation.git] / modules / desktop / manifests / init.pp
index b230b46..a240ee4 100644 (file)
@@ -1,12 +1,40 @@
 class desktop {
 
-       package { 'nodm':
+       file { '/etc/skel/Desktop':
+               ensure => directory,
+       }
+
+       package { 'xinit':
                ensure => installed,
        }
 
        package { 'lxde':
                ensure => installed,
-               require => Package['nodm'],
+               require => Package['xinit'],
+       }
+
+       file { '/etc/skel/Desktop/lxde-logout.desktop':
+               source => '/usr/share/applications/lxde-logout.desktop',
+               require => [
+                       Package['lxde'],
+                       File['/etc/skel/Desktop'],
+               ],
+       }
+
+       file { '/etc/skel/Desktop/leafpad.desktop':
+               source => '/usr/share/applications/leafpad.desktop',
+               require => [
+                       Package['lxde'],
+                       File['/etc/skel/Desktop'],
+               ],
+       }
+
+       file { '/etc/skel/Desktop/galculator.desktop':
+               source => '/usr/share/applications/galculator.desktop',
+               require => [
+                       Package['lxde'],
+                       File['/etc/skel/Desktop'],
+               ],
        }
 
        package { 'lightdm':
@@ -23,25 +51,115 @@ class desktop {
                ensure => installed,
        }
 
+       file { '/etc/skel/Desktop/iceweasel.desktop':
+               source => '/usr/share/applications/iceweasel.desktop',
+               require => [
+                       Package['iceweasel'],
+                       File['/etc/skel/Desktop'],
+               ],
+       }
+
        group { 'guest':
                ensure => 'present'
        }
 
        user { 'guest':
-               ensure => 'present',
-               home => '/home/guest',
-               managehome => true,
+               uid => 5000,
+               home => '/run/user/5000/home',
+               # password: guest
+               password => '$6$pheeghohphaikuka$lJodCaTfZG4IhXw9.htxDsMDAiQrhOsXyJR.nvCdWc2EHgmstkTrpn/8LWi83e9Ac.WFDfzmQ1phpDII/npl/0',
+               managehome => false,
                gid => 'guest',
+               groups => [ 'plugdev' ],
+               shell => '/bin/bash',
                require => Group['guest'],
+               ensure => 'present',
+       }
+
+       $packages_i386 = [
+               'libc6:i386',
+               'libqt4-dbus:i386',
+               'libqt4-network:i386',
+               'libqt4-xml:i386',
+               'libqtcore4:i386',
+               'libqtgui4:i386',
+               'libqtwebkit4:i386',
+               'libstdc++6:i386',
+               'libx11-6:i386',
+               'libxext6:i386',
+               'libxss1:i386',
+               'libxv1:i386',
+               'libssl1.0.0:i386',
+               'libpulse0:i386',
+               'libasound2-plugins:i386',
+       ]
+
+       package { $packages_i386:
+               ensure => installed,
+               require => [
+                               Exec['add-architecture-i386'],
+                               Exec['aptget-update'],
+                       ],
+       }
+
+       exec { 'download-skype':
+               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',
+               creates => '/var/cache/skype-install.deb',
+       }
+
+       package { 'skype':
+               provider => dpkg,
+               ensure => latest,
+               source => '/var/cache/skype-install.deb',
+               require => [
+                       Exec['download-skype'],
+                       Package['libc6:i386'],
+                       ],      
        }
 
-       file { '/etc/default/nodm':
-               source => 'puppet:///modules/desktop/etc/default/nodm',
+       file { '/etc/skel/Desktop/skype.desktop':
+               source => '/usr/share/applications/skype.desktop',
                require => [
-                               Package['nodm'],
-                               User['guest'],
-                               ],
+                       Package['skype'],
+                       File['/etc/skel/Desktop'],
+               ],
        }
 
+       exec { 'enable-guestx11':
+               command => '/bin/systemctl enable guestx11.service',
+               refreshonly => true,
+       }
+               
+       exec { 'start-guestx11':
+               command => '/bin/systemctl start guestx11.service',
+               refreshonly => true,
+       }
+
+       file { '/usr/local/sbin/x11login':
+               source => 'puppet:///modules/desktop/usr/local/sbin/x11login',
+               mode => 'a=rx',
+               ensure => file,
+       }
+
+       file { '/etc/skel':
+               source => 'puppet:///modules/desktop/etc/skel',
+               recurse => true,
+       }
+
+       file { '/etc/systemd/system/guestx11.service':
+               source => 'puppet:///modules/desktop/etc/systemd/system/guestx11.service',
+               mode => 'a=rx',
+               require => [
+                               Package['lxde'],
+                               File['/etc/skel/Desktop'],
+                               File['/usr/local/sbin/x11login'],
+                               File['/etc/skel'],
+                       ],
+               notify => [
+                               Exec['enable-guestx11'],
+                               Exec['start-guestx11'],
+                       ],
+               ensure => file,
+       }
 
 }