puppet 7.23.0-x86-mingw32 → 7.24.0-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/Gemfile.lock +36 -33
- data/lib/puppet/application/face_base.rb +2 -1
- data/lib/puppet/defaults.rb +13 -0
- data/lib/puppet/environments.rb +9 -0
- data/lib/puppet/functions/each.rb +11 -13
- data/lib/puppet/functions/filter.rb +5 -13
- data/lib/puppet/functions/map.rb +7 -8
- data/lib/puppet/interface/action.rb +3 -3
- data/lib/puppet/interface/documentation.rb +2 -2
- data/lib/puppet/interface/option.rb +3 -4
- data/lib/puppet/module/plan.rb +1 -1
- data/lib/puppet/module/task.rb +1 -1
- data/lib/puppet/module.rb +1 -1
- data/lib/puppet/network/http/api/indirected_routes.rb +5 -4
- data/lib/puppet/node/environment.rb +38 -0
- data/lib/puppet/node.rb +2 -2
- data/lib/puppet/pops/evaluator/relationship_operator.rb +1 -1
- data/lib/puppet/pops/functions/function.rb +1 -3
- data/lib/puppet/pops/loader/dependency_loader.rb +1 -4
- data/lib/puppet/pops/loader/loader_paths.rb +1 -3
- data/lib/puppet/pops/loader/module_loaders.rb +1 -1
- data/lib/puppet/pops/loaders.rb +6 -2
- data/lib/puppet/pops/lookup/context.rb +3 -4
- data/lib/puppet/pops/lookup/hiera_config.rb +1 -1
- data/lib/puppet/resource.rb +4 -0
- data/lib/puppet/settings/base_setting.rb +3 -2
- data/lib/puppet/settings.rb +0 -1
- data/lib/puppet/type/file/ctime.rb +1 -1
- data/lib/puppet/type/file/mtime.rb +1 -1
- data/lib/puppet/util/log.rb +2 -2
- data/lib/puppet/version.rb +1 -1
- data/man/man5/puppet.conf.5 +13 -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-lookup.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.8 +2 -2
- data/spec/fixtures/integration/application/module/environments/direnv/modules/nginx/README +3 -0
- data/spec/fixtures/integration/application/module/environments/direnv/modules/nginx/manifests/init.pp +17 -0
- data/spec/fixtures/integration/application/module/environments/direnv/modules/nginx/metadata.json +20 -0
- data/spec/integration/application/module_spec.rb +141 -0
- data/spec/unit/environments_spec.rb +9 -0
- data/spec/unit/network/http/api/indirected_routes_spec.rb +2 -0
- data/spec/unit/node/environment_spec.rb +41 -0
- data/spec/unit/parser/resource_spec.rb +9 -0
- data/spec/unit/type/file/ctime_spec.rb +1 -1
- data/spec/unit/type/file/mtime_spec.rb +1 -1
- metadata +8 -2
@@ -40,6 +40,47 @@ describe Puppet::Node::Environment do
|
|
40
40
|
expect(e.inspect).to match(%r{<Puppet::Node::Environment:\w* @name="test" @manifest="#{File.expand_path('/manifests/path')}" @modulepath="#{File.expand_path('/modules/path')}:#{File.expand_path('/other/modules')}" >})
|
41
41
|
end
|
42
42
|
|
43
|
+
describe "externalizing filepaths" do
|
44
|
+
before(:each) do
|
45
|
+
env.resolved_path = "/opt/puppetlabs/envs/prod_123"
|
46
|
+
env.configured_path = "/etc/puppetlabs/envs/prod"
|
47
|
+
|
48
|
+
@vendored_manifest = "/opt/puppetlabs/vendored/modules/foo/manifests/init.pp"
|
49
|
+
@production_manifest = "/opt/puppetlabs/envs/prod_123/modules/foo/manifests/init.pp"
|
50
|
+
end
|
51
|
+
|
52
|
+
it "leaves paths alone if they do not match the resolved path" do
|
53
|
+
expect(env.externalize_path(@vendored_manifest)).to eq(@vendored_manifest)
|
54
|
+
end
|
55
|
+
|
56
|
+
it "leaves paths alone if resolved or configured paths are not set" do
|
57
|
+
env.resolved_path = nil
|
58
|
+
env.configured_path = nil
|
59
|
+
expect(env.externalize_path(@production_manifest)).to eq(@production_manifest)
|
60
|
+
end
|
61
|
+
|
62
|
+
it "replaces resolved paths with configured paths" do
|
63
|
+
externalized_path = env.externalize_path(@production_manifest)
|
64
|
+
expect(externalized_path).to eq("/etc/puppetlabs/envs/prod/modules/foo/manifests/init.pp")
|
65
|
+
end
|
66
|
+
|
67
|
+
it "handles nil" do
|
68
|
+
externalized_path = env.externalize_path(nil)
|
69
|
+
expect(externalized_path).to eq(nil)
|
70
|
+
end
|
71
|
+
|
72
|
+
it "appropriately handles mismatched trailing slashes" do
|
73
|
+
env.resolved_path = "/opt/puppetlabs/envs/prod_123/"
|
74
|
+
externalized_path = env.externalize_path(@production_manifest)
|
75
|
+
expect(externalized_path).to eq("/etc/puppetlabs/envs/prod/modules/foo/manifests/init.pp")
|
76
|
+
end
|
77
|
+
|
78
|
+
it "can be disabled with the `report_configured_environmentpath` setting" do
|
79
|
+
Puppet[:report_configured_environmentpath] = false
|
80
|
+
expect(env.externalize_path(@production_manifest)).to eq(@production_manifest)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
43
84
|
describe "equality" do
|
44
85
|
it "works as a hash key" do
|
45
86
|
base = Puppet::Node::Environment.create(:first, ["modules"], "manifests")
|
@@ -108,6 +108,15 @@ describe Puppet::Parser::Resource do
|
|
108
108
|
}.to raise_error(ArgumentError, /Resources require a hash as last argument/)
|
109
109
|
end
|
110
110
|
|
111
|
+
it "should attempt to externalize filepaths via the environment" do
|
112
|
+
environment = Puppet::Node::Environment.create(:testing, [])
|
113
|
+
expect(environment).to receive(:externalize_path).at_least(:once).and_return("foo")
|
114
|
+
Puppet[:code] = "notify { 'hello': }"
|
115
|
+
catalog = Puppet::Parser::Compiler.compile(Puppet::Node.new 'anyone', environment: environment)
|
116
|
+
notify = catalog.resource('Notify[hello]')
|
117
|
+
expect(notify.file).to eq("foo")
|
118
|
+
end
|
119
|
+
|
111
120
|
it "should set the reference correctly" do
|
112
121
|
res = Puppet::Parser::Resource.new("resource", "testing", @arguments)
|
113
122
|
expect(res.ref).to eq("Resource[testing]")
|
@@ -15,7 +15,7 @@ describe Puppet::Type.type(:file).attrclass(:ctime) do
|
|
15
15
|
@resource[:audit] = [:ctime]
|
16
16
|
|
17
17
|
# this .to_resource audit behavior is magical :-(
|
18
|
-
expect(@resource.to_resource[:ctime]).to eq(Puppet::FileSystem.stat(@filename).ctime)
|
18
|
+
expect(@resource.to_resource[:ctime]).to eq(Puppet::FileSystem.stat(@filename).ctime.to_s)
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should return absent if auditing an absent file" do
|
@@ -15,7 +15,7 @@ describe Puppet::Type.type(:file).attrclass(:mtime) do
|
|
15
15
|
@resource[:audit] = [:mtime]
|
16
16
|
|
17
17
|
# this .to_resource audit behavior is magical :-(
|
18
|
-
expect(@resource.to_resource[:mtime]).to eq(Puppet::FileSystem.stat(@filename).mtime)
|
18
|
+
expect(@resource.to_resource[:mtime]).to eq(Puppet::FileSystem.stat(@filename).mtime.to_s)
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should return absent if auditing an absent file" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.24.0
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -1329,6 +1329,9 @@ files:
|
|
1329
1329
|
- spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb
|
1330
1330
|
- spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/provider/applytest/applytest.rb
|
1331
1331
|
- spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/type/applytest.rb
|
1332
|
+
- spec/fixtures/integration/application/module/environments/direnv/modules/nginx/README
|
1333
|
+
- spec/fixtures/integration/application/module/environments/direnv/modules/nginx/manifests/init.pp
|
1334
|
+
- spec/fixtures/integration/application/module/environments/direnv/modules/nginx/metadata.json
|
1332
1335
|
- spec/fixtures/integration/l10n/envs/prod/modules/demo/Gemfile
|
1333
1336
|
- spec/fixtures/integration/l10n/envs/prod/modules/demo/Rakefile
|
1334
1337
|
- spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb
|
@@ -2589,6 +2592,9 @@ test_files:
|
|
2589
2592
|
- spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb
|
2590
2593
|
- spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/provider/applytest/applytest.rb
|
2591
2594
|
- spec/fixtures/integration/application/apply/environments/spec/modules/amod/lib/puppet/type/applytest.rb
|
2595
|
+
- spec/fixtures/integration/application/module/environments/direnv/modules/nginx/README
|
2596
|
+
- spec/fixtures/integration/application/module/environments/direnv/modules/nginx/manifests/init.pp
|
2597
|
+
- spec/fixtures/integration/application/module/environments/direnv/modules/nginx/metadata.json
|
2592
2598
|
- spec/fixtures/integration/l10n/envs/prod/modules/demo/Gemfile
|
2593
2599
|
- spec/fixtures/integration/l10n/envs/prod/modules/demo/Rakefile
|
2594
2600
|
- spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb
|