Experiments part 19
[inetstation.git] / modules / desktop / manifests / init.pp
index 841d764..d5f98d0 100644 (file)
@@ -1,12 +1,35 @@
 class desktop {
 
-       package { 'nodm':
-               ensure => installed,
+       file { '/etc/skel/Desktop':
+               ensure => directory,
        }
 
        package { 'lxde':
                ensure => installed,
-               require => Package['nodm'],
+       }
+
+       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,27 +46,29 @@ 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 => '/run/user/1001',
+               uid => 5000,
+               home => '/run/user/5000',
                # password: guest
                password => '$6$pheeghohphaikuka$lJodCaTfZG4IhXw9.htxDsMDAiQrhOsXyJR.nvCdWc2EHgmstkTrpn/8LWi83e9Ac.WFDfzmQ1phpDII/npl/0',
-               managehome => true,
+               managehome => false,
                gid => 'guest',
+               groups => [ 'plugdev' ],
                shell => '/bin/bash',
                require => Group['guest'],
-       }
-
-       file { '/etc/default/nodm':
-               source => 'puppet:///modules/desktop/etc/default/nodm',
-               require => [
-                               Package['nodm'],
-                               User['guest'],
-                               ],
+               ensure => 'present',
        }
 
        $packages_i386 = [
@@ -66,23 +91,22 @@ class desktop {
 
        package { $packages_i386:
                ensure => installed,
-               subscribe => Exec['add-architecture-i386'],
+               require => Exec['add-architecture-i386'],
        }
 
        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',
-               notify => Package['skype'],
        }
 
        package { 'skype':
                provider => dpkg,
                ensure => latest,
                source => '/var/cache/skype-install.deb',
-       }
-
-       file { '/etc/skel/Desktop':
-               ensure => directory,
+               require => [
+                       Exec['download-skype'],
+                       Package['libc6:i386'],
+                       ],      
        }
 
        file { '/etc/skel/Desktop/skype.desktop':
@@ -93,5 +117,42 @@ class 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/.bashrc':
+               source => 'puppet:///modules/desktop/etc/skel/.bashrc',
+               mode => 'a=r',
+               ensure => file,
+       }
+
+       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/.bashrc'],
+                       ],
+               notify => [
+                               Exec['enable-guestx11'],
+                               Exec['start-guestx11'],
+                       ],
+               ensure => file,
+       }
 
 }