From 489021cdec5eb0a456512ca96b0ad800a535c205 Mon Sep 17 00:00:00 2001 From: Adam Russell Date: Tue, 21 Jul 2020 16:14:38 -0500 Subject: [PATCH 1/2] Add pillar_env provisioner option. --- docs/provisioner_options.md | 6 ++++++ lib/kitchen/provisioner/minion.erb | 2 +- lib/kitchen/provisioner/salt_solo.rb | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/provisioner_options.md b/docs/provisioner_options.md index 7b2b256d..c1c9ba79 100644 --- a/docs/provisioner_options.md +++ b/docs/provisioner_options.md @@ -302,6 +302,12 @@ The result would be: |- baz |- [contents of qux] +### pillar_env ### + +default: `nil` + +Environment to use in minion config file for the pillar root, if different from `salt_env`. + ## Install Salt ## ### salt_install ### diff --git a/lib/kitchen/provisioner/minion.erb b/lib/kitchen/provisioner/minion.erb index 78b80564..91c8b3d9 100644 --- a/lib/kitchen/provisioner/minion.erb +++ b/lib/kitchen/provisioner/minion.erb @@ -9,7 +9,7 @@ file_roots: - <%= os_join(config[:root_path], config[:salt_spm_root], 'salt') %> pillar_roots: - <%= config[:salt_env] %>: + <%= config[:pillar_env] || config[:salt_env] %>: - <%= os_join(config[:root_path], config[:salt_pillar_root]) %> - <%= os_join(config[:root_path], config[:salt_spm_root], 'pillar') %> diff --git a/lib/kitchen/provisioner/salt_solo.rb b/lib/kitchen/provisioner/salt_solo.rb index e42d7148..215ef811 100644 --- a/lib/kitchen/provisioner/salt_solo.rb +++ b/lib/kitchen/provisioner/salt_solo.rb @@ -47,6 +47,7 @@ class SaltSolo < Base is_file_root: false, local_salt_root: nil, omnibus_cachier: false, + pillar_env: nil, pillars_from_directories: [], pip_bin: 'pip', pip_editable: false, From 9c87d404be8326bfcd222c72e39707ce091fad41 Mon Sep 17 00:00:00 2001 From: Bryce Larson Date: Wed, 16 Sep 2020 20:34:37 +0000 Subject: [PATCH 2/2] use 7zip to create the zip archive --- lib/kitchen/verifier/nox.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/kitchen/verifier/nox.rb b/lib/kitchen/verifier/nox.rb index 051a4736..2c560ca8 100644 --- a/lib/kitchen/verifier/nox.rb +++ b/lib/kitchen/verifier/nox.rb @@ -203,9 +203,14 @@ def call(state) if config[:windows] if config[:zip_windows_artifacts] begin - conn.execute("powershell Compress-Archive #{remote} #{remote}artifacts.zip -Force") + conn.execute("7z.exe a #{remote}artifacts.zip #{remote}") rescue => e - error("Failed to create zip") + begin + info("7z.exe failed, attempting zip with powershell Compress-Archive") + conn.execute("powershell Compress-Archive #{remote} #{remote}artifacts.zip -Force") + rescue => e2 + error("Failed to create zip") + end end end else