Puppet Class: puppet_ent_agent::install::nix

Defined in:
manifests/install/nix.pp

Overview

Download bash script from pe_repo and run it



2
3
4
5
6
7
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
# File 'manifests/install/nix.pp', line 2

class puppet_ent_agent::install::nix {
  $curl_path    = $::puppet_ent_agent::curl_path
  $master       = $::puppet_ent_agent::master
  $staging_dir  = $::puppet_ent_agent::staging_dir
  $version      = $::puppet_ent_agent::ensure
  $install_file = "${staging_dir}/install.bash"
  $install_cmd  = "/bin/bash -e ${install_file}"
  $source       = "https://${master}:8140/packages/${version}/${::platform_tag}.bash"

  include wget

  assert_private()

  case $::osfamily {
    'AIX','Solaris':   {
      $group    = 'system'
      $use_curl = true
    }
    default: {
      $group    = 'root'
      $use_curl = false
    }
  }

  if (versioncmp($version,$::pe_version) > 0) {

    file { $staging_dir:
      ensure => directory,
      owner  => 'root',
      group  => $group,
      mode   => '0755',
    }

    if $use_curl {
      exec { "${curl_path} -1 -sLo \"${install_file}\" \"${source}\"":
        user   => 'root',
        before => Exec[$install_cmd],
      }
    } else {
      wget::fetch { 'download PE agent install.bash':
        source             => $source,
        destination        => $install_file,
        timeout            => 0,
        redownload         => true,
        verbose            => false,
        flags              => ['--secure-protocol=TLSv1'],
        nocheckcertificate => true,
        before             => Exec[$install_cmd],
      }
    }

    exec { $install_cmd:
      user => 'root',
    }
  }
}