puppet 6.4.3-universal-darwin → 6.4.4-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/CODEOWNERS +9 -9
- data/Gemfile +2 -2
- data/Gemfile.lock +23 -23
- data/ext/project_data.yaml +2 -2
- data/install.rb +3 -21
- data/lib/puppet/application/agent.rb +12 -0
- data/lib/puppet/application/device.rb +14 -4
- data/lib/puppet/application/resource.rb +4 -4
- data/lib/puppet/defaults.rb +12 -0
- data/lib/puppet/face/config.rb +10 -48
- data/lib/puppet/face/facts.rb +1 -1
- data/lib/puppet/face/help.rb +1 -1
- data/lib/puppet/face/plugin.rb +9 -2
- data/lib/puppet/indirector/catalog/compiler.rb +11 -5
- data/lib/puppet/module_tool/tar/mini.rb +11 -1
- data/lib/puppet/network/http/factory.rb +1 -11
- data/lib/puppet/provider/file/posix.rb +5 -0
- data/lib/puppet/provider/nameservice.rb +10 -3
- data/lib/puppet/provider/package/dnf.rb +1 -1
- data/lib/puppet/provider/package/pip.rb +2 -2
- data/lib/puppet/provider/package/rpm.rb +51 -13
- data/lib/puppet/provider/package/yum.rb +8 -4
- data/lib/puppet/provider/service/launchd.rb +20 -5
- data/lib/puppet/provider/service/systemd.rb +5 -10
- data/lib/puppet/provider/service/windows.rb +8 -0
- data/lib/puppet/provider/user/pw.rb +12 -3
- data/lib/puppet/provider/user/user_role_add.rb +4 -0
- data/lib/puppet/provider/user/useradd.rb +23 -7
- data/lib/puppet/resource.rb +17 -0
- data/lib/puppet/settings.rb +40 -0
- data/lib/puppet/type/exec.rb +14 -6
- data/lib/puppet/type/package.rb +10 -0
- data/lib/puppet/type/service.rb +7 -2
- data/lib/puppet/util/execution.rb +4 -3
- data/lib/puppet/util/http_proxy.rb +19 -5
- data/lib/puppet/util/selinux.rb +5 -1
- data/lib/puppet/util/windows/security.rb +2 -0
- data/lib/puppet/util/windows/service.rb +149 -4
- data/lib/puppet/util/windows/sid.rb +1 -0
- data/lib/puppet/version.rb +1 -1
- data/locales/puppet.pot +168 -152
- data/man/man5/puppet.conf.5 +18 -2
- data/man/man8/puppet-agent.8 +1 -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 +3 -3
- data/spec/integration/provider/service/systemd_spec.rb +8 -5
- data/spec/integration/type/file_spec.rb +28 -0
- data/spec/integration/util/execution_spec.rb +27 -0
- data/spec/unit/application/agent_spec.rb +20 -8
- data/spec/unit/application/device_spec.rb +27 -1
- data/spec/unit/face/facts_spec.rb +9 -0
- data/spec/unit/face/plugin_spec.rb +8 -0
- data/spec/unit/indirector/catalog/compiler_spec.rb +62 -5
- data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
- data/spec/unit/network/http/api/indirected_routes_spec.rb +25 -10
- data/spec/unit/network/http/factory_spec.rb +27 -5
- data/spec/unit/pops/validator/validator_spec.rb +7 -0
- data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
- data/spec/unit/provider/package/dnf_spec.rb +7 -0
- data/spec/unit/provider/package/dpkg_spec.rb +2 -2
- data/spec/unit/provider/package/pip_spec.rb +8 -0
- data/spec/unit/provider/package/rpm_spec.rb +150 -16
- data/spec/unit/provider/package/yum_spec.rb +7 -0
- data/spec/unit/provider/service/launchd_spec.rb +28 -0
- data/spec/unit/provider/service/systemd_spec.rb +14 -0
- data/spec/unit/provider/service/windows_spec.rb +20 -0
- data/spec/unit/provider/user/pw_spec.rb +37 -0
- data/spec/unit/provider/user/useradd_spec.rb +42 -0
- data/spec/unit/resource_spec.rb +26 -1
- data/spec/unit/transaction_spec.rb +18 -0
- data/spec/unit/type/exec_spec.rb +9 -0
- data/spec/unit/type/file/source_spec.rb +4 -4
- data/spec/unit/type/schedule_spec.rb +3 -1
- data/spec/unit/type/service_spec.rb +16 -0
- data/spec/unit/util/http_proxy_spec.rb +40 -1
- data/spec/unit/util/log_spec.rb +27 -1
- data/spec/unit/util/windows/service_spec.rb +9 -0
- metadata +3 -7
- data/ext/windows/eventlog/Rakefile +0 -32
- data/ext/windows/eventlog/puppetres.dll +0 -0
- data/ext/windows/eventlog/puppetres.mc +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1dd4ef7b5a057b03a738a7fa1539ff575df455bbfa76539725dc2180287b6ac1
|
4
|
+
data.tar.gz: 1d1046c2c733c7c94bc633ce95a21d02a7e4a94ded83b3ffd2c4210aa4e079b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a23a885b450a63b64cce6b168b88b58d949780bb8e261e2f5bab522860578dc33a3a7c8d29352c46002229d12292bbd486d5b79c3c7688cac5aea00ea8446da
|
7
|
+
data.tar.gz: 5d8bb617053c42a3b473ecfe95552641be348a44aa95ea7a021aec0e0c8a3d1a0f779d188a1ade227a7297ae714c6300143dd30f0017362e878d52b7b7eac8c6
|
data/CODEOWNERS
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
# default to platform-core
|
2
2
|
* @puppetlabs/platform-core
|
3
3
|
|
4
|
-
#
|
5
|
-
/lib/puppet/type/group @puppetlabs/
|
6
|
-
/lib/puppet/type/package @puppetlabs/
|
7
|
-
/lib/puppet/type/service @puppetlabs/
|
8
|
-
/lib/puppet/type/user @puppetlabs/
|
9
|
-
/lib/puppet/provider/group @puppetlabs/
|
10
|
-
/lib/puppet/provider/package @puppetlabs/
|
11
|
-
/lib/puppet/provider/service @puppetlabs/
|
12
|
-
/lib/puppet/provider/user @puppetlabs/
|
4
|
+
# Night's Watch
|
5
|
+
/lib/puppet/type/group @puppetlabs/night-s-watch
|
6
|
+
/lib/puppet/type/package @puppetlabs/night-s-watch
|
7
|
+
/lib/puppet/type/service @puppetlabs/night-s-watch
|
8
|
+
/lib/puppet/type/user @puppetlabs/night-s-watch
|
9
|
+
/lib/puppet/provider/group @puppetlabs/night-s-watch
|
10
|
+
/lib/puppet/provider/package @puppetlabs/night-s-watch
|
11
|
+
/lib/puppet/provider/service @puppetlabs/night-s-watch
|
12
|
+
/lib/puppet/provider/user @puppetlabs/night-s-watch
|
13
13
|
|
14
14
|
# language
|
15
15
|
/lib/puppet/datatypes @puppetlabs/language
|
data/Gemfile
CHANGED
@@ -23,8 +23,8 @@ group(:features) do
|
|
23
23
|
gem 'hiera-eyaml', require: false
|
24
24
|
gem 'hocon', '~> 1.0', require: false
|
25
25
|
# requires native libshadow headers/libs
|
26
|
-
#
|
27
|
-
gem 'minitar', '~> 0.
|
26
|
+
#gem 'ruby-shadow', '~> 2.5', require: false, platforms: [:ruby]
|
27
|
+
gem 'minitar', '~> 0.9', require: false
|
28
28
|
gem 'msgpack', '~> 1.2', require: false
|
29
29
|
gem 'rdoc', '~> 6.0', require: false, platforms: [:ruby]
|
30
30
|
# requires native augeas headers/libs
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
puppet (6.4.
|
4
|
+
puppet (6.4.4)
|
5
5
|
CFPropertyList (~> 2.2)
|
6
6
|
facter (>= 2.4.0, < 4)
|
7
7
|
fast_gettext (~> 1.1.2)
|
@@ -15,20 +15,20 @@ GEM
|
|
15
15
|
remote: https://artifactory.delivery.puppetlabs.net/artifactory/api/gems/rubygems/
|
16
16
|
specs:
|
17
17
|
CFPropertyList (2.3.6)
|
18
|
-
addressable (2.
|
19
|
-
public_suffix (>= 2.0.2, <
|
18
|
+
addressable (2.7.0)
|
19
|
+
public_suffix (>= 2.0.2, < 5.0)
|
20
20
|
artifactory (2.8.2)
|
21
21
|
ast (2.4.0)
|
22
22
|
coderay (1.1.2)
|
23
23
|
crack (0.4.3)
|
24
24
|
safe_yaml (~> 1.0.0)
|
25
25
|
diff-lcs (1.3)
|
26
|
-
facter (2.5.
|
26
|
+
facter (2.5.6)
|
27
27
|
fast_gettext (1.1.2)
|
28
28
|
gettext (3.2.9)
|
29
29
|
locale (>= 2.0.5)
|
30
30
|
text (>= 1.3.0)
|
31
|
-
gettext-setup (0.
|
31
|
+
gettext-setup (0.31)
|
32
32
|
fast_gettext (~> 1.1.0)
|
33
33
|
gettext (>= 3.0.2)
|
34
34
|
locale
|
@@ -46,32 +46,32 @@ GEM
|
|
46
46
|
locale (2.1.2)
|
47
47
|
memory_profiler (0.9.14)
|
48
48
|
method_source (0.9.2)
|
49
|
-
minitar (0.
|
50
|
-
msgpack (1.3.
|
49
|
+
minitar (0.9)
|
50
|
+
msgpack (1.3.1)
|
51
51
|
multi_json (1.13.1)
|
52
52
|
mustache (1.1.0)
|
53
53
|
optimist (3.0.0)
|
54
|
-
packaging (0.99.
|
54
|
+
packaging (0.99.44)
|
55
55
|
artifactory (~> 2)
|
56
|
-
rake (
|
57
|
-
parallel (1.
|
58
|
-
parser (2.6.
|
56
|
+
rake (>= 12.3)
|
57
|
+
parallel (1.18.0)
|
58
|
+
parser (2.6.5.0)
|
59
59
|
ast (~> 2.4.0)
|
60
60
|
powerpack (0.1.2)
|
61
61
|
pry (0.12.2)
|
62
62
|
coderay (~> 1.1.0)
|
63
63
|
method_source (~> 0.9.0)
|
64
|
-
public_suffix (
|
65
|
-
puppet-resource_api (1.8.
|
64
|
+
public_suffix (4.0.1)
|
65
|
+
puppet-resource_api (1.8.7)
|
66
66
|
hocon (>= 1.0)
|
67
|
-
puppetserver-ca (1.
|
67
|
+
puppetserver-ca (1.4.0)
|
68
68
|
facter (>= 2.0.1, < 4)
|
69
69
|
racc (1.4.9)
|
70
70
|
rainbow (2.2.2)
|
71
71
|
rake
|
72
|
-
rake (12.3.
|
72
|
+
rake (12.3.3)
|
73
73
|
rdiscount (2.2.0.1)
|
74
|
-
rdoc (6.
|
74
|
+
rdoc (6.2.0)
|
75
75
|
ronn (0.7.3)
|
76
76
|
hpricot (>= 0.8.2)
|
77
77
|
mustache (>= 0.7.0)
|
@@ -80,20 +80,20 @@ GEM
|
|
80
80
|
rspec-core (~> 3.8.0)
|
81
81
|
rspec-expectations (~> 3.8.0)
|
82
82
|
rspec-mocks (~> 3.8.0)
|
83
|
-
rspec-collection_matchers (1.
|
83
|
+
rspec-collection_matchers (1.2.0)
|
84
84
|
rspec-expectations (>= 2.99.0.beta1)
|
85
85
|
rspec-core (3.8.2)
|
86
86
|
rspec-support (~> 3.8.0)
|
87
|
-
rspec-expectations (3.8.
|
87
|
+
rspec-expectations (3.8.6)
|
88
88
|
diff-lcs (>= 1.2.0, < 2.0)
|
89
89
|
rspec-support (~> 3.8.0)
|
90
90
|
rspec-its (1.3.0)
|
91
91
|
rspec-core (>= 3.0.0)
|
92
92
|
rspec-expectations (>= 3.0.0)
|
93
|
-
rspec-mocks (3.8.
|
93
|
+
rspec-mocks (3.8.2)
|
94
94
|
diff-lcs (>= 1.2.0, < 2.0)
|
95
95
|
rspec-support (~> 3.8.0)
|
96
|
-
rspec-support (3.8.
|
96
|
+
rspec-support (3.8.3)
|
97
97
|
rubocop (0.49.1)
|
98
98
|
parallel (~> 1.10)
|
99
99
|
parser (>= 2.3.3.1, < 3.0)
|
@@ -103,7 +103,7 @@ GEM
|
|
103
103
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
104
104
|
rubocop-i18n (1.2.0)
|
105
105
|
rubocop (~> 0.49.0)
|
106
|
-
ruby-prof (0.
|
106
|
+
ruby-prof (1.0.0)
|
107
107
|
ruby-progressbar (1.10.1)
|
108
108
|
safe_yaml (1.0.5)
|
109
109
|
semantic_puppet (1.0.2)
|
@@ -126,7 +126,7 @@ DEPENDENCIES
|
|
126
126
|
hocon (~> 1.0)
|
127
127
|
json-schema (~> 2.0)
|
128
128
|
memory_profiler
|
129
|
-
minitar (~> 0.
|
129
|
+
minitar (~> 0.9)
|
130
130
|
msgpack (~> 1.2)
|
131
131
|
packaging (~> 0.99)
|
132
132
|
pry
|
@@ -149,4 +149,4 @@ DEPENDENCIES
|
|
149
149
|
yard
|
150
150
|
|
151
151
|
BUNDLED WITH
|
152
|
-
1.
|
152
|
+
1.17.3
|
data/ext/project_data.yaml
CHANGED
@@ -44,7 +44,7 @@ gem_platform_dependencies:
|
|
44
44
|
# Use of win32-security is deprecated
|
45
45
|
win32-security: '= 0.2.5'
|
46
46
|
win32-service: '= 0.8.8'
|
47
|
-
minitar: '~> 0.
|
47
|
+
minitar: '~> 0.9'
|
48
48
|
x64-mingw32:
|
49
49
|
gem_runtime_dependencies:
|
50
50
|
ffi: '~> 1.9.25'
|
@@ -54,7 +54,7 @@ gem_platform_dependencies:
|
|
54
54
|
# Use of win32-security is deprecated
|
55
55
|
win32-security: '= 0.2.5'
|
56
56
|
win32-service: '= 0.8.8'
|
57
|
-
minitar: '~> 0.
|
57
|
+
minitar: '~> 0.9'
|
58
58
|
bundle_platforms:
|
59
59
|
universal-darwin: all
|
60
60
|
x86-mingw32: mingw
|
data/install.rb
CHANGED
@@ -62,24 +62,6 @@ def do_configs(configs, target, strip = 'conf/')
|
|
62
62
|
ocf = File.join(InstallOptions.config_dir, cf.gsub(/#{strip}/, ''))
|
63
63
|
FileUtils.install(cf, ocf, {:mode => 0644, :preserve => true, :verbose => true})
|
64
64
|
end
|
65
|
-
|
66
|
-
if $operatingsystem == 'windows'
|
67
|
-
src_dll = 'ext/windows/eventlog/puppetres.dll'
|
68
|
-
dst_dll = File.join(InstallOptions.bin_dir, 'puppetres.dll')
|
69
|
-
FileUtils.install(src_dll, dst_dll, {:mode => 0644, :preserve => true, :verbose => true})
|
70
|
-
|
71
|
-
require 'win32/registry'
|
72
|
-
include Win32::Registry::Constants
|
73
|
-
|
74
|
-
begin
|
75
|
-
Win32::Registry::HKEY_LOCAL_MACHINE.create('SYSTEM\CurrentControlSet\services\eventlog\Application\Puppet', KEY_ALL_ACCESS | 0x0100) do |reg|
|
76
|
-
reg.write_s('EventMessageFile', dst_dll.tr('/', '\\'))
|
77
|
-
reg.write_i('TypesSupported', 0x7)
|
78
|
-
end
|
79
|
-
rescue Win32::Registry::Error => e
|
80
|
-
warn "Failed to create puppet eventlog registry key: #{e}"
|
81
|
-
end
|
82
|
-
end
|
83
65
|
end
|
84
66
|
|
85
67
|
def do_bins(bins, target, strip = 's?bin/')
|
@@ -140,12 +122,12 @@ def check_prereqs
|
|
140
122
|
facter_version = Facter.version.to_f
|
141
123
|
if facter_version < MIN_FACTER_VERSION
|
142
124
|
puts "Facter version: #{facter_version}; minimum required: #{MIN_FACTER_VERSION}; cannot install"
|
143
|
-
exit -1
|
125
|
+
exit (-1)
|
144
126
|
end
|
145
127
|
end
|
146
128
|
rescue LoadError
|
147
129
|
puts "Could not load #{pre}; cannot install"
|
148
|
-
exit -1
|
130
|
+
exit (-1)
|
149
131
|
end
|
150
132
|
}
|
151
133
|
end
|
@@ -266,7 +248,7 @@ def prepare_installation
|
|
266
248
|
require 'win32/dir'
|
267
249
|
rescue LoadError => e
|
268
250
|
puts "Cannot run on Microsoft Windows without the win32-process, win32-dir & win32-service gems: #{e}"
|
269
|
-
exit -1
|
251
|
+
exit (-1)
|
270
252
|
end
|
271
253
|
end
|
272
254
|
|
@@ -347,6 +347,8 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
347
347
|
# Setup signal traps immediately after daemonization so we clean up the daemon
|
348
348
|
daemon.set_signal_traps
|
349
349
|
|
350
|
+
log_config if Puppet[:daemonize]
|
351
|
+
|
350
352
|
wait_for_certificates
|
351
353
|
|
352
354
|
if Puppet[:onetime]
|
@@ -357,6 +359,16 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
357
359
|
end
|
358
360
|
end
|
359
361
|
|
362
|
+
def log_config
|
363
|
+
#skip also config reading and parsing if debug is not enabled
|
364
|
+
return unless Puppet::Util::Log.sendlevel?(:debug)
|
365
|
+
|
366
|
+
Puppet.settings.stringify_settings(:agent, :all).each_pair do |k,v|
|
367
|
+
next if k.include?("password") || v.to_s.empty?
|
368
|
+
Puppet.debug("Using setting: #{k}=#{v}")
|
369
|
+
end
|
370
|
+
end
|
371
|
+
|
360
372
|
def fingerprint
|
361
373
|
Puppet::Util::Log.newdestination(:console)
|
362
374
|
cert_provider = Puppet::X509::CertProvider.new
|
@@ -238,6 +238,7 @@ Licensed under the Apache 2.0 License
|
|
238
238
|
libdir = Puppet[:libdir]
|
239
239
|
vardir = Puppet[:vardir]
|
240
240
|
confdir = Puppet[:confdir]
|
241
|
+
ssldir = Puppet[:ssldir]
|
241
242
|
certname = Puppet[:certname]
|
242
243
|
|
243
244
|
env = Puppet::Node::Environment.remote(Puppet[:environment])
|
@@ -267,15 +268,23 @@ Licensed under the Apache 2.0 License
|
|
267
268
|
port = ":#{device_url.port}" if device_url.port
|
268
269
|
|
269
270
|
# override local $vardir and $certname
|
271
|
+
Puppet[:ssldir] = ::File.join(Puppet[:deviceconfdir], device.name, 'ssl')
|
270
272
|
Puppet[:confdir] = ::File.join(Puppet[:devicedir], device.name)
|
271
273
|
Puppet[:libdir] = options[:libdir] || ::File.join(Puppet[:devicedir], device.name, 'lib')
|
272
274
|
Puppet[:vardir] = ::File.join(Puppet[:devicedir], device.name)
|
273
275
|
Puppet[:certname] = device.name
|
274
276
|
ssl_context = nil
|
275
277
|
|
278
|
+
# create device directory under $deviceconfdir
|
279
|
+
Puppet::FileSystem.dir_mkpath(Puppet[:ssldir]) unless Puppet::FileSystem.dir_exist?(Puppet[:ssldir])
|
280
|
+
|
276
281
|
# this will reload and recompute default settings and create device-specific sub vardir
|
277
282
|
Puppet.settings.use :main, :agent, :ssl
|
278
283
|
|
284
|
+
# Workaround for PUP-8736: store ssl certs outside the cache directory to prevent accidental removal and keep the old path as symlink
|
285
|
+
optssldir = File.join(Puppet[:confdir], 'ssl')
|
286
|
+
Puppet::FileSystem.symlink(Puppet[:ssldir], optssldir) unless Puppet::FileSystem.exist?(optssldir)
|
287
|
+
|
279
288
|
unless options[:resource] || options[:facts] || options[:apply]
|
280
289
|
# Since it's too complicated to fix properly in the default settings, we workaround for PUP-9642 here.
|
281
290
|
# See https://github.com/puppetlabs/puppet/pull/7483#issuecomment-483455997 for details.
|
@@ -306,10 +315,10 @@ Licensed under the Apache 2.0 License
|
|
306
315
|
Puppet.info _("retrieving resource: %{resource} from %{target} at %{scheme}%{url_host}%{port}%{url_path}") % { resource: type, target: device.name, scheme: scheme, url_host: device_url.host, port: port, url_path: device_url.path }
|
307
316
|
resources = find_resources(type, name)
|
308
317
|
if options[:to_yaml]
|
309
|
-
|
310
|
-
resource.prune_parameters(:parameters_to_include => @extra_params).
|
311
|
-
end.
|
312
|
-
text.
|
318
|
+
data = resources.map do |resource|
|
319
|
+
resource.prune_parameters(:parameters_to_include => @extra_params).to_hiera_hash
|
320
|
+
end.inject(:merge!)
|
321
|
+
text = YAML.dump(type.downcase => data)
|
313
322
|
else
|
314
323
|
text = resources.map do |resource|
|
315
324
|
resource.prune_parameters(:parameters_to_include => @extra_params).to_manifest.force_encoding(Encoding.default_external)
|
@@ -359,6 +368,7 @@ Licensed under the Apache 2.0 License
|
|
359
368
|
Puppet[:libdir] = libdir
|
360
369
|
Puppet[:vardir] = vardir
|
361
370
|
Puppet[:confdir] = confdir
|
371
|
+
Puppet[:ssldir] = ssldir
|
362
372
|
Puppet[:certname] = certname
|
363
373
|
end
|
364
374
|
end
|
@@ -142,10 +142,10 @@ Copyright (c) 2011 Puppet Inc., LLC Licensed under the Apache 2.0 License
|
|
142
142
|
resources = find_or_save_resources(type, name, params)
|
143
143
|
|
144
144
|
if options[:to_yaml]
|
145
|
-
|
146
|
-
resource.prune_parameters(:parameters_to_include => @extra_params).
|
147
|
-
end.
|
148
|
-
text.
|
145
|
+
data = resources.map do |resource|
|
146
|
+
resource.prune_parameters(:parameters_to_include => @extra_params).to_hiera_hash
|
147
|
+
end.inject(:merge!)
|
148
|
+
text = YAML.dump(type.downcase => data)
|
149
149
|
else
|
150
150
|
text = resources.map do |resource|
|
151
151
|
resource.prune_parameters(:parameters_to_include => @extra_params).to_manifest.force_encoding(Encoding.default_external)
|
data/lib/puppet/defaults.rb
CHANGED
@@ -572,6 +572,10 @@ module Puppet
|
|
572
572
|
contains any characters with special meanings in URLs (as specified by RFC 3986
|
573
573
|
section 2.2), they must be URL-encoded. (For example, `#` would become `%23`.)",
|
574
574
|
},
|
575
|
+
:no_proxy => {
|
576
|
+
:default => "localhost, 127.0.0.1",
|
577
|
+
:desc => "List of domain names that should not go through `http_proxy_host`. Environment variable no_proxy or NO_PROXY will override this value.",
|
578
|
+
},
|
575
579
|
:http_keepalive_timeout => {
|
576
580
|
:default => "4s",
|
577
581
|
:type => :duration,
|
@@ -1473,6 +1477,14 @@ EOT
|
|
1473
1477
|
apply. You can see man pages by running `puppet <SUBCOMMAND> --help`,
|
1474
1478
|
or read them online at https://puppet.com/docs/puppet/latest/man/."
|
1475
1479
|
},
|
1480
|
+
:deviceconfdir => {
|
1481
|
+
:default => "$confdir/devices",
|
1482
|
+
:type => :directory,
|
1483
|
+
:mode => "0750",
|
1484
|
+
:owner => "service",
|
1485
|
+
:group => "service",
|
1486
|
+
:desc => "The root directory of devices' $confdir.",
|
1487
|
+
},
|
1476
1488
|
:server => {
|
1477
1489
|
:default => "puppet",
|
1478
1490
|
:desc => "The puppet master server to which the puppet agent should connect.",
|
data/lib/puppet/face/config.rb
CHANGED
@@ -66,41 +66,18 @@ Puppet::Face.define(:config, '0.0.1') do
|
|
66
66
|
@default_section = true
|
67
67
|
end
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
values_from_the_selected_section =
|
74
|
-
Puppet.settings.values(nil, options[:section].to_sym)
|
75
|
-
|
76
|
-
loader_settings = {
|
77
|
-
:environmentpath => values_from_the_selected_section.interpolate(:environmentpath),
|
78
|
-
:basemodulepath => values_from_the_selected_section.interpolate(:basemodulepath),
|
79
|
-
}
|
80
|
-
|
81
|
-
to_be_rendered = nil
|
82
|
-
Puppet.override(Puppet.base_context(loader_settings),
|
83
|
-
_("New environment loaders generated from the requested section.")) do
|
84
|
-
# And now we can lookup values that include those from environments configured from
|
85
|
-
# the requested section
|
86
|
-
values = Puppet.settings.values(Puppet[:environment].to_sym, options[:section].to_sym)
|
87
|
-
|
88
|
-
if Puppet::Util::Log.sendlevel?(:info)
|
89
|
-
warn_default_section(options[:section]) if @default_section
|
90
|
-
report_section_and_environment(options[:section], Puppet.settings[:environment])
|
91
|
-
end
|
92
|
-
|
93
|
-
to_be_rendered = {}
|
94
|
-
args.sort.each do |setting_name|
|
95
|
-
to_be_rendered[setting_name] = values.print(setting_name.to_sym)
|
96
|
-
end
|
69
|
+
if Puppet::Util::Log.sendlevel?(:info)
|
70
|
+
warn_default_section(options[:section]) if @default_section
|
71
|
+
report_section_and_environment(options[:section], Puppet.settings[:environment])
|
97
72
|
end
|
98
73
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
74
|
+
names = if args.empty? || args == ['all']
|
75
|
+
:all
|
76
|
+
else
|
77
|
+
args
|
78
|
+
end
|
79
|
+
|
80
|
+
Puppet.settings.stringify_settings(options[:section], names)
|
104
81
|
end
|
105
82
|
|
106
83
|
when_rendering :console do |to_be_rendered|
|
@@ -117,21 +94,6 @@ Puppet::Face.define(:config, '0.0.1') do
|
|
117
94
|
end
|
118
95
|
end
|
119
96
|
|
120
|
-
def stringifyhash(hash)
|
121
|
-
newhash = {}
|
122
|
-
hash.each do |key, val|
|
123
|
-
key = key.to_s
|
124
|
-
if val.is_a? Hash
|
125
|
-
newhash[key] = stringifyhash(val)
|
126
|
-
elsif val.is_a? Symbol
|
127
|
-
newhash[key] = val.to_s
|
128
|
-
else
|
129
|
-
newhash[key] = val
|
130
|
-
end
|
131
|
-
end
|
132
|
-
newhash
|
133
|
-
end
|
134
|
-
|
135
97
|
def warn_default_section(section_name)
|
136
98
|
messages = []
|
137
99
|
messages << _("No section specified; defaulting to '%{section_name}'.") %
|
data/lib/puppet/face/facts.rb
CHANGED
@@ -81,7 +81,7 @@ Puppet::Indirector::Face.define(:facts, '0.0.1') do
|
|
81
81
|
node: Puppet[:node_name_value],
|
82
82
|
server: server})
|
83
83
|
|
84
|
-
Puppet::Node::Facts.indirection.save(facts)
|
84
|
+
Puppet::Node::Facts.indirection.save(facts, nil, :environment => Puppet.lookup(:current_environment))
|
85
85
|
end
|
86
86
|
end
|
87
87
|
end
|