Puppet Plan: patching::deploy_scripts

Defined in:
plans/deploy_scripts.pp

Overview

Examples:

CLI deploy a pre patching script

bolt plan run patching::deploy_scripts scripts='{"pre_patch.sh": {"source": "puppet:///modules/test/patching/pre_patch.sh"}}'

CLI deploy a pre and post patching script

bolt plan run patching::deploy_scripts scripts='{"pre_patch.sh": {"source": "puppet:///modules/test/patching/pre_patch.sh"}, "post_patch.sh": {"source": "puppet:///modules/test/patching/post_patch.sh"}}'

Parameters:

  • owner (Optional[String]) (defaults to: undef)

    Default owner of installed scripts

  • group (Optional[String]) (defaults to: undef)

    Default group of installed scripts

  • mode (Optional[String]) (defaults to: undef)

    Default file mode of installed scripts

  • targets (TargetSpec)
  • scripts (Hash)
  • patching_dir (Optional[String]) (defaults to: undef)
  • bin_dir (Optional[String]) (defaults to: undef)
  • log_dir (Optional[String]) (defaults to: undef)


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 'plans/deploy_scripts.pp', line 34

plan patching::deploy_scripts(
  TargetSpec $targets,
  Hash $scripts,
  Optional[String] $patching_dir = undef,
  Optional[String] $bin_dir      = undef,
  Optional[String] $log_dir      = undef,
  Optional[String] $owner        = undef,
  Optional[String] $group        = undef,
  Optional[String] $mode         = undef,
) {
  $_targets = run_plan('patching::get_targets', $targets)
  return apply($_targets) {
    include patching::params
    class { 'patching':
      scripts      => $scripts,
      patching_dir => pick($patching_dir, $patching::params::patching_dir),
      bin_dir      => pick($bin_dir, $patching::params::bin_dir),
      log_dir      => pick($log_dir, $patching::params::log_dir),
      owner        => pick($owner, $patching::params::owner),
      group        => pick($group, $patching::params::group),
      mode         => pick($mode, $patching::params::mode),
    }
  }
}