diff --git a/plugins/provisioners/salt/bootstrap-salt.ps1 b/plugins/provisioners/salt/bootstrap-salt.ps1 index 61ce14ad5..78b1dd39b 100644 --- a/plugins/provisioners/salt/bootstrap-salt.ps1 +++ b/plugins/provisioners/salt/bootstrap-salt.ps1 @@ -1,8 +1,16 @@ # Copy minion keys & config to correct location New-Item c:\salt\conf\pki\minion\ -ItemType directory | out-null -cp C:\tmp\minion.pem C:\salt\conf\pki\minion\ -cp C:\tmp\minion.pub C:\salt\conf\pki\minion\ -cp C:\tmp\minion C:\salt\conf\ + +# Check if minion keys have been uploaded +if (Test-Path C:\tmp\minion.pem) { + cp C:\tmp\minion.pem C:\salt\conf\pki\minion\ + cp C:\tmp\minion.pub C:\salt\conf\pki\minion\ +} + +# Check if minion config has been uploaded +if (Test-Path C:\tmp\minion) { + cp C:\tmp\minion C:\salt\conf\ +} # Detect architecture if ([IntPtr]::Size -eq 4) {