Puppet Class: crypt::client

Inherits:
crypt::params
Defined in:
manifests/client.pp

Overview

Parameters:

  • server_url (Any) (defaults to: $crypt::params::server_url)
  • loginhook (Any) (defaults to: $crypt::params::loginhook)
  • skip_username (Any) (defaults to: undef)
  • install_app (Any) (defaults to: undef)


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
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'manifests/client.pp', line 29

class crypt::client (
    $server_url     = $crypt::params::server_url,
    $loginhook      = $crypt::params::loginhook,
    $skip_username = undef,
    $install_app    = undef,
    
    ) inherits crypt::params {
    
    #include mac_admin::loginhook
    
    if ! defined(File['/var/lib/puppet/crypt']) {
      file { '/var/lib/puppet/crypt':
        ensure => directory,
      }
    }

    ##Write out the contents of the template to a mobileconfig file (this needs to be cleaned up)
    file {'/var/lib/puppet/crypt/com.grahamgilbert.crypt.mobileconfig':
        content => template('crypt/com.grahamgilbert.crypt.erb'),
        owner   => 0,
        group   => 0,
        mode    => '0755',
    }

    ##Install the profile
    mac_profiles_handler::manage { 'com.grahamgilbert.crypt':
        ensure      => present,
        file_source => '/var/lib/puppet/crypt/com.grahamgilbert.crypt.mobileconfig',
        require     => File['/var/lib/puppet/crypt/com.grahamgilbert.crypt.mobileconfig']
    }
    
    if $loginhook {
        file {'/var/lib/puppet/crypt/filevault.sh':
            content => template('crypt/filevault.sh.erb'),
            owner   => 0,
            group   => 0,
            mode    => '0755',
        }
        
        mac_admin::loginhook {'crypt-hook':
            script => '/var/lib/puppet/crypt/filevault.sh'
        }
    }
    
}