kitchen-dsc 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +45 -45
- data/kitchen-dsc.gemspec +30 -30
- data/lib/kitchen/provisioner/dsc.rb +209 -205
- data/lib/kitchen-dsc/version.rb +7 -7
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42a5ff439d0535a553f3adb5a8c514e8f1bf7b91
|
4
|
+
data.tar.gz: 00d6cedc27bce66bb5e9e2533b5e6ccc08949516
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84b3e6a84d2c80ce8755115f3c3a5c31a941660f4273145bbbc3f29546110fe7fb769c02f7985756d1d359cbc1fa67c1e1faacad6601955d9fb30f5e8be575c4
|
7
|
+
data.tar.gz: 0b71ff875f127f6734ad85137a02f91072708b084ca6b145c4d544090105b7b3be085ee32389217bd6088dc6a7706a2043760d260019ac4c7d3871ce122b5850
|
data/README.md
CHANGED
@@ -1,45 +1,45 @@
|
|
1
|
-
# kitchen-dsc
|
2
|
-
A Test Kitchen Provisioner for PowerShell DSC
|
3
|
-
|
4
|
-
|
5
|
-
## Requirements
|
6
|
-
You'll need a driver box with WMF4 or greater (ONLY WINDOWS SYSTEMS)
|
7
|
-
|
8
|
-
## Installation & Setup
|
9
|
-
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.
|
10
|
-
|
11
|
-
## Example Configurations
|
12
|
-
[Repository Style Testing](https://github.com/smurawski/dsc-kitchen-project)
|
13
|
-
[Module Style Testing](https://github.com/powershellorg/cwebadministration/tree/smurawski/adding_tests)
|
14
|
-
|
15
|
-
## Configuration Settings
|
16
|
-
* configuration_script_folder
|
17
|
-
* Defaults to 'examples'.
|
18
|
-
* The location of a PowerShell script(s) containing the DSC configuration command(s).
|
19
|
-
* configuration_script
|
20
|
-
* Defaults to 'dsc_configuration.ps1'
|
21
|
-
* The name of the PowerShell script containing the DSC configuration command(s).
|
22
|
-
* The configuration command name used defaults to the suite name (and can be overridden by the run_list parameter in the suite).
|
23
|
-
* dsc_local_configuration_manager_version
|
24
|
-
* Defaults to 'wmf4' ()
|
25
|
-
* Identifies what version of the LCM is in place
|
26
|
-
* Other valid values are 'wmf4_with_update' and 'wmf5'
|
27
|
-
* 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..
|
28
|
-
* In this context, wmf4_with_update refers to wmf4 with KB3000850 applied (to add support for WMF 5 generated configurations, plus some fixes).
|
29
|
-
* dsc_local_configuration_manager
|
30
|
-
* Settings for the LCM
|
31
|
-
* Defaults are:
|
32
|
-
* action_after_reboot = 'StopConfiguration' # wmf4_with_update or wmf5
|
33
|
-
* allow_module_overwrite = false
|
34
|
-
* certificate_id = nil
|
35
|
-
* configuration_mode = 'ApplyAndAutoCorrect'
|
36
|
-
* configuration_mode_frequency_mins = 30
|
37
|
-
* debug_mode = 'All' # wmf4_with_update or wmf5
|
38
|
-
* refresh_frequency_mins = 15
|
39
|
-
* refresh_mode = 'PUSH'
|
40
|
-
|
41
|
-
### Specific to repository style testing
|
42
|
-
* modules_path
|
43
|
-
* Defaults to 'modules'.
|
44
|
-
* Points to the location of modules containing DSC resources to upload
|
45
|
-
* This path is relative to the root of the repository (the location of the .kitchen.yml).
|
1
|
+
# kitchen-dsc
|
2
|
+
A Test Kitchen Provisioner for PowerShell DSC
|
3
|
+
|
4
|
+
|
5
|
+
## Requirements
|
6
|
+
You'll need a driver box with WMF4 or greater (ONLY WINDOWS SYSTEMS)
|
7
|
+
|
8
|
+
## Installation & Setup
|
9
|
+
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.
|
10
|
+
|
11
|
+
## Example Configurations
|
12
|
+
[Repository Style Testing](https://github.com/smurawski/dsc-kitchen-project)
|
13
|
+
[Module Style Testing](https://github.com/powershellorg/cwebadministration/tree/smurawski/adding_tests)
|
14
|
+
|
15
|
+
## Configuration Settings
|
16
|
+
* configuration_script_folder
|
17
|
+
* Defaults to 'examples'.
|
18
|
+
* The location of a PowerShell script(s) containing the DSC configuration command(s).
|
19
|
+
* configuration_script
|
20
|
+
* Defaults to 'dsc_configuration.ps1'
|
21
|
+
* The name of the PowerShell script containing the DSC configuration command(s).
|
22
|
+
* The configuration command name used defaults to the suite name (and can be overridden by the run_list parameter in the suite).
|
23
|
+
* dsc_local_configuration_manager_version
|
24
|
+
* Defaults to 'wmf4' ()
|
25
|
+
* Identifies what version of the LCM is in place
|
26
|
+
* Other valid values are 'wmf4_with_update' and 'wmf5'
|
27
|
+
* 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..
|
28
|
+
* In this context, wmf4_with_update refers to wmf4 with KB3000850 applied (to add support for WMF 5 generated configurations, plus some fixes).
|
29
|
+
* dsc_local_configuration_manager
|
30
|
+
* Settings for the LCM
|
31
|
+
* Defaults are:
|
32
|
+
* action_after_reboot = 'StopConfiguration' # wmf4_with_update or wmf5
|
33
|
+
* allow_module_overwrite = false
|
34
|
+
* certificate_id = nil
|
35
|
+
* configuration_mode = 'ApplyAndAutoCorrect'
|
36
|
+
* configuration_mode_frequency_mins = 30
|
37
|
+
* debug_mode = 'All' # wmf4_with_update or wmf5
|
38
|
+
* refresh_frequency_mins = 15
|
39
|
+
* refresh_mode = 'PUSH'
|
40
|
+
|
41
|
+
### Specific to repository style testing
|
42
|
+
* modules_path
|
43
|
+
* Defaults to 'modules'.
|
44
|
+
* Points to the location of modules containing DSC resources to upload
|
45
|
+
* This path is relative to the root of the repository (the location of the .kitchen.yml).
|
data/kitchen-dsc.gemspec
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
4
|
-
require 'kitchen-dsc/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = 'kitchen-dsc'
|
8
|
-
s.version = Kitchen::Dsc::VERSION
|
9
|
-
s.authors = ['Steven Murawski']
|
10
|
-
s.email = ['steven.murawski@gmail.com']
|
11
|
-
s.homepage = 'https://github.com/smurawski/kitchen-dsc'
|
12
|
-
s.summary = 'PowerShell DSC provisioner for test-kitchen'
|
13
|
-
candidates = Dir.glob('lib/**/*') + ['README.md', 'kitchen-dsc.gemspec']
|
14
|
-
s.files = candidates.sort
|
15
|
-
s.platform = Gem::Platform::RUBY
|
16
|
-
s.require_paths = ['lib']
|
17
|
-
s.rubyforge_project = '[none]'
|
18
|
-
s.license = 'MIT'
|
19
|
-
s.description = <<-EOF
|
20
|
-
== DESCRIPTION:
|
21
|
-
|
22
|
-
DSC Provisioner for Test Kitchen
|
23
|
-
|
24
|
-
== FEATURES:
|
25
|
-
|
26
|
-
TBD
|
27
|
-
|
28
|
-
EOF
|
29
|
-
|
30
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
$LOAD_PATH.unshift File.expand_path('../lib', __FILE__)
|
4
|
+
require 'kitchen-dsc/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = 'kitchen-dsc'
|
8
|
+
s.version = Kitchen::Dsc::VERSION
|
9
|
+
s.authors = ['Steven Murawski']
|
10
|
+
s.email = ['steven.murawski@gmail.com']
|
11
|
+
s.homepage = 'https://github.com/smurawski/kitchen-dsc'
|
12
|
+
s.summary = 'PowerShell DSC provisioner for test-kitchen'
|
13
|
+
candidates = Dir.glob('lib/**/*') + ['README.md', 'kitchen-dsc.gemspec']
|
14
|
+
s.files = candidates.sort
|
15
|
+
s.platform = Gem::Platform::RUBY
|
16
|
+
s.require_paths = ['lib']
|
17
|
+
s.rubyforge_project = '[none]'
|
18
|
+
s.license = 'MIT'
|
19
|
+
s.description = <<-EOF
|
20
|
+
== DESCRIPTION:
|
21
|
+
|
22
|
+
DSC Provisioner for Test Kitchen
|
23
|
+
|
24
|
+
== FEATURES:
|
25
|
+
|
26
|
+
TBD
|
27
|
+
|
28
|
+
EOF
|
29
|
+
|
30
|
+
end
|
@@ -1,205 +1,209 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
#
|
3
|
-
# Author:: Steven Murawski (<steven.murawski@gmail.com>)
|
4
|
-
#
|
5
|
-
# Copyright (C) 2014 Steven Murawski
|
6
|
-
#
|
7
|
-
# Licensed under the MIT License.
|
8
|
-
# See LICENSE for more details
|
9
|
-
|
10
|
-
require 'fileutils'
|
11
|
-
require 'pathname'
|
12
|
-
require 'kitchen/provisioner/base'
|
13
|
-
require 'kitchen/util'
|
14
|
-
|
15
|
-
module Kitchen
|
16
|
-
|
17
|
-
module Provisioner
|
18
|
-
class Dsc < Base
|
19
|
-
kitchen_provisioner_api_version 2
|
20
|
-
|
21
|
-
attr_accessor :tmp_dir
|
22
|
-
|
23
|
-
default_config :modules_path, 'modules'
|
24
|
-
default_config :configuration_script_folder, 'examples'
|
25
|
-
default_config :configuration_script, 'dsc_configuration.ps1'
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
end
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
{
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
}
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
end
|
169
|
-
|
170
|
-
def
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
end
|
194
|
-
|
195
|
-
def
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
#
|
3
|
+
# Author:: Steven Murawski (<steven.murawski@gmail.com>)
|
4
|
+
#
|
5
|
+
# Copyright (C) 2014 Steven Murawski
|
6
|
+
#
|
7
|
+
# Licensed under the MIT License.
|
8
|
+
# See LICENSE for more details
|
9
|
+
|
10
|
+
require 'fileutils'
|
11
|
+
require 'pathname'
|
12
|
+
require 'kitchen/provisioner/base'
|
13
|
+
require 'kitchen/util'
|
14
|
+
|
15
|
+
module Kitchen
|
16
|
+
|
17
|
+
module Provisioner
|
18
|
+
class Dsc < Base
|
19
|
+
kitchen_provisioner_api_version 2
|
20
|
+
|
21
|
+
attr_accessor :tmp_dir
|
22
|
+
|
23
|
+
default_config :modules_path, 'modules'
|
24
|
+
default_config :configuration_script_folder, 'examples'
|
25
|
+
default_config :configuration_script, 'dsc_configuration.ps1'
|
26
|
+
default_config :configuration_name do |provisioner|
|
27
|
+
provisioner.instance.suite.name
|
28
|
+
end
|
29
|
+
default_config :configuration_data_variable
|
30
|
+
|
31
|
+
default_config :dsc_local_configuration_manager_version, 'wmf4'
|
32
|
+
default_config :dsc_local_configuration_manager, {
|
33
|
+
action_after_reboot: 'StopConfiguration',
|
34
|
+
allow_module_overwrite: false,
|
35
|
+
certificate_id: nil,
|
36
|
+
configuration_mode: 'ApplyAndAutoCorrect',
|
37
|
+
configuration_mode_frequency_mins: 30,
|
38
|
+
debug_mode: 'All',
|
39
|
+
reboot_if_needed: false,
|
40
|
+
refresh_frequency_mins: 15,
|
41
|
+
refresh_mode: 'PUSH'
|
42
|
+
}
|
43
|
+
|
44
|
+
# Disable line length check, it is all embedded script.
|
45
|
+
# rubocop:disable Metrics/LineLength
|
46
|
+
def install_command
|
47
|
+
lcm_config = config[:dsc_local_configuration_manager]
|
48
|
+
case config[:dsc_local_configuration_manager_version]
|
49
|
+
when 'wmf4_legacy', 'wmf4'
|
50
|
+
lcm_configuration_script = <<-LCMSETUP
|
51
|
+
configuration SetupLCM
|
52
|
+
{
|
53
|
+
LocalConfigurationManager
|
54
|
+
{
|
55
|
+
AllowModuleOverwrite = [bool]::Parse('#{lcm_config[:allow_module_overwrite]}')
|
56
|
+
CertificateID = '#{lcm_config[:certificate_id].nil? ? '$null' : lcm_config[:certificate_id]}'
|
57
|
+
ConfigurationMode = '#{lcm_config[:configuration_mode]}'
|
58
|
+
ConfigurationModeFrequencyMins = #{lcm_config[:configuration_mode_frequency_mins]}
|
59
|
+
RebootNodeIfNeeded = [bool]::Parse('#{lcm_config[:reboot_if_needed]}')
|
60
|
+
RefreshFrequencyMins = #{lcm_config[:refresh_frequency_mins]}
|
61
|
+
RefreshMode = '#{lcm_config[:refresh_mode]}'
|
62
|
+
}
|
63
|
+
}
|
64
|
+
SetupLCM
|
65
|
+
Set-DscLocalConfigurationManager -Path ./SetupLCM
|
66
|
+
LCMSETUP
|
67
|
+
when 'wmf4_with_update', 'wmf5'
|
68
|
+
lcm_configuration_script = <<-LCMSETUP
|
69
|
+
configuration SetupLCM
|
70
|
+
{
|
71
|
+
LocalConfigurationManager
|
72
|
+
{
|
73
|
+
ActionAfterReboot = '#{lcm_config[:action_after_reboot]}'
|
74
|
+
AllowModuleOverwrite = [bool]::Parse('#{lcm_config[:allow_module_overwrite]}')
|
75
|
+
CertificateID = '#{lcm_config[:certificate_id].nil? ? '$null' : lcm_config[:certificate_id]}'
|
76
|
+
ConfigurationMode = '#{lcm_config[:configuration_mode]}'
|
77
|
+
ConfigurationModeFrequencyMins = #{lcm_config[:configuration_mode_frequency_mins]}
|
78
|
+
DebugMode = '#{lcm_config[:debug_mode]}'
|
79
|
+
RebootNodeIfNeeded = [bool]::Parse('#{lcm_config[:reboot_if_needed]}')
|
80
|
+
RefreshFrequencyMins = #{lcm_config[:refresh_frequency_mins]}
|
81
|
+
RefreshMode = '#{lcm_config[:refresh_mode]}'
|
82
|
+
}
|
83
|
+
}
|
84
|
+
$null = SetupLCM
|
85
|
+
Set-DscLocalConfigurationManager -Path ./SetupLCM
|
86
|
+
LCMSETUP
|
87
|
+
end
|
88
|
+
wrap_shell_code(lcm_configuration_script)
|
89
|
+
end
|
90
|
+
# rubocop:enable Metrics/LineLength
|
91
|
+
|
92
|
+
def init_command
|
93
|
+
end
|
94
|
+
|
95
|
+
def create_sandbox
|
96
|
+
super
|
97
|
+
info('Staging DSC Resource Modules for copy to the SUT')
|
98
|
+
if resource_module?
|
99
|
+
prepare_resource_style_directory
|
100
|
+
else
|
101
|
+
prepare_repo_style_directory
|
102
|
+
end
|
103
|
+
info('Staging DSC configuration script for copy to the SUT')
|
104
|
+
prepare_configuration_script
|
105
|
+
end
|
106
|
+
|
107
|
+
# Disable line length check, it is all logging and embedded script.
|
108
|
+
# rubocop:disable Metrics/LineLength
|
109
|
+
def prepare_command
|
110
|
+
info('Moving DSC Resources onto PSModulePath')
|
111
|
+
info("Generating the MOF script for the configuration #{config[:configuration_name]}")
|
112
|
+
stage_resources_and_generate_mof_script = <<-EOH
|
113
|
+
dir ( join-path #{config[:root_path]} 'modules/*') -directory |
|
114
|
+
copy-item -destination $env:programfiles/windowspowershell/modules/ -recurse -force
|
115
|
+
|
116
|
+
if (-not (test-path 'c:/configurations'))
|
117
|
+
{
|
118
|
+
mkdir 'c:/configurations' | out-null
|
119
|
+
}
|
120
|
+
$ConfigurationScriptPath = Join-path #{config[:root_path]} #{sandboxed_configuration_script}
|
121
|
+
if (-not (test-path $ConfigurationScriptPath))
|
122
|
+
{
|
123
|
+
throw "Failed to find $ConfigurationScriptPath"
|
124
|
+
}
|
125
|
+
invoke-expression (get-content $ConfigurationScriptPath -raw)
|
126
|
+
if (-not (get-command #{config[:configuration_name]}))
|
127
|
+
{
|
128
|
+
throw "Failed to create a configuration command #{config[:configuration_name]}"
|
129
|
+
}
|
130
|
+
$null = #{config[:configuration_name]} -outputpath c:/configurations #{'-configurationdata $' + config[:configuration_data_variable] if config[:configuration_data_variable]}
|
131
|
+
EOH
|
132
|
+
debug("Shelling out: #{stage_resources_and_generate_mof_script}")
|
133
|
+
wrap_shell_code(stage_resources_and_generate_mof_script)
|
134
|
+
end
|
135
|
+
# rubocop:enable Metrics/LineLength
|
136
|
+
|
137
|
+
def run_command
|
138
|
+
info("Running the configuration #{config[:configuration_name]}")
|
139
|
+
run_configuration_script = <<-EOH
|
140
|
+
$job = start-dscconfiguration -Path c:/configurations/ -force
|
141
|
+
$job | wait-job
|
142
|
+
$job.childjobs[0].verbose
|
143
|
+
EOH
|
144
|
+
|
145
|
+
debug("Shelling out: #{run_configuration_script}")
|
146
|
+
wrap_shell_code(run_configuration_script)
|
147
|
+
end
|
148
|
+
|
149
|
+
private
|
150
|
+
|
151
|
+
def resource_module?
|
152
|
+
module_metadata_file = File.join(config[:kitchen_root], "#{module_name}.psd1")
|
153
|
+
module_dsc_resource_folder = File.join(config[:kitchen_root], 'DSCResources')
|
154
|
+
File.exist?(module_metadata_file) &&
|
155
|
+
File.exist?(module_dsc_resource_folder)
|
156
|
+
end
|
157
|
+
|
158
|
+
def list_files(path)
|
159
|
+
base_directory_content = Dir.glob(File.join(path, '*'))
|
160
|
+
nested_directory_content = Dir.glob(File.join(path, '*/**/*'))
|
161
|
+
all_directory_content =([base_directory_content, nested_directory_content]).flatten
|
162
|
+
|
163
|
+
ignore_files = ['Gemfile', 'Gemfile.lock', 'README.md', 'LICENSE.txt']
|
164
|
+
all_directory_content.reject do |f|
|
165
|
+
debug("Enumerating #{f}")
|
166
|
+
ignore_files.include?(File.basename(f)) || File.directory?(f)
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
def module_name
|
171
|
+
File.basename(config[:kitchen_root])
|
172
|
+
end
|
173
|
+
|
174
|
+
def prepare_resource_style_directory
|
175
|
+
sandbox_base_module_path = File.join(sandbox_path, "modules/#{module_name}")
|
176
|
+
|
177
|
+
base = config[:kitchen_root]
|
178
|
+
list_files(base).each do |src|
|
179
|
+
dest = File.join(sandbox_base_module_path, src.sub("#{base}/", ''))
|
180
|
+
FileUtils.mkdir_p(File.dirname(dest))
|
181
|
+
debug("Staging #{src} ")
|
182
|
+
debug(" at #{dest}")
|
183
|
+
FileUtils.cp(src, dest, preserve: true)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
def prepare_repo_style_directory
|
188
|
+
module_path = File.join(config[:kitchen_root], config[:modules_path])
|
189
|
+
sandbox_module_path = File.join(sandbox_path, 'modules')
|
190
|
+
|
191
|
+
debug("Moving #{module_path} to #{sandbox_module_path}")
|
192
|
+
FileUtils.cp_r(module_path, sandbox_module_path)
|
193
|
+
end
|
194
|
+
|
195
|
+
def sandboxed_configuration_script
|
196
|
+
File.join('configuration', config[:configuration_script])
|
197
|
+
end
|
198
|
+
|
199
|
+
def prepare_configuration_script
|
200
|
+
configuration_script_file = File.join(config[:configuration_script_folder], config[:configuration_script])
|
201
|
+
configuration_script_path = File.join(config[:kitchen_root], configuration_script_file)
|
202
|
+
sandbox_configuration_script_path = File.join(sandbox_path, sandboxed_configuration_script)
|
203
|
+
FileUtils.mkdir_p(File.dirname(sandbox_configuration_script_path))
|
204
|
+
debug("Moving #{configuration_script_path} to #{sandbox_configuration_script_path}")
|
205
|
+
FileUtils.cp(configuration_script_path, sandbox_configuration_script_path)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
end
|
209
|
+
end
|
data/lib/kitchen-dsc/version.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module Kitchen
|
4
|
-
module Dsc
|
5
|
-
VERSION = '0.
|
6
|
-
end
|
7
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module Kitchen
|
4
|
+
module Dsc
|
5
|
+
VERSION = '0.3.0'
|
6
|
+
end
|
7
|
+
end
|
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.
|
4
|
+
version: 0.3.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-04-
|
11
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |+
|
14
14
|
== DESCRIPTION:
|
@@ -39,16 +39,16 @@ require_paths:
|
|
39
39
|
- lib
|
40
40
|
required_ruby_version: !ruby/object:Gem::Requirement
|
41
41
|
requirements:
|
42
|
-
- -
|
42
|
+
- - ">="
|
43
43
|
- !ruby/object:Gem::Version
|
44
44
|
version: '0'
|
45
45
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
46
|
requirements:
|
47
|
-
- -
|
47
|
+
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
49
|
version: '0'
|
50
50
|
requirements: []
|
51
|
-
rubyforge_project:
|
51
|
+
rubyforge_project: "[none]"
|
52
52
|
rubygems_version: 2.4.4
|
53
53
|
signing_key:
|
54
54
|
specification_version: 4
|