kitchen-dsc 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +107 -107
- data/kitchen-dsc.gemspec +48 -48
- data/lib/kitchen-dsc/version.rb +7 -7
- data/lib/kitchen/provisioner/dsc.rb +311 -291
- data/lib/kitchen/provisioner/dsc_lcm/lcm_base.rb +88 -88
- data/lib/kitchen/provisioner/dsc_lcm/lcm_v4.rb +53 -53
- data/lib/kitchen/provisioner/dsc_lcm/lcm_v5.rb +54 -54
- metadata +3 -4
@@ -1,88 +1,88 @@
|
|
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 Apache 2 License.
|
8
|
-
# See LICENSE for more details
|
9
|
-
|
10
|
-
require "kitchen/provisioner/dsc_lcm/lcm_v4"
|
11
|
-
require "kitchen/provisioner/dsc_lcm/lcm_v5"
|
12
|
-
|
13
|
-
module Kitchen
|
14
|
-
module Provisioner
|
15
|
-
module DscLcm
|
16
|
-
class LcmBase
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
def lcm_properties
|
21
|
-
{
|
22
|
-
:allow_module_overwrite => false,
|
23
|
-
:certificate_id => nil,
|
24
|
-
:configuration_mode => "ApplyAndAutoCorrect",
|
25
|
-
:configuration_mode_frequency_mins => 30,
|
26
|
-
:reboot_if_needed => false,
|
27
|
-
:refresh_mode => "PUSH",
|
28
|
-
:refresh_frequency_mins => 15
|
29
|
-
}
|
30
|
-
end
|
31
|
-
|
32
|
-
def initialize(config = {})
|
33
|
-
@certificate_id = nil
|
34
|
-
lcm_properties.each do |setting, value|
|
35
|
-
send(setting, value)
|
36
|
-
end
|
37
|
-
|
38
|
-
config.each do |setting, value|
|
39
|
-
send(setting, value)
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
def method_missing(name, *args)
|
44
|
-
return super unless lcm_properties.keys.include?(name)
|
45
|
-
if args.length == 1
|
46
|
-
instance_variable_set("@#{name}", args.first)
|
47
|
-
else
|
48
|
-
instance_variable_get("@#{name}")
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def certificate_id(value = nil)
|
53
|
-
if value.nil?
|
54
|
-
@certificate_id.nil? ? "$null" : "'#{@certificate_id}'"
|
55
|
-
else
|
56
|
-
@certificate_id = value
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
def lcm_config
|
61
|
-
hash = {}
|
62
|
-
lcm_properties.keys.each do |key|
|
63
|
-
hash[key] = send(key)
|
64
|
-
end
|
65
|
-
hash
|
66
|
-
end
|
67
|
-
|
68
|
-
def lcm_configuration_script
|
69
|
-
<<-LCMSETUP
|
70
|
-
configuration SetupLCM
|
71
|
-
{
|
72
|
-
LocalConfigurationManager
|
73
|
-
{
|
74
|
-
AllowModuleOverwrite = [bool]::Parse('#{allow_module_overwrite}')
|
75
|
-
CertificateID = #{certificate_id}
|
76
|
-
ConfigurationMode = '#{configuration_mode}'
|
77
|
-
ConfigurationModeFrequencyMins = #{configuration_mode_frequency_mins}
|
78
|
-
RebootNodeIfNeeded = [bool]::Parse('#{reboot_if_needed}')
|
79
|
-
RefreshFrequencyMins = #{refresh_frequency_mins}
|
80
|
-
RefreshMode = '#{refresh_mode}'
|
81
|
-
}
|
82
|
-
}
|
83
|
-
LCMSETUP
|
84
|
-
end
|
85
|
-
end
|
86
|
-
end
|
87
|
-
end
|
88
|
-
end
|
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 Apache 2 License.
|
8
|
+
# See LICENSE for more details
|
9
|
+
|
10
|
+
require "kitchen/provisioner/dsc_lcm/lcm_v4"
|
11
|
+
require "kitchen/provisioner/dsc_lcm/lcm_v5"
|
12
|
+
|
13
|
+
module Kitchen
|
14
|
+
module Provisioner
|
15
|
+
module DscLcm
|
16
|
+
class LcmBase
|
17
|
+
|
18
|
+
|
19
|
+
|
20
|
+
def lcm_properties
|
21
|
+
{
|
22
|
+
:allow_module_overwrite => false,
|
23
|
+
:certificate_id => nil,
|
24
|
+
:configuration_mode => "ApplyAndAutoCorrect",
|
25
|
+
:configuration_mode_frequency_mins => 30,
|
26
|
+
:reboot_if_needed => false,
|
27
|
+
:refresh_mode => "PUSH",
|
28
|
+
:refresh_frequency_mins => 15
|
29
|
+
}
|
30
|
+
end
|
31
|
+
|
32
|
+
def initialize(config = {})
|
33
|
+
@certificate_id = nil
|
34
|
+
lcm_properties.each do |setting, value|
|
35
|
+
send(setting, value)
|
36
|
+
end
|
37
|
+
|
38
|
+
config.each do |setting, value|
|
39
|
+
send(setting, value)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def method_missing(name, *args)
|
44
|
+
return super unless lcm_properties.keys.include?(name)
|
45
|
+
if args.length == 1
|
46
|
+
instance_variable_set("@#{name}", args.first)
|
47
|
+
else
|
48
|
+
instance_variable_get("@#{name}")
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def certificate_id(value = nil)
|
53
|
+
if value.nil?
|
54
|
+
@certificate_id.nil? ? "$null" : "'#{@certificate_id}'"
|
55
|
+
else
|
56
|
+
@certificate_id = value
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def lcm_config
|
61
|
+
hash = {}
|
62
|
+
lcm_properties.keys.each do |key|
|
63
|
+
hash[key] = send(key)
|
64
|
+
end
|
65
|
+
hash
|
66
|
+
end
|
67
|
+
|
68
|
+
def lcm_configuration_script
|
69
|
+
<<-LCMSETUP
|
70
|
+
configuration SetupLCM
|
71
|
+
{
|
72
|
+
LocalConfigurationManager
|
73
|
+
{
|
74
|
+
AllowModuleOverwrite = [bool]::Parse('#{allow_module_overwrite}')
|
75
|
+
CertificateID = #{certificate_id}
|
76
|
+
ConfigurationMode = '#{configuration_mode}'
|
77
|
+
ConfigurationModeFrequencyMins = #{configuration_mode_frequency_mins}
|
78
|
+
RebootNodeIfNeeded = [bool]::Parse('#{reboot_if_needed}')
|
79
|
+
RefreshFrequencyMins = #{refresh_frequency_mins}
|
80
|
+
RefreshMode = '#{refresh_mode}'
|
81
|
+
}
|
82
|
+
}
|
83
|
+
LCMSETUP
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
@@ -1,53 +1,53 @@
|
|
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 Apache 2 License.
|
8
|
-
# See LICENSE for more details
|
9
|
-
|
10
|
-
require "kitchen/provisioner/dsc_lcm/lcm_base"
|
11
|
-
|
12
|
-
module Kitchen
|
13
|
-
module Provisioner
|
14
|
-
module DscLcm
|
15
|
-
class LcmV4 < LcmBase
|
16
|
-
|
17
|
-
def lcm_properties
|
18
|
-
{
|
19
|
-
:action_after_reboot => "StopConfiguration",
|
20
|
-
:allow_module_overwrite => false,
|
21
|
-
:certificate_id => nil,
|
22
|
-
:configuration_mode => "ApplyAndAutoCorrect",
|
23
|
-
:configuration_mode_frequency_mins => 30,
|
24
|
-
:debug_mode => "All",
|
25
|
-
:reboot_if_needed => false,
|
26
|
-
:refresh_mode => "PUSH",
|
27
|
-
:refresh_frequency_mins => 15
|
28
|
-
}
|
29
|
-
end
|
30
|
-
|
31
|
-
def lcm_configuration_script
|
32
|
-
<<-LCMSETUP
|
33
|
-
configuration SetupLCM
|
34
|
-
{
|
35
|
-
LocalConfigurationManager
|
36
|
-
{
|
37
|
-
ActionAfterReboot = '#{action_after_reboot}'
|
38
|
-
AllowModuleOverwrite = [bool]::Parse('#{allow_module_overwrite}')
|
39
|
-
CertificateID = #{certificate_id}
|
40
|
-
ConfigurationMode = '#{configuration_mode}'
|
41
|
-
ConfigurationModeFrequencyMins = #{configuration_mode_frequency_mins}
|
42
|
-
DebugMode = '#{debug_mode}'
|
43
|
-
RebootNodeIfNeeded = [bool]::Parse('#{reboot_if_needed}')
|
44
|
-
RefreshFrequencyMins = #{refresh_frequency_mins}
|
45
|
-
RefreshMode = '#{refresh_mode}'
|
46
|
-
}
|
47
|
-
}
|
48
|
-
LCMSETUP
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
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 Apache 2 License.
|
8
|
+
# See LICENSE for more details
|
9
|
+
|
10
|
+
require "kitchen/provisioner/dsc_lcm/lcm_base"
|
11
|
+
|
12
|
+
module Kitchen
|
13
|
+
module Provisioner
|
14
|
+
module DscLcm
|
15
|
+
class LcmV4 < LcmBase
|
16
|
+
|
17
|
+
def lcm_properties
|
18
|
+
{
|
19
|
+
:action_after_reboot => "StopConfiguration",
|
20
|
+
:allow_module_overwrite => false,
|
21
|
+
:certificate_id => nil,
|
22
|
+
:configuration_mode => "ApplyAndAutoCorrect",
|
23
|
+
:configuration_mode_frequency_mins => 30,
|
24
|
+
:debug_mode => "All",
|
25
|
+
:reboot_if_needed => false,
|
26
|
+
:refresh_mode => "PUSH",
|
27
|
+
:refresh_frequency_mins => 15
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
def lcm_configuration_script
|
32
|
+
<<-LCMSETUP
|
33
|
+
configuration SetupLCM
|
34
|
+
{
|
35
|
+
LocalConfigurationManager
|
36
|
+
{
|
37
|
+
ActionAfterReboot = '#{action_after_reboot}'
|
38
|
+
AllowModuleOverwrite = [bool]::Parse('#{allow_module_overwrite}')
|
39
|
+
CertificateID = #{certificate_id}
|
40
|
+
ConfigurationMode = '#{configuration_mode}'
|
41
|
+
ConfigurationModeFrequencyMins = #{configuration_mode_frequency_mins}
|
42
|
+
DebugMode = '#{debug_mode}'
|
43
|
+
RebootNodeIfNeeded = [bool]::Parse('#{reboot_if_needed}')
|
44
|
+
RefreshFrequencyMins = #{refresh_frequency_mins}
|
45
|
+
RefreshMode = '#{refresh_mode}'
|
46
|
+
}
|
47
|
+
}
|
48
|
+
LCMSETUP
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -1,54 +1,54 @@
|
|
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 Apache 2 License.
|
8
|
-
# See LICENSE for more details
|
9
|
-
|
10
|
-
require "kitchen/provisioner/dsc_lcm/lcm_base"
|
11
|
-
|
12
|
-
module Kitchen
|
13
|
-
module Provisioner
|
14
|
-
module DscLcm
|
15
|
-
class LcmV5 < LcmBase
|
16
|
-
|
17
|
-
def lcm_properties
|
18
|
-
{
|
19
|
-
:action_after_reboot => "StopConfiguration",
|
20
|
-
:allow_module_overwrite => false,
|
21
|
-
:certificate_id => nil,
|
22
|
-
:configuration_mode => "ApplyAndAutoCorrect",
|
23
|
-
:configuration_mode_frequency_mins => 15,
|
24
|
-
:debug_mode => "All",
|
25
|
-
:reboot_if_needed => false,
|
26
|
-
:refresh_mode => "PUSH",
|
27
|
-
:refresh_frequency_mins => 30
|
28
|
-
}
|
29
|
-
end
|
30
|
-
|
31
|
-
def lcm_configuration_script
|
32
|
-
<<-LCMSETUP
|
33
|
-
[DSCLocalConfigurationManager()]
|
34
|
-
configuration SetupLCM
|
35
|
-
{
|
36
|
-
Settings
|
37
|
-
{
|
38
|
-
ActionAfterReboot = '#{action_after_reboot}'
|
39
|
-
AllowModuleOverwrite = [bool]::Parse('#{allow_module_overwrite}')
|
40
|
-
CertificateID = #{certificate_id}
|
41
|
-
ConfigurationMode = '#{configuration_mode}'
|
42
|
-
ConfigurationModeFrequencyMins = #{configuration_mode_frequency_mins}
|
43
|
-
DebugMode = '#{debug_mode}'
|
44
|
-
RebootNodeIfNeeded = [bool]::Parse('#{reboot_if_needed}')
|
45
|
-
RefreshFrequencyMins = #{refresh_frequency_mins}
|
46
|
-
RefreshMode = '#{refresh_mode}'
|
47
|
-
}
|
48
|
-
}
|
49
|
-
LCMSETUP
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
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 Apache 2 License.
|
8
|
+
# See LICENSE for more details
|
9
|
+
|
10
|
+
require "kitchen/provisioner/dsc_lcm/lcm_base"
|
11
|
+
|
12
|
+
module Kitchen
|
13
|
+
module Provisioner
|
14
|
+
module DscLcm
|
15
|
+
class LcmV5 < LcmBase
|
16
|
+
|
17
|
+
def lcm_properties
|
18
|
+
{
|
19
|
+
:action_after_reboot => "StopConfiguration",
|
20
|
+
:allow_module_overwrite => false,
|
21
|
+
:certificate_id => nil,
|
22
|
+
:configuration_mode => "ApplyAndAutoCorrect",
|
23
|
+
:configuration_mode_frequency_mins => 15,
|
24
|
+
:debug_mode => "All",
|
25
|
+
:reboot_if_needed => false,
|
26
|
+
:refresh_mode => "PUSH",
|
27
|
+
:refresh_frequency_mins => 30
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
def lcm_configuration_script
|
32
|
+
<<-LCMSETUP
|
33
|
+
[DSCLocalConfigurationManager()]
|
34
|
+
configuration SetupLCM
|
35
|
+
{
|
36
|
+
Settings
|
37
|
+
{
|
38
|
+
ActionAfterReboot = '#{action_after_reboot}'
|
39
|
+
AllowModuleOverwrite = [bool]::Parse('#{allow_module_overwrite}')
|
40
|
+
CertificateID = #{certificate_id}
|
41
|
+
ConfigurationMode = '#{configuration_mode}'
|
42
|
+
ConfigurationModeFrequencyMins = #{configuration_mode_frequency_mins}
|
43
|
+
DebugMode = '#{debug_mode}'
|
44
|
+
RebootNodeIfNeeded = [bool]::Parse('#{reboot_if_needed}')
|
45
|
+
RefreshFrequencyMins = #{refresh_frequency_mins}
|
46
|
+
RefreshMode = '#{refresh_mode}'
|
47
|
+
}
|
48
|
+
}
|
49
|
+
LCMSETUP
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
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.10.
|
4
|
+
version: 0.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Murawski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -248,9 +248,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
248
248
|
version: '0'
|
249
249
|
requirements: []
|
250
250
|
rubyforge_project: "[none]"
|
251
|
-
rubygems_version: 2.6.
|
251
|
+
rubygems_version: 2.6.11
|
252
252
|
signing_key:
|
253
253
|
specification_version: 4
|
254
254
|
summary: PowerShell DSC provisioner for test-kitchen
|
255
255
|
test_files: []
|
256
|
-
has_rdoc:
|