puppet 7.0.0-universal-darwin → 7.1.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/CODEOWNERS +2 -16
- data/Gemfile +2 -3
- data/Gemfile.lock +13 -9
- data/ext/project_data.yaml +1 -0
- data/lib/puppet/application_support.rb +7 -0
- data/lib/puppet/defaults.rb +1 -27
- data/lib/puppet/environments.rb +38 -54
- data/lib/puppet/face/node/clean.rb +8 -0
- data/lib/puppet/ffi/posix.rb +10 -0
- data/lib/puppet/ffi/posix/constants.rb +14 -0
- data/lib/puppet/ffi/posix/functions.rb +24 -0
- data/lib/puppet/parser/templatewrapper.rb +1 -1
- data/lib/puppet/provider/user/aix.rb +2 -2
- data/lib/puppet/type/user.rb +1 -1
- data/lib/puppet/util/posix.rb +53 -4
- data/lib/puppet/version.rb +1 -1
- data/man/man5/puppet.conf.5 +2 -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/unit/provider/user/aix/aix_passwd_file.out +4 -0
- data/spec/unit/application_spec.rb +34 -0
- data/spec/unit/defaults_spec.rb +1 -56
- data/spec/unit/environments_spec.rb +96 -19
- data/spec/unit/face/node_spec.rb +14 -2
- data/spec/unit/parser/templatewrapper_spec.rb +4 -3
- data/spec/unit/provider/user/aix_spec.rb +5 -0
- data/spec/unit/provider/user/pw_spec.rb +2 -0
- data/spec/unit/provider/user/useradd_spec.rb +1 -0
- data/spec/unit/util/posix_spec.rb +357 -15
- data/spec/unit/util/storage_spec.rb +3 -1
- metadata +19 -2
@@ -50,7 +50,7 @@ class Puppet::Parser::TemplateWrapper
|
|
50
50
|
# @return [Array<String>] The tags defined in the current scope
|
51
51
|
# @api public
|
52
52
|
def tags
|
53
|
-
|
53
|
+
raise NotImplementedError, "Call 'all_tags' instead."
|
54
54
|
end
|
55
55
|
|
56
56
|
# @return [Array<String>] All the defined tags
|
@@ -178,7 +178,7 @@ Puppet::Type.type(:user).provide :aix, :parent => Puppet::Provider::AixObject do
|
|
178
178
|
# does not have a password.
|
179
179
|
break if line =~ /^\S+:$/
|
180
180
|
|
181
|
-
match_obj = /password
|
181
|
+
match_obj = /password\s+=\s+(\S+)/.match(line)
|
182
182
|
end
|
183
183
|
return :absent unless match_obj
|
184
184
|
|
@@ -211,7 +211,7 @@ Puppet::Type.type(:user).provide :aix, :parent => Puppet::Provider::AixObject do
|
|
211
211
|
tempfile = Tempfile.new("puppet_#{user}_pw", :encoding => Encoding::ASCII)
|
212
212
|
tempfile << "#{user}:#{value}\n"
|
213
213
|
tempfile.close()
|
214
|
-
|
214
|
+
|
215
215
|
# Options '-e', '-c', use encrypted password and clear flags
|
216
216
|
# Must receive "user:enc_password" as input
|
217
217
|
# command, arguments = {:failonfail => true, :combine => true}
|
data/lib/puppet/type/user.rb
CHANGED
data/lib/puppet/util/posix.rb
CHANGED
@@ -12,9 +12,16 @@ module Puppet::Util::POSIX
|
|
12
12
|
class << self
|
13
13
|
# Returns an array of all the groups that the user's a member of.
|
14
14
|
def groups_of(user)
|
15
|
-
|
16
|
-
|
17
|
-
groups
|
15
|
+
begin
|
16
|
+
require 'puppet/ffi/posix'
|
17
|
+
groups = get_groups_list(user)
|
18
|
+
rescue StandardError, LoadError => e
|
19
|
+
Puppet.debug("Falling back to Puppet::Etc.group: #{e.message}")
|
20
|
+
|
21
|
+
groups = []
|
22
|
+
Puppet::Etc.group do |group|
|
23
|
+
groups << group.name if group.mem.include?(user)
|
24
|
+
end
|
18
25
|
end
|
19
26
|
|
20
27
|
uniq_groups = groups.uniq
|
@@ -24,6 +31,39 @@ module Puppet::Util::POSIX
|
|
24
31
|
|
25
32
|
uniq_groups
|
26
33
|
end
|
34
|
+
|
35
|
+
private
|
36
|
+
def get_groups_list(user)
|
37
|
+
raise LoadError, "The 'getgrouplist' method is not available" unless Puppet::FFI::POSIX::Functions.respond_to?(:getgrouplist)
|
38
|
+
|
39
|
+
user_gid = Puppet::Etc.getpwnam(user).gid
|
40
|
+
ngroups = Puppet::FFI::POSIX::Constants::MAXIMUM_NUMBER_OF_GROUPS
|
41
|
+
|
42
|
+
while true do # rubocop:disable Lint/LiteralInCondition
|
43
|
+
FFI::MemoryPointer.new(:int) do |ngroups_ptr|
|
44
|
+
FFI::MemoryPointer.new(:uint, ngroups) do |groups_ptr|
|
45
|
+
old_ngroups = ngroups
|
46
|
+
ngroups_ptr.write_int(ngroups)
|
47
|
+
|
48
|
+
if Puppet::FFI::POSIX::Functions::getgrouplist(user, user_gid, groups_ptr, ngroups_ptr) != -1
|
49
|
+
groups_gids = groups_ptr.get_array_of_uint(0, ngroups_ptr.read_int)
|
50
|
+
|
51
|
+
result = []
|
52
|
+
groups_gids.each do |group_gid|
|
53
|
+
group_info = Puppet::Etc.getgrgid(group_gid)
|
54
|
+
result |= [group_info.name] if group_info.mem.include?(user)
|
55
|
+
end
|
56
|
+
return result
|
57
|
+
end
|
58
|
+
|
59
|
+
ngroups = ngroups_ptr.read_int
|
60
|
+
if ngroups <= old_ngroups
|
61
|
+
ngroups *= 2
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
27
67
|
end
|
28
68
|
|
29
69
|
# Retrieve a field from a POSIX Etc object. The id can be either an integer
|
@@ -144,8 +184,17 @@ module Puppet::Util::POSIX
|
|
144
184
|
name = get_posix_field(location, :name, id)
|
145
185
|
check_value = name
|
146
186
|
end
|
187
|
+
|
147
188
|
if check_value != field
|
148
|
-
|
189
|
+
check_value_id = get_posix_field(location, id_field, check_value) if check_value
|
190
|
+
|
191
|
+
if id == check_value_id
|
192
|
+
Puppet.debug("Multiple entries found for resource: '#{location}' with #{id_field}: #{id}")
|
193
|
+
return id
|
194
|
+
else
|
195
|
+
Puppet.debug("The value retrieved: '#{check_value}' is different than the required state: '#{field}', searching in all entries")
|
196
|
+
return search_posix_field(location, id_field, field)
|
197
|
+
end
|
149
198
|
else
|
150
199
|
return id
|
151
200
|
end
|
data/lib/puppet/version.rb
CHANGED
data/man/man5/puppet.conf.5
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPETCONF" "5" "
|
4
|
+
.TH "PUPPETCONF" "5" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
\fBThis page is autogenerated; any changes will get overwritten\fR
|
6
6
|
.
|
7
7
|
.SH "Configuration settings"
|
@@ -899,7 +899,7 @@ The time to wait for data to be read from an HTTP connection\. If nothing is rea
|
|
899
899
|
The HTTP User\-Agent string to send when making network requests\.
|
900
900
|
.
|
901
901
|
.IP "\(bu" 4
|
902
|
-
\fIDefault\fR: Puppet/7\.
|
902
|
+
\fIDefault\fR: Puppet/7\.1\.0 Ruby/2\.5\.1\-p57 (x86_64\-linux)
|
903
903
|
.
|
904
904
|
.IP "" 0
|
905
905
|
.
|
data/man/man8/puppet-agent.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-AGENT" "8" "
|
4
|
+
.TH "PUPPET\-AGENT" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-agent\fR \- The puppet agent daemon
|
data/man/man8/puppet-apply.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-APPLY" "8" "
|
4
|
+
.TH "PUPPET\-APPLY" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-apply\fR \- Apply Puppet manifests locally
|
data/man/man8/puppet-catalog.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-CATALOG" "8" "
|
4
|
+
.TH "PUPPET\-CATALOG" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-catalog\fR \- Compile, save, view, and convert catalogs\.
|
data/man/man8/puppet-config.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-CONFIG" "8" "
|
4
|
+
.TH "PUPPET\-CONFIG" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-config\fR \- Interact with Puppet\'s settings\.
|
data/man/man8/puppet-describe.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-DESCRIBE" "8" "
|
4
|
+
.TH "PUPPET\-DESCRIBE" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-describe\fR \- Display help about resource types
|
data/man/man8/puppet-device.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-DEVICE" "8" "
|
4
|
+
.TH "PUPPET\-DEVICE" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-device\fR \- Manage remote network devices
|
data/man/man8/puppet-doc.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-DOC" "8" "
|
4
|
+
.TH "PUPPET\-DOC" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-doc\fR \- Generate Puppet references
|
data/man/man8/puppet-epp.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-EPP" "8" "
|
4
|
+
.TH "PUPPET\-EPP" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-epp\fR \- Interact directly with the EPP template parser/renderer\.
|
data/man/man8/puppet-facts.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-FACTS" "8" "
|
4
|
+
.TH "PUPPET\-FACTS" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-facts\fR \- Retrieve and store facts\.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-FILEBUCKET" "8" "
|
4
|
+
.TH "PUPPET\-FILEBUCKET" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-filebucket\fR \- Store and retrieve files in a filebucket
|
data/man/man8/puppet-generate.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-GENERATE" "8" "
|
4
|
+
.TH "PUPPET\-GENERATE" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-generate\fR \- Generates Puppet code from Ruby definitions\.
|
data/man/man8/puppet-help.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-HELP" "8" "
|
4
|
+
.TH "PUPPET\-HELP" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-help\fR \- Display Puppet help\.
|
data/man/man8/puppet-lookup.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-LOOKUP" "8" "
|
4
|
+
.TH "PUPPET\-LOOKUP" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-lookup\fR \- Interactive Hiera lookup
|
data/man/man8/puppet-module.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-MODULE" "8" "
|
4
|
+
.TH "PUPPET\-MODULE" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-module\fR \- Creates, installs and searches for modules on the Puppet Forge\.
|
data/man/man8/puppet-node.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-NODE" "8" "
|
4
|
+
.TH "PUPPET\-NODE" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-node\fR \- View and manage node definitions\.
|
data/man/man8/puppet-parser.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-PARSER" "8" "
|
4
|
+
.TH "PUPPET\-PARSER" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-parser\fR \- Interact directly with the parser\.
|
data/man/man8/puppet-plugin.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-PLUGIN" "8" "
|
4
|
+
.TH "PUPPET\-PLUGIN" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-plugin\fR \- Interact with the Puppet plugin system\.
|
data/man/man8/puppet-report.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-REPORT" "8" "
|
4
|
+
.TH "PUPPET\-REPORT" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-report\fR \- Create, display, and submit reports\.
|
data/man/man8/puppet-resource.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-RESOURCE" "8" "
|
4
|
+
.TH "PUPPET\-RESOURCE" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-resource\fR \- The resource abstraction layer shell
|
data/man/man8/puppet-script.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-SCRIPT" "8" "
|
4
|
+
.TH "PUPPET\-SCRIPT" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-script\fR \- Run a puppet manifests as a script without compiling a catalog
|
data/man/man8/puppet-ssl.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET\-SSL" "8" "
|
4
|
+
.TH "PUPPET\-SSL" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\-ssl\fR \- Manage SSL keys and certificates for puppet SSL clients
|
data/man/man8/puppet.8
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "PUPPET" "8" "
|
4
|
+
.TH "PUPPET" "8" "December 2020" "Puppet, Inc." "Puppet manual"
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBpuppet\fR
|
@@ -25,4 +25,4 @@ Specialized:
|
|
25
25
|
catalog Compile, save, view, and convert catalogs\. describe Display help about resource types device Manage remote network devices doc Generate Puppet references epp Interact directly with the EPP template parser/renderer\. facts Retrieve and store facts\. filebucket Store and retrieve files in a filebucket generate Generates Puppet code from Ruby definitions\. node View and manage node definitions\. parser Interact directly with the parser\. plugin Interact with the Puppet plugin system\. script Run a puppet manifests as a script without compiling a catalog ssl Manage SSL keys and certificates for puppet SSL clients
|
26
26
|
.
|
27
27
|
.P
|
28
|
-
See \'puppet help \fIsubcommand\fR \fIaction\fR\' for help on a specific subcommand action\. See \'puppet help \fIsubcommand\fR\' for help on a specific subcommand\. Puppet v7\.
|
28
|
+
See \'puppet help \fIsubcommand\fR \fIaction\fR\' for help on a specific subcommand action\. See \'puppet help \fIsubcommand\fR\' for help on a specific subcommand\. Puppet v7\.1\.0
|
@@ -511,6 +511,40 @@ describe Puppet::Application do
|
|
511
511
|
|
512
512
|
expect { @app.configure_indirector_routes }.to raise_error(Puppet::Error, /mapping values are not allowed/)
|
513
513
|
end
|
514
|
+
|
515
|
+
it "should treat master routes on server application" do
|
516
|
+
allow(@app).to receive(:name).and_return("server")
|
517
|
+
|
518
|
+
Puppet[:route_file] = tmpfile('routes')
|
519
|
+
File.open(Puppet[:route_file], 'w') do |f|
|
520
|
+
f.print <<-ROUTES
|
521
|
+
master:
|
522
|
+
node:
|
523
|
+
terminus: exec
|
524
|
+
ROUTES
|
525
|
+
end
|
526
|
+
|
527
|
+
@app.configure_indirector_routes
|
528
|
+
|
529
|
+
expect(Puppet::Node.indirection.terminus_class).to eq('exec')
|
530
|
+
end
|
531
|
+
|
532
|
+
it "should treat server routes on master application" do
|
533
|
+
allow(@app).to receive(:name).and_return("master")
|
534
|
+
|
535
|
+
Puppet[:route_file] = tmpfile('routes')
|
536
|
+
File.open(Puppet[:route_file], 'w') do |f|
|
537
|
+
f.print <<-ROUTES
|
538
|
+
server:
|
539
|
+
node:
|
540
|
+
terminus: exec
|
541
|
+
ROUTES
|
542
|
+
end
|
543
|
+
|
544
|
+
@app.configure_indirector_routes
|
545
|
+
|
546
|
+
expect(Puppet::Node.indirection.terminus_class).to eq('exec')
|
547
|
+
end
|
514
548
|
end
|
515
549
|
|
516
550
|
describe "when running" do
|
data/spec/unit/defaults_spec.rb
CHANGED
@@ -190,39 +190,8 @@ describe "Defaults" do
|
|
190
190
|
end
|
191
191
|
end
|
192
192
|
|
193
|
-
describe "the call hook for the cadir setting", unless: Puppet::Util::Platform.windows? do
|
194
|
-
it 'does not warn when the cadir is outside the puppet ssldir' do
|
195
|
-
FileUtils.mkdir_p(Puppet[:confdir])
|
196
|
-
# This is fun; in order to get the confdir setting from the spec_helper to
|
197
|
-
# not be deleted by the #unsafe_clear in Puppet::Settings#parse_config,
|
198
|
-
# we can code it into the confdir itself, and thus we can avoid getting
|
199
|
-
# that setting wiped out during Puppet.initialize_settings.
|
200
|
-
File.write(File.join(Puppet[:confdir], 'puppet.conf'),
|
201
|
-
"cadir = /my/cool/path/for/my/cadir\n
|
202
|
-
confdir = #{Puppet[:confdir]}")
|
203
|
-
expect(Puppet).to_not receive(:log_ca_migration_warning)
|
204
|
-
Puppet.initialize_settings
|
205
|
-
expect(Puppet[:cadir]).to eq("/my/cool/path/for/my/cadir")
|
206
|
-
end
|
207
|
-
|
208
|
-
it 'does warn when the cadir is inside the puppet ssldir' do
|
209
|
-
FileUtils.mkdir_p(Puppet[:confdir])
|
210
|
-
cadir_location = File.join(Puppet[:ssldir], 'still_inside_ssldir')
|
211
|
-
# This is fun; in order to get the confdir setting from the spec_helper to
|
212
|
-
# not be deleted by the #unsafe_clear in Puppet::Settings#parse_config,
|
213
|
-
# we can code it into the confdir itself, and thus we can avoid getting
|
214
|
-
# that setting wiped out during Puppet.initialize_settings.
|
215
|
-
File.write(File.join(Puppet[:confdir], 'puppet.conf'),
|
216
|
-
"cadir = #{cadir_location}\n
|
217
|
-
confdir = #{Puppet[:confdir]}")
|
218
|
-
expect(Puppet).to receive(:log_ca_migration_warning).twice
|
219
|
-
Puppet.initialize_settings
|
220
|
-
expect(Puppet[:cadir]).to eq(cadir_location)
|
221
|
-
end
|
222
|
-
end
|
223
|
-
|
224
193
|
describe "the default cadir", :unless => Puppet::Util::Platform.windows? do
|
225
|
-
it 'defaults to the puppetserver confdir' do
|
194
|
+
it 'defaults to the puppetserver confdir when no cadir is found' do
|
226
195
|
Puppet.initialize_settings
|
227
196
|
expect(Puppet[:cadir]).to eq('/etc/puppetlabs/puppetserver/ca')
|
228
197
|
end
|
@@ -234,34 +203,10 @@ describe "Defaults" do
|
|
234
203
|
end
|
235
204
|
|
236
205
|
describe '#default_cadir', :unless => Puppet::Util::Platform.windows? do
|
237
|
-
it 'returns the new puppetserver directory when no ca dir is present' do
|
238
|
-
expect(Puppet).to_not receive(:log_ca_migration_warning)
|
239
|
-
expect(Puppet.default_cadir).to eq('/etc/puppetlabs/puppetserver/ca')
|
240
|
-
end
|
241
|
-
|
242
206
|
it 'warns when a CA dir exists in the current ssldir' do
|
243
207
|
cadir = File.join(Puppet[:ssldir], 'ca')
|
244
208
|
FileUtils.mkdir_p(cadir)
|
245
|
-
expect(Puppet).to receive(:log_ca_migration_warning)
|
246
209
|
expect(Puppet.default_cadir).to eq(cadir)
|
247
210
|
end
|
248
|
-
|
249
|
-
it 'warns when the cadir is a symlink still inside the ssldir' do
|
250
|
-
another_dir = File.join(Puppet[:ssldir], 'another_dir')
|
251
|
-
cadir = File.join(Puppet[:ssldir], 'ca')
|
252
|
-
FileUtils.mkdir_p(another_dir)
|
253
|
-
File.symlink(another_dir, cadir)
|
254
|
-
expect(Puppet).to receive(:log_ca_migration_warning)
|
255
|
-
expect(Puppet.default_cadir).to eq(another_dir)
|
256
|
-
end
|
257
|
-
|
258
|
-
it 'does not warn when the cadir is a symlink targeted outside the ssldir' do
|
259
|
-
another_dir = Dir.mktmpdir
|
260
|
-
cadir = File.join(Puppet[:ssldir], 'ca')
|
261
|
-
FileUtils.mkdir_p(Puppet[:ssldir])
|
262
|
-
File.symlink(another_dir, cadir)
|
263
|
-
expect(Puppet).to_not receive(:log_ca_migration_warning)
|
264
|
-
expect(Puppet.default_cadir).to eq(another_dir)
|
265
|
-
end
|
266
211
|
end
|
267
212
|
end
|