puppet 6.10.1-universal-darwin → 6.11.0-universal-darwin
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +4 -4
- data/Gemfile.lock +20 -12
- data/ext/project_data.yaml +3 -2
- data/ext/regexp_nodes/regexp_nodes.rb +4 -4
- data/ext/windows/service/daemon.rb +33 -8
- data/install.rb +6 -6
- data/lib/puppet.rb +8 -0
- data/lib/puppet/application.rb +1 -1
- data/lib/puppet/application/agent.rb +3 -0
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/application/describe.rb +3 -9
- data/lib/puppet/application/device.rb +3 -0
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/lookup.rb +1 -1
- data/lib/puppet/application/script.rb +2 -2
- data/lib/puppet/application/ssl.rb +25 -21
- data/lib/puppet/configurer.rb +42 -0
- data/lib/puppet/configurer/downloader.rb +2 -6
- data/lib/puppet/context/trusted_information.rb +42 -4
- data/lib/puppet/defaults.rb +19 -4
- data/lib/puppet/face/module/list.rb +5 -5
- data/lib/puppet/face/module/search.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/module/upgrade.rb +1 -1
- data/lib/puppet/file_serving/http_metadata.rb +1 -1
- data/lib/puppet/file_system.rb +0 -8
- data/lib/puppet/file_system/memory_file.rb +1 -1
- data/lib/puppet/file_system/posix.rb +3 -2
- data/lib/puppet/forge.rb +3 -3
- data/lib/puppet/functions.rb +1 -2
- data/lib/puppet/gettext/module_translations.rb +1 -1
- data/lib/puppet/graph/rb_tree_map.rb +2 -2
- data/lib/puppet/graph/simple_graph.rb +4 -3
- data/lib/puppet/http.rb +29 -0
- data/lib/puppet/http/client.rb +156 -0
- data/lib/puppet/http/errors.rb +30 -0
- data/lib/puppet/http/redirector.rb +48 -0
- data/lib/puppet/http/resolver.rb +5 -0
- data/lib/puppet/http/resolver/settings.rb +5 -0
- data/lib/puppet/http/resolver/srv.rb +13 -0
- data/lib/puppet/http/response.rb +34 -0
- data/lib/puppet/http/retry_after_handler.rb +47 -0
- data/lib/puppet/http/service.rb +18 -0
- data/lib/puppet/http/service/ca.rb +49 -0
- data/lib/puppet/http/session.rb +55 -0
- data/lib/puppet/indirector/file_bucket_file/file.rb +1 -1
- data/lib/puppet/indirector/hiera.rb +2 -0
- data/lib/puppet/indirector/request.rb +1 -1
- data/lib/puppet/indirector/resource/ral.rb +1 -3
- data/lib/puppet/indirector/resource/validator.rb +1 -1
- data/lib/puppet/interface.rb +2 -1
- data/lib/puppet/interface/documentation.rb +1 -1
- data/lib/puppet/loaders.rb +0 -1
- data/lib/puppet/metatype/manager.rb +1 -1
- data/lib/puppet/module.rb +1 -1
- data/lib/puppet/module/task.rb +20 -4
- data/lib/puppet/module_tool/applications/installer.rb +1 -1
- data/lib/puppet/module_tool/applications/uninstaller.rb +3 -3
- data/lib/puppet/module_tool/metadata.rb +1 -1
- data/lib/puppet/module_tool/shared_behaviors.rb +4 -4
- data/lib/puppet/module_tool/tar/mini.rb +1 -1
- data/lib/puppet/network/http.rb +2 -6
- data/lib/puppet/network/http/api/indirected_routes.rb +12 -11
- data/lib/puppet/network/http/connection.rb +10 -12
- data/lib/puppet/network/http/pool.rb +2 -0
- data/lib/puppet/network/http/site.rb +5 -1
- data/lib/puppet/network/resolver.rb +4 -4
- data/lib/puppet/node/environment.rb +4 -2
- data/lib/puppet/pal/pal_impl.rb +2 -2
- data/lib/puppet/parser/ast.rb +1 -1
- data/lib/puppet/parser/ast/resourceparam.rb +1 -1
- data/lib/puppet/parser/functions.rb +1 -1
- data/lib/puppet/parser/scope.rb +8 -7
- data/lib/puppet/pops/evaluator/collectors/catalog_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/collectors/exported_collector.rb +1 -1
- data/lib/puppet/pops/evaluator/external_syntax_support.rb +3 -2
- data/lib/puppet/pops/evaluator/runtime3_support.rb +4 -7
- data/lib/puppet/pops/loader/module_loaders.rb +1 -1
- data/lib/puppet/pops/loader/task_instantiator.rb +4 -0
- data/lib/puppet/pops/loaders.rb +1 -1
- data/lib/puppet/pops/lookup/hiera_config.rb +1 -0
- data/lib/puppet/pops/lookup/sub_lookup.rb +1 -1
- data/lib/puppet/pops/merge_strategy.rb +22 -18
- data/lib/puppet/pops/parser/heredoc_support.rb +1 -1
- data/lib/puppet/pops/parser/interpolation_support.rb +4 -4
- data/lib/puppet/pops/parser/locator.rb +1 -1
- data/lib/puppet/pops/parser/pn_parser.rb +17 -16
- data/lib/puppet/pops/puppet_stack.rb +52 -48
- data/lib/puppet/pops/types/p_sensitive_type.rb +1 -1
- data/lib/puppet/pops/types/p_uri_type.rb +1 -1
- data/lib/puppet/pops/types/string_converter.rb +10 -10
- data/lib/puppet/pops/types/types.rb +3 -3
- data/lib/puppet/property.rb +1 -1
- data/lib/puppet/property/ensure.rb +1 -1
- data/lib/puppet/provider/exec.rb +6 -2
- data/lib/puppet/provider/nameservice/directoryservice.rb +1 -1
- data/lib/puppet/provider/nameservice/pw.rb +2 -2
- data/lib/puppet/provider/package/apt.rb +5 -1
- data/lib/puppet/provider/package/dnfmodule.rb +87 -0
- data/lib/puppet/provider/package/dpkg.rb +31 -17
- data/lib/puppet/provider/package/openbsd.rb +1 -1
- data/lib/puppet/provider/package/pip.rb +34 -9
- data/lib/puppet/provider/package/portage.rb +1 -1
- data/lib/puppet/provider/package/rpm.rb +5 -5
- data/lib/puppet/provider/package/windows/package.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +1 -1
- data/lib/puppet/provider/parsedfile.rb +1 -1
- data/lib/puppet/provider/service/daemontools.rb +9 -9
- data/lib/puppet/provider/service/openbsd.rb +1 -1
- data/lib/puppet/provider/service/rcng.rb +2 -2
- data/lib/puppet/provider/service/runit.rb +2 -8
- data/lib/puppet/provider/service/systemd.rb +10 -10
- data/lib/puppet/provider/user/directoryservice.rb +1 -1
- data/lib/puppet/provider/user/user_role_add.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +22 -13
- data/lib/puppet/provider/user/windows_adsi.rb +4 -5
- data/lib/puppet/reference/indirection.rb +2 -2
- data/lib/puppet/reference/metaparameter.rb +1 -3
- data/lib/puppet/reference/providers.rb +1 -1
- data/lib/puppet/reference/type.rb +3 -9
- data/lib/puppet/reports.rb +1 -1
- data/lib/puppet/resource.rb +1 -1
- data/lib/puppet/resource/catalog.rb +1 -1
- data/lib/puppet/rest/errors.rb +1 -0
- data/lib/puppet/rest/response.rb +1 -0
- data/lib/puppet/rest/route.rb +1 -0
- data/lib/puppet/rest/routes.rb +3 -0
- data/lib/puppet/runtime.rb +25 -0
- data/lib/puppet/settings.rb +3 -3
- data/lib/puppet/settings/environment_conf.rb +1 -0
- data/lib/puppet/ssl/host.rb +1 -1
- data/lib/puppet/ssl/oids.rb +1 -1
- data/lib/puppet/ssl/state_machine.rb +23 -15
- data/lib/puppet/test/test_helper.rb +1 -1
- data/lib/puppet/transaction/report.rb +1 -1
- data/lib/puppet/trusted_external.rb +13 -0
- data/lib/puppet/type.rb +1 -3
- data/lib/puppet/type/exec.rb +7 -3
- data/lib/puppet/type/file.rb +1 -2
- data/lib/puppet/type/file/source.rb +2 -2
- data/lib/puppet/type/package.rb +10 -3
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/service.rb +1 -1
- data/lib/puppet/util.rb +2 -2
- data/lib/puppet/util/command_line/trollop.rb +1 -1
- data/lib/puppet/util/http_proxy.rb +2 -10
- data/lib/puppet/util/log.rb +2 -2
- data/lib/puppet/util/log/destinations.rb +2 -2
- data/lib/puppet/util/logging.rb +2 -2
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/platform.rb +15 -4
- data/lib/puppet/util/provider_features.rb +2 -4
- data/lib/puppet/util/rdoc.rb +1 -1
- data/lib/puppet/util/reference.rb +1 -1
- data/lib/puppet/util/resource_template.rb +1 -1
- data/lib/puppet/util/selinux.rb +3 -1
- data/lib/puppet/util/windows/registry.rb +7 -5
- data/lib/puppet/vendor.rb +1 -1
- data/lib/puppet/vendor/require_vendored.rb +0 -1
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet/x509/cert_provider.rb +4 -1
- data/locales/puppet.pot +279 -203
- data/man/man5/puppet.conf.5 +30 -8
- data/man/man8/puppet-agent.8 +4 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +1 -1
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-key.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-man.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-ssl.8 +1 -1
- data/man/man8/puppet-status.8 +1 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/fixtures/unit/provider/package/dnfmodule/dnf-module-list-installed.txt +11 -0
- data/spec/integration/configurer_spec.rb +52 -0
- data/spec/lib/puppet/certificate_factory.rb +2 -2
- data/spec/spec_helper.rb +24 -0
- data/spec/unit/application/device_spec.rb +6 -0
- data/spec/unit/application/ssl_spec.rb +4 -7
- data/spec/unit/configurer_spec.rb +1 -0
- data/spec/unit/context/trusted_information_spec.rb +41 -2
- data/spec/unit/http/client_spec.rb +440 -0
- data/spec/unit/http/resolver_spec.rb +45 -0
- data/spec/unit/http/service/ca_spec.rb +106 -0
- data/spec/unit/http/service_spec.rb +32 -0
- data/spec/unit/http/session_spec.rb +102 -0
- data/spec/unit/indirector/resource/ral_spec.rb +4 -4
- data/spec/unit/network/http/connection_spec.rb +119 -145
- data/spec/unit/network/http/site_spec.rb +7 -0
- data/spec/unit/parser/scope_spec.rb +10 -0
- data/spec/unit/pops/loaders/loaders_spec.rb +13 -2
- data/spec/unit/pops/loaders/module_loaders_spec.rb +37 -0
- data/spec/unit/provider/exec_spec.rb +209 -0
- data/spec/unit/provider/package/dnfmodule_spec.rb +186 -0
- data/spec/unit/provider/package/dpkg_spec.rb +238 -78
- data/spec/unit/provider/package/pip_spec.rb +51 -6
- data/spec/unit/provider/service/daemontools_spec.rb +24 -0
- data/spec/unit/provider/service/runit_spec.rb +24 -0
- data/spec/unit/provider/service/systemd_spec.rb +25 -25
- data/spec/unit/provider/user/useradd_spec.rb +46 -0
- data/spec/unit/ssl/host_spec.rb +0 -5
- data/spec/unit/ssl/state_machine_spec.rb +16 -10
- data/spec/unit/type/exec_spec.rb +6 -12
- data/spec/unit/type/file_spec.rb +9 -4
- data/spec/unit/type/package_spec.rb +5 -0
- data/spec/unit/util/execution_spec.rb +16 -0
- data/spec/unit/util/http_proxy_spec.rb +79 -27
- data/spec/unit/util/log/destinations_spec.rb +7 -3
- metadata +45 -22
- data/lib/puppet/pops/loader/null_loader.rb +0 -60
- data/lib/puppet/vendor/deep_merge/CHANGELOG +0 -45
- data/lib/puppet/vendor/deep_merge/Gemfile +0 -3
- data/lib/puppet/vendor/deep_merge/LICENSE +0 -21
- data/lib/puppet/vendor/deep_merge/PUPPET_README.md +0 -6
- data/lib/puppet/vendor/deep_merge/README.md +0 -113
- data/lib/puppet/vendor/deep_merge/Rakefile +0 -19
- data/lib/puppet/vendor/deep_merge/deep_merge.gemspec +0 -35
- data/lib/puppet/vendor/deep_merge/lib/deep_merge.rb +0 -2
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/core.rb +0 -210
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/deep_merge_hash.rb +0 -28
- data/lib/puppet/vendor/deep_merge/lib/deep_merge/rails_compat.rb +0 -27
- data/lib/puppet/vendor/deep_merge/test/test_deep_merge.rb +0 -608
- data/lib/puppet/vendor/load_deep_merge.rb +0 -1
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_get/should_yield_to_the_block.yml +0 -24
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_head/should_yield_to_the_block.yml +0 -24
- data/spec/fixtures/vcr/cassettes/Puppet_Network_HTTP_Connection/when_handling_requests/_request_post/should_yield_to_the_block.yml +0 -24
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a23b65cc27418b287db256e57861f003ed33f91965c2cdc24bee55865ef5edee
|
4
|
+
data.tar.gz: b3e19b4ac95288d7b334a7fb68d1518cf126f9293e22a2716b71cd2d93d68473
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57cc0e00e92590483bf5ea290f1689f2f6533b9dc5a2337db31fcaaec9cdaa67650e604a8fc4f18b7d52ac4bbf4e7b54831ba9e2cfff5b25076249c9df7287fd
|
7
|
+
data.tar.gz: e448bb7abe4aa6c98e09c3e39473f1380c10aeb9859fc773692b5a83c6155963cec73bd149abfeb9b9e21aa1b64faa85a9477c720e68bf5d2126014044e80acf
|
data/Gemfile
CHANGED
@@ -20,7 +20,7 @@ gem "puppet-resource_api", *location_for(ENV['RESOURCE_API_LOCATION'] || ["~> 1.
|
|
20
20
|
|
21
21
|
group(:features) do
|
22
22
|
gem 'diff-lcs', '~> 1.3', require: false
|
23
|
-
gem 'hiera-eyaml',
|
23
|
+
gem 'hiera-eyaml', *location_for(ENV['HIERA_EYAML_LOCATION'])
|
24
24
|
gem 'hocon', '~> 1.0', require: false
|
25
25
|
# requires native libshadow headers/libs
|
26
26
|
#gem 'ruby-shadow', '~> 2.5', require: false, platforms: [:ruby]
|
@@ -39,8 +39,8 @@ group(:test) do
|
|
39
39
|
gem "rake", *location_for(ENV['RAKE_LOCATION'] || '~> 12.2')
|
40
40
|
gem "rspec", "~> 3.1", require: false
|
41
41
|
gem "rspec-its", "~> 1.1", require: false
|
42
|
-
gem 'vcr', '~>
|
43
|
-
gem 'webmock', '~>
|
42
|
+
gem 'vcr', '~> 5.0', require: false
|
43
|
+
gem 'webmock', '~> 3.0', require: false
|
44
44
|
gem 'yard', require: false
|
45
45
|
|
46
46
|
gem 'rubocop', '~> 0.49', require: false, platforms: [:ruby]
|
@@ -65,7 +65,7 @@ group(:documentation) do
|
|
65
65
|
gem 'ronn', '~> 0.7.3', require: false, platforms: [:ruby]
|
66
66
|
end
|
67
67
|
|
68
|
-
if File.
|
68
|
+
if File.exist? "#{__FILE__}.local"
|
69
69
|
eval(File.read("#{__FILE__}.local"), binding)
|
70
70
|
end
|
71
71
|
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
puppet (6.
|
4
|
+
puppet (6.11.0)
|
5
5
|
CFPropertyList (~> 2.2)
|
6
6
|
concurrent-ruby (~> 1.0)
|
7
|
+
deep_merge (~> 1.0)
|
7
8
|
facter (>= 2.4.0, < 4)
|
8
9
|
fast_gettext (~> 1.1)
|
9
10
|
hiera (>= 3.2.1, < 4)
|
@@ -24,7 +25,10 @@ GEM
|
|
24
25
|
concurrent-ruby (1.1.5)
|
25
26
|
crack (0.4.3)
|
26
27
|
safe_yaml (~> 1.0.0)
|
28
|
+
csv (3.1.2)
|
29
|
+
deep_merge (1.2.1)
|
27
30
|
diff-lcs (1.3)
|
31
|
+
docopt (0.6.1)
|
28
32
|
facter (2.5.6)
|
29
33
|
fast_gettext (1.1.2)
|
30
34
|
gettext (3.2.9)
|
@@ -35,12 +39,12 @@ GEM
|
|
35
39
|
gettext (>= 3.0.2)
|
36
40
|
locale
|
37
41
|
hashdiff (1.0.0)
|
38
|
-
hiera (3.
|
39
|
-
hiera-eyaml (3.
|
42
|
+
hiera (3.6.0)
|
43
|
+
hiera-eyaml (3.1.1)
|
40
44
|
highline (~> 1.6.19)
|
41
45
|
optimist
|
42
46
|
highline (1.6.21)
|
43
|
-
hocon (1.
|
47
|
+
hocon (1.3.0)
|
44
48
|
hpricot (0.8.6)
|
45
49
|
httpclient (2.8.3)
|
46
50
|
json-schema (2.8.1)
|
@@ -50,13 +54,14 @@ GEM
|
|
50
54
|
method_source (0.9.2)
|
51
55
|
minitar (0.9)
|
52
56
|
msgpack (1.3.1)
|
53
|
-
multi_json (1.14.
|
57
|
+
multi_json (1.14.1)
|
54
58
|
mustache (1.1.0)
|
55
59
|
optimist (3.0.0)
|
56
|
-
packaging (0.99.
|
60
|
+
packaging (0.99.48)
|
57
61
|
artifactory (~> 2)
|
58
62
|
rake (>= 12.3)
|
59
|
-
|
63
|
+
release-metrics
|
64
|
+
parallel (1.19.0)
|
60
65
|
parser (2.6.5.0)
|
61
66
|
ast (~> 2.4.0)
|
62
67
|
powerpack (0.1.2)
|
@@ -74,6 +79,9 @@ GEM
|
|
74
79
|
rake (12.3.3)
|
75
80
|
rdiscount (2.2.0.1)
|
76
81
|
rdoc (6.2.0)
|
82
|
+
release-metrics (1.1.0)
|
83
|
+
csv
|
84
|
+
docopt
|
77
85
|
ronn (0.7.3)
|
78
86
|
hpricot (>= 0.8.2)
|
79
87
|
mustache (>= 0.7.0)
|
@@ -109,11 +117,11 @@ GEM
|
|
109
117
|
semantic_puppet (1.0.2)
|
110
118
|
text (1.3.1)
|
111
119
|
unicode-display_width (1.6.0)
|
112
|
-
vcr (
|
113
|
-
webmock (
|
120
|
+
vcr (5.0.0)
|
121
|
+
webmock (3.7.6)
|
114
122
|
addressable (>= 2.3.6)
|
115
123
|
crack (>= 0.3.2)
|
116
|
-
hashdiff
|
124
|
+
hashdiff (>= 0.4.0, < 2.0.0)
|
117
125
|
yard (0.9.20)
|
118
126
|
|
119
127
|
PLATFORMS
|
@@ -143,8 +151,8 @@ DEPENDENCIES
|
|
143
151
|
rubocop-i18n (~> 1.2.0)
|
144
152
|
ruby-prof (>= 0.16.0)
|
145
153
|
semantic_puppet (~> 1.0)
|
146
|
-
vcr (~>
|
147
|
-
webmock (~>
|
154
|
+
vcr (~> 5.0)
|
155
|
+
webmock (~> 3.0)
|
148
156
|
yard
|
149
157
|
|
150
158
|
BUNDLED WITH
|
data/ext/project_data.yaml
CHANGED
@@ -26,6 +26,7 @@ gem_runtime_dependencies:
|
|
26
26
|
httpclient: '~> 2.8'
|
27
27
|
puppet-resource_api: '~>1.5'
|
28
28
|
concurrent-ruby: '~> 1.0'
|
29
|
+
deep_merge: '~> 1.0'
|
29
30
|
gem_rdoc_options:
|
30
31
|
- --title
|
31
32
|
- "Puppet - Configuration Management"
|
@@ -38,7 +39,7 @@ gem_platform_dependencies:
|
|
38
39
|
CFPropertyList: '~> 2.2'
|
39
40
|
x86-mingw32:
|
40
41
|
gem_runtime_dependencies:
|
41
|
-
ffi: '
|
42
|
+
ffi: ['> 1.9.24', '< 2']
|
42
43
|
# win32-xxxx gems are pinned due to PUP-6445
|
43
44
|
win32-dir: '= 0.4.9'
|
44
45
|
win32-process: '= 0.7.5'
|
@@ -48,7 +49,7 @@ gem_platform_dependencies:
|
|
48
49
|
minitar: '~> 0.9'
|
49
50
|
x64-mingw32:
|
50
51
|
gem_runtime_dependencies:
|
51
|
-
ffi: '
|
52
|
+
ffi: ['> 1.9.24', '< 2']
|
52
53
|
# win32-xxxx gems are pinned due to PUP-6445
|
53
54
|
win32-dir: '= 0.4.9'
|
54
55
|
win32-process: '= 0.7.5'
|
@@ -159,7 +159,7 @@ class ExternalNode
|
|
159
159
|
log("list of patterns for #{filepath}: #{patternlist}")
|
160
160
|
|
161
161
|
if matchthis =~ Regexp.union(patternlist)
|
162
|
-
log("matched #{
|
162
|
+
log("matched #{$~} in #{matchthis}, returning true")
|
163
163
|
return true
|
164
164
|
|
165
165
|
else # hostname didn't match anything in patternlist
|
@@ -181,7 +181,7 @@ class ExternalNode
|
|
181
181
|
log("Attempting to match [#{@hostname}] in [#{filepath}]")
|
182
182
|
if matched_in_patternfile?(filepath,@hostname)
|
183
183
|
@classes << patternfile.to_s
|
184
|
-
log("Appended #{patternfile
|
184
|
+
log("Appended #{patternfile} to classes instance variable")
|
185
185
|
end
|
186
186
|
end
|
187
187
|
end
|
@@ -198,7 +198,7 @@ class ExternalNode
|
|
198
198
|
log("Attempting to match [#{@hostname}] in [#{filepath}]")
|
199
199
|
if matched_in_patternfile?(filepath,@hostname)
|
200
200
|
@environment = patternfile.to_s
|
201
|
-
log("Wrote #{patternfile
|
201
|
+
log("Wrote #{patternfile} to environment instance variable")
|
202
202
|
end
|
203
203
|
end
|
204
204
|
end
|
@@ -230,7 +230,7 @@ class ExternalNode
|
|
230
230
|
log("Attempting to match [#{@hostname}] in [#{secondlevel}]")
|
231
231
|
if matched_in_patternfile?(secondlevel, @hostname)
|
232
232
|
@parameters[ parametername.to_s ] = patternfile.to_s
|
233
|
-
log("Set @parameters[#{parametername
|
233
|
+
log("Set @parameters[#{parametername}] = #{patternfile}")
|
234
234
|
end
|
235
235
|
end
|
236
236
|
end
|
@@ -27,6 +27,9 @@ class WindowsDaemon < Win32::Daemon
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def service_main(*argsv)
|
30
|
+
base_dir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
31
|
+
load_env(base_dir)
|
32
|
+
|
30
33
|
argsv = (argsv << ARGV).flatten.compact
|
31
34
|
args = argsv.join(' ')
|
32
35
|
@loglevel = LEVELS.index(argsv.index('--debug') ? :debug : :notice)
|
@@ -37,7 +40,6 @@ class WindowsDaemon < Win32::Daemon
|
|
37
40
|
FileUtils.mkdir_p(File.dirname(LOG_FILE))
|
38
41
|
args = args.gsub("--logtofile","")
|
39
42
|
end
|
40
|
-
basedir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
41
43
|
|
42
44
|
# The puppet installer registers a 'Puppet' event source. For the moment events will be logged with this key, but
|
43
45
|
# it may be a good idea to split the Service and Puppet events later so it's easier to read in the windows Event Log.
|
@@ -54,25 +56,29 @@ class WindowsDaemon < Win32::Daemon
|
|
54
56
|
# )
|
55
57
|
# end
|
56
58
|
|
57
|
-
puppet = File.join(
|
58
|
-
|
59
|
+
puppet = File.join(base_dir, 'puppet', 'bin', 'puppet')
|
60
|
+
ruby = File.join(base_dir, 'puppet', 'bin', 'ruby.exe')
|
61
|
+
ruby_puppet_cmd = "\"#{ruby}\" \"#{puppet}\""
|
62
|
+
|
63
|
+
unless File.exist?(puppet)
|
59
64
|
log_err("File not found: '#{puppet}'")
|
60
65
|
return
|
61
66
|
end
|
62
67
|
log_debug("Using '#{puppet}'")
|
63
68
|
|
64
69
|
cmdline_debug = argsv.index('--debug') ? :debug : nil
|
65
|
-
@loglevel = parse_log_level(
|
70
|
+
@loglevel = parse_log_level(ruby_puppet_cmd, cmdline_debug)
|
66
71
|
log_notice('Service started')
|
67
72
|
|
68
73
|
service = self
|
69
74
|
@run_thread = Thread.new do
|
70
75
|
begin
|
71
76
|
while service.running? do
|
72
|
-
runinterval = service.parse_runinterval(
|
77
|
+
runinterval = service.parse_runinterval(ruby_puppet_cmd)
|
78
|
+
|
73
79
|
if service.state == RUNNING or service.state == IDLE
|
74
80
|
service.log_notice("Executing agent with arguments: #{args}")
|
75
|
-
pid = Process.create(:command_line => "
|
81
|
+
pid = Process.create(:command_line => "#{ruby_puppet_cmd} agent --onetime #{args}", :creation_flags => CREATE_NEW_CONSOLE).process_id
|
76
82
|
service.log_debug("Process created: #{pid}")
|
77
83
|
else
|
78
84
|
service.log_debug("Service is paused. Not invoking Puppet agent")
|
@@ -153,7 +159,7 @@ class WindowsDaemon < Win32::Daemon
|
|
153
159
|
|
154
160
|
def parse_runinterval(puppet_path)
|
155
161
|
begin
|
156
|
-
runinterval = %x{
|
162
|
+
runinterval = %x{ #{puppet_path} agent --configprint runinterval }.to_i
|
157
163
|
if runinterval == 0
|
158
164
|
runinterval = 1800
|
159
165
|
log_err("Failed to determine runinterval, defaulting to #{runinterval} seconds")
|
@@ -168,7 +174,7 @@ class WindowsDaemon < Win32::Daemon
|
|
168
174
|
|
169
175
|
def parse_log_level(puppet_path,cmdline_debug)
|
170
176
|
begin
|
171
|
-
loglevel = %x{
|
177
|
+
loglevel = %x{ #{puppet_path} agent --configprint log_level}.chomp
|
172
178
|
unless loglevel
|
173
179
|
loglevel = :notice
|
174
180
|
log_err("Failed to determine loglevel, defaulting to #{loglevel}")
|
@@ -180,6 +186,25 @@ class WindowsDaemon < Win32::Daemon
|
|
180
186
|
|
181
187
|
LEVELS.index(cmdline_debug ? cmdline_debug : loglevel.to_sym)
|
182
188
|
end
|
189
|
+
|
190
|
+
private
|
191
|
+
|
192
|
+
def load_env(base_dir)
|
193
|
+
# ENV that uses backward slashes
|
194
|
+
ENV['FACTER_env_windows_installdir'] = base_dir.tr('/', '\\')
|
195
|
+
ENV['PL_BASEDIR'] = base_dir.tr('/', '\\')
|
196
|
+
ENV['PUPPET_DIR'] = File.join(base_dir, 'puppet').tr('/', '\\')
|
197
|
+
ENV['OPENSSL_CONF'] = File.join(base_dir, 'puppet', 'ssl', 'openssl.cnf').tr('/', '\\')
|
198
|
+
ENV['SSL_CERT_DIR'] = File.join(base_dir, 'puppet', 'ssl', 'certs').tr('/', '\\')
|
199
|
+
ENV['SSL_CERT_FILE'] = File.join(base_dir, 'puppet', 'ssl', 'cert.pem').tr('/', '\\')
|
200
|
+
ENV['Path'] = [
|
201
|
+
File.join(base_dir, 'puppet', 'bin'),
|
202
|
+
File.join(base_dir, 'bin'),
|
203
|
+
].join(';').tr('/', '\\') + ';' + ENV['Path']
|
204
|
+
|
205
|
+
# ENV that uses forward slashes
|
206
|
+
ENV['RUBYLIB'] = "#{File.join(base_dir, 'puppet','lib')};#{ENV['RUBYLIB']}"
|
207
|
+
end
|
183
208
|
end
|
184
209
|
|
185
210
|
if __FILE__ == $0
|
data/install.rb
CHANGED
@@ -122,12 +122,12 @@ def check_prereqs
|
|
122
122
|
facter_version = Facter.version.to_f
|
123
123
|
if facter_version < MIN_FACTER_VERSION
|
124
124
|
puts "Facter version: #{facter_version}; minimum required: #{MIN_FACTER_VERSION}; cannot install"
|
125
|
-
exit
|
125
|
+
exit(-1)
|
126
126
|
end
|
127
127
|
end
|
128
128
|
rescue LoadError
|
129
129
|
puts "Could not load #{pre}; cannot install"
|
130
|
-
exit
|
130
|
+
exit(-1)
|
131
131
|
end
|
132
132
|
}
|
133
133
|
end
|
@@ -248,7 +248,7 @@ def prepare_installation
|
|
248
248
|
require 'win32/dir'
|
249
249
|
rescue LoadError => e
|
250
250
|
puts "Cannot run on Microsoft Windows without the win32-process, win32-dir & win32-service gems: #{e}"
|
251
|
-
exit
|
251
|
+
exit(-1)
|
252
252
|
end
|
253
253
|
end
|
254
254
|
|
@@ -437,13 +437,13 @@ def install_binfile(from, op_file, target)
|
|
437
437
|
if $operatingsystem == "windows" && InstallOptions.batch_files
|
438
438
|
installed_wrapper = false
|
439
439
|
|
440
|
-
unless File.extname(from)
|
441
|
-
if File.
|
440
|
+
unless File.extname(from) =~ /\.(cmd|bat)/
|
441
|
+
if File.exist?("#{from}.bat")
|
442
442
|
FileUtils.install("#{from}.bat", File.join(target, "#{op_file}.bat"), :mode => 0755, :preserve => true, :verbose => true)
|
443
443
|
installed_wrapper = true
|
444
444
|
end
|
445
445
|
|
446
|
-
if File.
|
446
|
+
if File.exist?("#{from}.cmd")
|
447
447
|
FileUtils.install("#{from}.cmd", File.join(target, "#{op_file}.cmd"), :mode => 0755, :preserve => true, :verbose => true)
|
448
448
|
installed_wrapper = true
|
449
449
|
end
|
data/lib/puppet.rb
CHANGED
@@ -296,10 +296,18 @@ module Puppet
|
|
296
296
|
@context.rollback(name)
|
297
297
|
end
|
298
298
|
|
299
|
+
def self.runtime
|
300
|
+
@runtime
|
301
|
+
end
|
302
|
+
|
299
303
|
require 'puppet/node'
|
300
304
|
|
301
305
|
# The single instance used for normal operation
|
302
306
|
@context = Puppet::Context.new(bootstrap_context)
|
307
|
+
|
308
|
+
require 'puppet/runtime'
|
309
|
+
@runtime = Puppet::Runtime.instance
|
310
|
+
@runtime['http'] = proc { Puppet::HTTP::Client.new }
|
303
311
|
end
|
304
312
|
|
305
313
|
# This feels weird to me; I would really like for us to get to a state where there is never a "require" statement
|
data/lib/puppet/application.rb
CHANGED
@@ -183,7 +183,7 @@ class Application
|
|
183
183
|
|
184
184
|
# used to declare code that handle an option
|
185
185
|
def option(*options, &block)
|
186
|
-
long = options.find { |opt| opt =~ /^--/ }.gsub(/^--(?:\[no-\])?([^ =]+).*$/, '\1' ).
|
186
|
+
long = options.find { |opt| opt =~ /^--/ }.gsub(/^--(?:\[no-\])?([^ =]+).*$/, '\1' ).tr('-','_')
|
187
187
|
fname = "handle_#{long}".intern
|
188
188
|
if (block_given?)
|
189
189
|
define_method(fname, &block)
|
@@ -160,6 +160,9 @@ the master, the certificate request the master received is the same as
|
|
160
160
|
the one the client sent (to prevent against man-in-the-middle attacks
|
161
161
|
when signing certificates).
|
162
162
|
|
163
|
+
'--skip_tags' is a flag used to filter resources. If this is set, then
|
164
|
+
only resources not tagged with the specified tags will be applied.
|
165
|
+
Values must be comma-separated.
|
163
166
|
|
164
167
|
OPTIONS
|
165
168
|
-------
|
@@ -230,8 +230,8 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
230
230
|
catalog =
|
231
231
|
begin
|
232
232
|
Puppet::Resource::Catalog.indirection.find(node.name, :use_node => node)
|
233
|
-
rescue Puppet::
|
234
|
-
# already logged and handled by the compiler
|
233
|
+
rescue Puppet::Error
|
234
|
+
# already logged and handled by the compiler, including Puppet::ParseErrorWithIssue
|
235
235
|
exit(1)
|
236
236
|
end
|
237
237
|
|
@@ -64,9 +64,7 @@ class TypeDoc
|
|
64
64
|
|
65
65
|
def list_types
|
66
66
|
puts "These are the types known to puppet:\n"
|
67
|
-
@types.keys.
|
68
|
-
a.to_s <=> b.to_s
|
69
|
-
}.each do |name|
|
67
|
+
@types.keys.sort_by(&:to_s).each do |name|
|
70
68
|
type = @types[name]
|
71
69
|
s = type.doc.gsub(/\s+/, " ")
|
72
70
|
n = s.index(". ")
|
@@ -149,18 +147,14 @@ class TypeDoc
|
|
149
147
|
end
|
150
148
|
|
151
149
|
def format_providers(type)
|
152
|
-
type.providers.
|
153
|
-
a.to_s <=> b.to_s
|
154
|
-
}.each { |prov|
|
150
|
+
type.providers.sort_by(&:to_s).each { |prov|
|
155
151
|
puts "\n- **#{prov}**"
|
156
152
|
puts @format.wrap(type.provider(prov).doc, :indent => 4, :scrub => true)
|
157
153
|
}
|
158
154
|
end
|
159
155
|
|
160
156
|
def list_providers(type)
|
161
|
-
list = type.providers.
|
162
|
-
a.to_s <=> b.to_s
|
163
|
-
}.join(", ")
|
157
|
+
list = type.providers.sort_by(&:to_s).join(", ")
|
164
158
|
puts @format.wrap(list, :indent => 4)
|
165
159
|
end
|
166
160
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'puppet/application'
|
2
2
|
require 'puppet/configurer'
|
3
3
|
require 'puppet/util/network_device'
|
4
|
+
require 'puppet/ssl/oids'
|
4
5
|
|
5
6
|
class Puppet::Application::Device < Puppet::Application
|
6
7
|
|
@@ -414,6 +415,8 @@ Licensed under the Apache 2.0 License
|
|
414
415
|
def setup
|
415
416
|
setup_logs
|
416
417
|
|
418
|
+
Puppet::SSL::Oids.register_puppet_oids
|
419
|
+
|
417
420
|
# setup global device-specific defaults; creates all necessary directories, etc
|
418
421
|
Puppet.settings.use :main, :agent, :device, :ssl
|
419
422
|
|
@@ -155,7 +155,7 @@ HELP
|
|
155
155
|
with_contents = options[:references].length <= 1
|
156
156
|
exit_code = 0
|
157
157
|
require 'puppet/util/reference'
|
158
|
-
options[:references].
|
158
|
+
options[:references].sort_by(&:to_s).each do |name|
|
159
159
|
section = Puppet::Util::Reference.reference(name)
|
160
160
|
raise _("Could not find reference %{name}") % { name: name } unless section
|
161
161
|
|
@@ -283,7 +283,7 @@ Copyright (c) 2015 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
283
283
|
'merge_hash_arrays' => !options[:merge_hash_arrays].nil?}
|
284
284
|
|
285
285
|
if options[:prefix]
|
286
|
-
merge_options
|
286
|
+
merge_options['knockout_prefix'] = options[:prefix]
|
287
287
|
end
|
288
288
|
|
289
289
|
else
|