From fc3a2106fd59a0bcf0cd52152b62dbe87ee90122 Mon Sep 17 00:00:00 2001 From: Marno van der Molen Date: Mon, 19 May 2014 15:52:20 +0200 Subject: [PATCH] Only try to copy keys & config if they have been uploaded --- plugins/provisioners/salt/bootstrap-salt.ps1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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) {