kitchen-dsc 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 738167d2b4abdbc0b05048c64a965c801f3d2e10
4
- data.tar.gz: f56a0e14b764ad65f7e2f38b45493c81f7687077
3
+ metadata.gz: 29faf507f394613d5f7fa39c2561d4629ea4235c
4
+ data.tar.gz: 71ec0f06d7a21ca9fd2e326a205cb85c04359836
5
5
  SHA512:
6
- metadata.gz: 0f60f1434718fc5c72f18e474c5ba1a0f99686c13619b284fb7564ba19c7f41ac35dfddd6c417a9dd3441d4e5771a5107f61e90629b9155e5c9a4150f7b7ab89
7
- data.tar.gz: 501b9d24510aeadd805851323ba917035566bcd457bca7fb0c6f66bebda0a063f637164440dd6143be1409e5b86eb652a624691c16e4f38a6f48687d47713368
6
+ metadata.gz: 26503fe0492d1ec6509ec027c7160b41060446095850cc42ce45bd92f6bb48a25df0703282d009c0e1dd363a4c3096ffa018c0f86d426308271e157eac296ea2
7
+ data.tar.gz: cb60c8a93accab2abdc637a9675d8b2fcbf6b1237eabb1f83ac8760ea37c2731856778cd38fac8d3f1f30c0dc78247f1aea2ed52c9ab9f3ef12d3969d47b8c0a
data/README.md CHANGED
@@ -10,6 +10,9 @@ You'll need a driver box with WMF4 or greater (ONLY WINDOWS SYSTEMS)
10
10
  ## Installation & Setup
11
11
  You'll need the test-kitchen & kitchen-dsc gems installed in your system, along with kitchen-vagrant or some ther suitable driver for test-kitchen.
12
12
 
13
+ ### Note:
14
+ You will see a delay in the return of the run details due to an difference in how the verbose stream is returned for DSC runs between WMF versions, so I return the verbose stream after the job completes. I'd love to live stream the results, but that'll take a bit more experimentation. (PR's welcome!)
15
+
13
16
  ## Example Configurations
14
17
  * [Repository Style Testing](https://github.com/smurawski/dsc-kitchen-project)
15
18
  * [Module Style Testing](https://github.com/powershellorg/cwebadministration/tree/smurawski/adding_tests)
@@ -18,19 +21,30 @@ You'll need the test-kitchen & kitchen-dsc gems installed in your system, along
18
21
  * configuration_script_folder
19
22
  * Defaults to 'examples'.
20
23
  * The location of a PowerShell script(s) containing the DSC configuration command(s).
24
+
21
25
  * configuration_script
22
26
  * Defaults to 'dsc_configuration.ps1'
23
27
  * The name of the PowerShell script containing the DSC configuration command(s) (and possibly configuration data)
28
+
24
29
  * configuration_name
25
30
  * Name of the configuration to run, defaults to the suite name.
31
+
32
+ * configuration_data
33
+ * A YAML representation of what should be passed to the configuration.
34
+ * Overrides any configurationdata variable assigned in the configuration script.
35
+
26
36
  * configuration_data_variable
27
- * Name of the variable in the configuration_script that contains the ConfigurationData hashtable
37
+ * Defaults to 'ConfigurationData'
38
+ * Name of the variable that contains the ConfigurationData hashtable
39
+ * Can be defined in the configuration script or via the `configuration_data` configuration setting.
40
+
28
41
  * dsc_local_configuration_manager_version
29
- * Defaults to 'wmf4' ()
42
+ * Defaults to 'wmf4'
30
43
  * Identifies what version of the LCM is in place
31
44
  * Other valid values are 'wmf4_with_update' and 'wmf5'
32
45
  * Currently the only difference between wmf4 and wmf4_with_update/wmf5 is the action_after_reboot and the debug_mode settings. Eventually, I'd like to add support for partial configurations, pull servers, etc..
33
46
  * In this context, wmf4_with_update refers to wmf4 with KB3000850 applied (to add support for WMF 5 generated configurations, plus some fixes).
47
+
34
48
  * dsc_local_configuration_manager
35
49
  * Settings for the LCM
36
50
  * Defaults are:
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Kitchen
4
4
  module Dsc
5
- VERSION = '0.5.0'
5
+ VERSION = '0.6.0'
6
6
  end
7
7
  end
@@ -28,7 +28,7 @@ module Kitchen
28
28
  provisioner.instance.suite.name
29
29
  end
30
30
 
31
- default_config :configuration_data_variable
31
+ default_config :configuration_data_variable, 'ConfigurationData'
32
32
  default_config :configuration_data
33
33
 
34
34
  default_config :dsc_local_configuration_manager_version, 'wmf4'
@@ -153,7 +153,7 @@ module Kitchen
153
153
  throw "Failed to create a configuration command #{config[:configuration_name]}"
154
154
  }
155
155
 
156
- #{'$ConfigurationData = ' + ps_hash(config[:configuration_data]) unless config[:configuration_data].nil?}
156
+ #{configuration_data_assignment unless config[:configuration_data].nil?}
157
157
 
158
158
  $null = #{config[:configuration_name]} -outputpath c:/configurations #{'-configurationdata $' + configuration_data_variable}
159
159
  EOH
@@ -162,12 +162,22 @@ module Kitchen
162
162
  end
163
163
  # rubocop:enable Metrics/LineLength
164
164
 
165
+ def configuration_data_assignment
166
+ '$' + configuration_data_variable + ' = ' + ps_hash(config[:configuration_data])
167
+ end
168
+
165
169
  def run_command
166
170
  info("Running the configuration #{config[:configuration_name]}")
167
171
  run_configuration_script = <<-EOH
172
+ $ProgressPreference = 'SilentlyContinue'
168
173
  $job = start-dscconfiguration -Path c:/configurations/ -force
169
174
  $job | wait-job
170
175
  $job.childjobs[0].verbose
176
+ $dsc_errors = $job.childjobs[0].Error
177
+ if ($dsc_errors -ne $null) {
178
+ $dsc_errors
179
+ exit 1
180
+ }
171
181
  EOH
172
182
 
173
183
  debug("Shelling out: #{run_configuration_script}")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-dsc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Murawski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-17 00:00:00.000000000 Z
11
+ date: 2015-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen