Defined Type: x2go::tce

Defined in:
manifests/tce.pp

Overview

Parameters:

  • ensure (Any) (defaults to: latest)
  • export_2_network (Any) (defaults to: '172.25.0.0/255.255.0.0')
  • x2go_tce_base (Any) (defaults to: '/opt/x2gothinclient')


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'manifests/tce.pp', line 8

define x2go::tce (
  $ensure             =  latest,
  $export_2_network   = '172.25.0.0/255.255.0.0',
  $x2go_tce_base      = '/opt/x2gothinclient',  
) {
  include x2go::common
  $x2go_chroot = "$x2go_tce_base/chroot"
  
  package { 'x2gothinclientmanagement':
    ensure => $ensure,
    require => Class['x2go::common','apt::update'],
  }
  
  file {'/etc/x2go/x2gothinclient_settings':
    content => template("x2go/x2gothinclient_settings.erb"),
    }

  exec{'x2go::tce::x2gothinclient_create':
    require => [
      Package['x2gothinclientmanagement'],
      File['/etc/x2go/x2gothinclient_settings'],
      ],
      # we install also the default configuration
    command => "rm -rf $x2go_chroot && sudo -iuroot x2gothinclient_create && sudo -iuroot x2gothinclient_update",
    path => '/usr/local/bin:/usr/bin/:/bin:/usr/sbin:/sbin',
    creates => "$x2go_chroot/etc/apt/sources.list.d/x2go.list",
  }
  exec{'x2go::tce::x2gothinclient_preptftpboot':
    require => Exec['x2go::tce::x2gothinclient_create'],
    command => 'sudo -iuroot x2gothinclient_preptftpboot', # we need to use sudo or x2go will complain!
    path => '/usr/local/bin:/usr/bin/:/bin:/usr/sbin:/sbin',
    creates => '/srv/tftp/x2go-splash.png'
    }
    
  file{'/etc/exports.old':
    content => "$x2go_chroot  172.25.0.0/255.255.0.0(ro,async,no_root_squash,no_subtree_check)
",
    require => Exec['x2go::tce::x2gothinclient_preptftpboot'],
  }
  
  augeas{ "export tce chroot" :
    context => "/files/etc/exports",
    changes => [
        "set dir[last()+1] '$x2go_chroot'",
        "set dir[last()]/client $export_2_network",
        "set dir[last()]/client/option[1] ro",
        "set dir[last()]/client/option[2] async",
        "set dir[last()]/client/option[3] no_root_squash",
        "set dir[last()]/client/option[4] no_subtree_check",
    ],
    onlyif => "match dir[. = '$x2go_chroot'] size == 0",
  }
}