dsc_lcm_configuration 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/dsc_lcm_configuration.gemspec +2 -0
- data/lib/dsc_lcm_configuration/lcm_base.rb +90 -90
- data/lib/dsc_lcm_configuration/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5292937298317004006a908f4e734bf206c88859
|
4
|
+
data.tar.gz: 52c4b9963bfe42bf878ad4a3038e1d6af0860ef6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cca7bb9e8c079856222a3887cb85f5cd6794c74ce52afffc3a928ba01eef0657e7b8de52d29aeac626cbc966db6a3bfef2e5e43ea1d704fd12d50ef2c14b93b
|
7
|
+
data.tar.gz: 4f92ab184fa5ce243c81352d35c21dd2a14b6699608f4217a6e1ce0512ef80e22ff22bab2914463f87119afac46c4e25b92405e0b52e0a19ab7bf669806eec39
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v0.2.0](https://github.com/smurawski/dsc_lcm_configuration/tree/v0.2.0) (2016-06-23)
|
4
|
+
[Full Changelog](https://github.com/smurawski/dsc_lcm_configuration/compare/v0.1.0...v0.2.0)
|
5
|
+
|
6
|
+
**Merged pull requests:**
|
7
|
+
|
8
|
+
- Only Update Existing Config Settings [\#2](https://github.com/smurawski/dsc_lcm_configuration/pull/2) ([smurawski](https://github.com/smurawski))
|
9
|
+
|
3
10
|
## [v0.1.0](https://github.com/smurawski/dsc_lcm_configuration/tree/v0.1.0) (2016-06-23)
|
4
11
|
**Merged pull requests:**
|
5
12
|
|
@@ -8,6 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = DscLcmConfiguration::VERSION
|
9
9
|
spec.authors = ["Steven Murawski"]
|
10
10
|
spec.email = ["steven.murawski@gmail.com"]
|
11
|
+
spec.license = "Apache 2"
|
12
|
+
|
11
13
|
|
12
14
|
spec.summary = %q{Creates proper LCM configurations for Windows PowerShell DSC.}
|
13
15
|
spec.description = %q{Creates proper LCM configurations for Windows PowerShell DSC.}
|
@@ -1,90 +1,90 @@
|
|
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
|
-
module DscLcmConfiguration
|
11
|
-
class LcmBase
|
12
|
-
|
13
|
-
def self.lcm_factory(version = "wmf4", options)
|
14
|
-
case version.to_s.downcase
|
15
|
-
when "4", "wmf4_with_update"
|
16
|
-
LcmV4.new(options)
|
17
|
-
when "5", "wmf5"
|
18
|
-
LcmV5.new(options)
|
19
|
-
else
|
20
|
-
LcmBase.new(options)
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def lcm_properties
|
25
|
-
{
|
26
|
-
:allow_module_overwrite => false,
|
27
|
-
:certificate_id => nil,
|
28
|
-
:configuration_mode => "ApplyAndAutoCorrect",
|
29
|
-
:configuration_mode_frequency_mins => 30,
|
30
|
-
:reboot_if_needed => false,
|
31
|
-
:refresh_mode => "PUSH",
|
32
|
-
:refresh_frequency_mins => 15,
|
33
|
-
}
|
34
|
-
end
|
35
|
-
|
36
|
-
def initialize(config = {})
|
37
|
-
@certificate_id = nil
|
38
|
-
lcm_properties.each do |setting, value|
|
39
|
-
send(setting, value)
|
40
|
-
end
|
41
|
-
|
42
|
-
config.each do |setting, value|
|
43
|
-
send(setting, value)
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def method_missing(name, *args)
|
48
|
-
return super unless lcm_properties.keys.include?(name)
|
49
|
-
if args.length == 1
|
50
|
-
instance_variable_set("@#{name}", args.first)
|
51
|
-
else
|
52
|
-
instance_variable_get("@#{name}")
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
def certificate_id(value = nil)
|
57
|
-
if value.nil?
|
58
|
-
@certificate_id.nil? ? "$null" : "'#{@certificate_id}'"
|
59
|
-
else
|
60
|
-
@certificate_id = value
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
def lcm_config
|
65
|
-
hash = {}
|
66
|
-
lcm_properties.keys.each do |key|
|
67
|
-
hash[key] = send(key)
|
68
|
-
end
|
69
|
-
hash
|
70
|
-
end
|
71
|
-
|
72
|
-
def lcm_configuration_script
|
73
|
-
<<-LCMSETUP
|
74
|
-
configuration SetupLCM
|
75
|
-
{
|
76
|
-
LocalConfigurationManager
|
77
|
-
{
|
78
|
-
AllowModuleOverwrite = [bool]::Parse('#{allow_module_overwrite}')
|
79
|
-
CertificateID = #{certificate_id}
|
80
|
-
ConfigurationMode = '#{configuration_mode}'
|
81
|
-
ConfigurationModeFrequencyMins = #{configuration_mode_frequency_mins}
|
82
|
-
RebootNodeIfNeeded = [bool]::Parse('#{reboot_if_needed}')
|
83
|
-
RefreshFrequencyMins = #{refresh_frequency_mins}
|
84
|
-
RefreshMode = '#{refresh_mode}'
|
85
|
-
}
|
86
|
-
}
|
87
|
-
LCMSETUP
|
88
|
-
end
|
89
|
-
end
|
90
|
-
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
|
+
module DscLcmConfiguration
|
11
|
+
class LcmBase
|
12
|
+
|
13
|
+
def self.lcm_factory(version = "wmf4", options)
|
14
|
+
case version.to_s.downcase
|
15
|
+
when "4", "wmf4_with_update"
|
16
|
+
LcmV4.new(options)
|
17
|
+
when "5", "wmf5"
|
18
|
+
LcmV5.new(options)
|
19
|
+
else
|
20
|
+
LcmBase.new(options)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def lcm_properties
|
25
|
+
@lcm_properties ||= {
|
26
|
+
:allow_module_overwrite => false,
|
27
|
+
:certificate_id => nil,
|
28
|
+
:configuration_mode => "ApplyAndAutoCorrect",
|
29
|
+
:configuration_mode_frequency_mins => 30,
|
30
|
+
:reboot_if_needed => false,
|
31
|
+
:refresh_mode => "PUSH",
|
32
|
+
:refresh_frequency_mins => 15,
|
33
|
+
}
|
34
|
+
end
|
35
|
+
|
36
|
+
def initialize(config = {})
|
37
|
+
@certificate_id = nil
|
38
|
+
lcm_properties.each do |setting, value|
|
39
|
+
send(setting, value)
|
40
|
+
end
|
41
|
+
|
42
|
+
config.each do |setting, value|
|
43
|
+
send(setting, value) if lcm_properties.keys.include? setting
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def method_missing(name, *args)
|
48
|
+
return super unless lcm_properties.keys.include?(name)
|
49
|
+
if args.length == 1
|
50
|
+
instance_variable_set("@#{name}", args.first)
|
51
|
+
else
|
52
|
+
instance_variable_get("@#{name}")
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
def certificate_id(value = nil)
|
57
|
+
if value.nil?
|
58
|
+
@certificate_id.nil? ? "$null" : "'#{@certificate_id}'"
|
59
|
+
else
|
60
|
+
@certificate_id = value
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
64
|
+
def lcm_config
|
65
|
+
hash = {}
|
66
|
+
lcm_properties.keys.each do |key|
|
67
|
+
hash[key] = send(key)
|
68
|
+
end
|
69
|
+
hash
|
70
|
+
end
|
71
|
+
|
72
|
+
def lcm_configuration_script
|
73
|
+
<<-LCMSETUP
|
74
|
+
configuration SetupLCM
|
75
|
+
{
|
76
|
+
LocalConfigurationManager
|
77
|
+
{
|
78
|
+
AllowModuleOverwrite = [bool]::Parse('#{allow_module_overwrite}')
|
79
|
+
CertificateID = #{certificate_id}
|
80
|
+
ConfigurationMode = '#{configuration_mode}'
|
81
|
+
ConfigurationModeFrequencyMins = #{configuration_mode_frequency_mins}
|
82
|
+
RebootNodeIfNeeded = [bool]::Parse('#{reboot_if_needed}')
|
83
|
+
RefreshFrequencyMins = #{refresh_frequency_mins}
|
84
|
+
RefreshMode = '#{refresh_mode}'
|
85
|
+
}
|
86
|
+
}
|
87
|
+
LCMSETUP
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dsc_lcm_configuration
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Murawski
|
@@ -144,7 +144,8 @@ files:
|
|
144
144
|
- lib/dsc_lcm_configuration/lcm_v5.rb
|
145
145
|
- lib/dsc_lcm_configuration/version.rb
|
146
146
|
homepage: https://github.com/smurawski/dsc_lcm_configuration
|
147
|
-
licenses:
|
147
|
+
licenses:
|
148
|
+
- Apache 2
|
148
149
|
metadata: {}
|
149
150
|
post_install_message:
|
150
151
|
rdoc_options: []
|