|
58 | 58 | } |
59 | 59 |
|
60 | 60 | $_timestamp = strftime('%Y_%m_%d-%H_%M') |
61 | | - $_logfile = windows_native_path("${::env_temp_variable}/puppet-${_timestamp}-installer.log") |
| 61 | + $_logfile = windows_native_path("${facts['env_temp_variable']}/puppet-${_timestamp}-installer.log") |
62 | 62 |
|
63 | 63 | notice ("Puppet upgrade log file at ${_logfile}") |
64 | 64 | debug ("Installing puppet from ${_msi_location}") |
65 | 65 |
|
66 | | - $_helpers = windows_native_path("${::env_temp_variable}/helpers.ps1") |
| 66 | + $_helpers = windows_native_path("${facts['env_temp_variable']}/helpers.ps1") |
67 | 67 | file { $_helpers: |
68 | 68 | ensure => file, |
69 | 69 | content => file('puppet_agent/helpers.ps1'), |
70 | 70 | } |
71 | 71 |
|
72 | | - $_installps1 = windows_native_path("${::env_temp_variable}/install_puppet.ps1") |
| 72 | + $_installps1 = windows_native_path("${facts['env_temp_variable']}/install_puppet.ps1") |
73 | 73 | puppet_agent_upgrade_error { 'puppet_agent_upgrade_failure.log': } |
74 | 74 | file { $_installps1: |
75 | 75 | ensure => file, |
76 | 76 | content => file('puppet_agent/install_puppet.ps1'), |
77 | 77 | } |
78 | 78 |
|
79 | | - $_prerequisites_check = windows_native_path("${::env_temp_variable}/prerequisites_check.ps1") |
| 79 | + $_prerequisites_check = windows_native_path("${facts['env_temp_variable']}/prerequisites_check.ps1") |
80 | 80 | file { $_prerequisites_check: |
81 | 81 | ensure => file, |
82 | 82 | content => file('puppet_agent/prerequisites_check.ps1'), |
|
103 | 103 | -NoLogo \ |
104 | 104 | -NonInteractive \ |
105 | 105 | -Command ${_installps1} \ |
106 | | - -PuppetPID ${::puppet_agent_pid} \ |
| 106 | + -PuppetPID ${facts['puppet_agent_pid']} \ |
107 | 107 | -Source '${_msi_location}' \ |
108 | 108 | -Logfile '${_logfile}' \ |
109 | 109 | -InstallDir '${install_dir}' \ |
110 | | - -PuppetMaster '${::puppet_master_server}' \ |
| 110 | + -PuppetMaster '${facts['puppet_master_server']}' \ |
111 | 111 | -PuppetStartType '${_agent_startup_mode}' \ |
112 | 112 | -InstallArgs '${_install_options}' \ |
113 | 113 | ${_move_dll_workaround} \ |
|
123 | 123 | exit 0; \ |
124 | 124 | } \ |
125 | 125 | exit 1; }.Invoke()", |
126 | | - path => $::path, |
| 126 | + path => $facts['path'], |
127 | 127 | require => [ |
128 | 128 | Puppet_agent_upgrade_error['puppet_agent_upgrade_failure.log'], |
129 | 129 | File[$_installps1], |
|
134 | 134 |
|
135 | 135 | # PUP-5480/PE-15037 Cache dir loses inheritable SYSTEM perms |
136 | 136 | exec { 'fix inheritable SYSTEM perms': |
137 | | - command => "${facts['os']['windows']['system32']}\\icacls.exe \"${::puppet_client_datadir}\" /grant \"SYSTEM:(OI)(CI)(F)\"", |
138 | | - unless => "${facts['os']['windows']['system32']}\\cmd.exe /c ${facts['os']['windows']['system32']}\\icacls.exe \"${::puppet_client_datadir}\" | findstr \"SYSTEM:(OI)(CI)(F)\"", |
| 137 | + command => "${facts['os']['windows']['system32']}\\icacls.exe \"${facts['puppet_client_datadir']}\" /grant \"SYSTEM:(OI)(CI)(F)\"", |
| 138 | + unless => "${facts['os']['windows']['system32']}\\cmd.exe /c ${facts['os']['windows']['system32']}\\icacls.exe \"${facts['puppet_client_datadir']}\" | findstr \"SYSTEM:(OI)(CI)(F)\"", |
139 | 139 | require => Exec['install_puppet.ps1'], |
140 | 140 | } |
141 | 141 | } |
0 commit comments