puppet 6.20.0-x64-mingw32 → 6.21.0-x64-mingw32

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.

Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +9 -9
  3. data/lib/puppet/property/list.rb +1 -1
  4. data/lib/puppet/provider/group/groupadd.rb +13 -8
  5. data/lib/puppet/provider/package/apt.rb +30 -2
  6. data/lib/puppet/provider/package/aptitude.rb +6 -0
  7. data/lib/puppet/provider/service/debian.rb +2 -0
  8. data/lib/puppet/provider/user/useradd.rb +55 -8
  9. data/lib/puppet/type/package.rb +3 -3
  10. data/lib/puppet/util/windows/service.rb +1 -1
  11. data/lib/puppet/version.rb +1 -1
  12. data/man/man5/puppet.conf.5 +2 -2
  13. data/man/man8/puppet-agent.8 +1 -1
  14. data/man/man8/puppet-apply.8 +1 -1
  15. data/man/man8/puppet-catalog.8 +1 -1
  16. data/man/man8/puppet-config.8 +1 -1
  17. data/man/man8/puppet-describe.8 +1 -1
  18. data/man/man8/puppet-device.8 +1 -1
  19. data/man/man8/puppet-doc.8 +1 -1
  20. data/man/man8/puppet-epp.8 +1 -1
  21. data/man/man8/puppet-facts.8 +1 -1
  22. data/man/man8/puppet-filebucket.8 +1 -1
  23. data/man/man8/puppet-generate.8 +1 -1
  24. data/man/man8/puppet-help.8 +1 -1
  25. data/man/man8/puppet-key.8 +1 -1
  26. data/man/man8/puppet-lookup.8 +1 -1
  27. data/man/man8/puppet-man.8 +1 -1
  28. data/man/man8/puppet-module.8 +1 -1
  29. data/man/man8/puppet-node.8 +1 -1
  30. data/man/man8/puppet-parser.8 +1 -1
  31. data/man/man8/puppet-plugin.8 +1 -1
  32. data/man/man8/puppet-report.8 +1 -1
  33. data/man/man8/puppet-resource.8 +1 -1
  34. data/man/man8/puppet-script.8 +1 -1
  35. data/man/man8/puppet-ssl.8 +1 -1
  36. data/man/man8/puppet-status.8 +1 -1
  37. data/man/man8/puppet.8 +2 -2
  38. data/spec/integration/application/agent_spec.rb +33 -0
  39. data/spec/unit/provider/group/groupadd_spec.rb +5 -2
  40. data/spec/unit/provider/package/apt_spec.rb +24 -15
  41. data/spec/unit/provider/package/aptitude_spec.rb +1 -1
  42. data/spec/unit/provider/user/useradd_spec.rb +55 -3
  43. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 55a6f08a7f859bdae79b2d9875f1741e5c4000cd0f6a8ad0a478749763652c72
4
- data.tar.gz: 15987f0b22c92fa498ff607f3f50a346d1892644101b67f855dd6b7cea1624b5
3
+ metadata.gz: a017c128902f9b4d2367c13e1234e9c3ad02e79a786333992210f9bc4a69a47b
4
+ data.tar.gz: df0b0d8a3ccf1606ebca846a399994018c5734957ae2a889cbffb02fef0afc65
5
5
  SHA512:
6
- metadata.gz: 59466321be99dd978165b3071e6c9d815626d925bed7ce598ebf53739292d23deeeee94180e1bbbffea94bb35e4377589111ebb02a4faf01717d106db2d95066
7
- data.tar.gz: 779146d13523704e31fd977f43d22fc93e29e5c7750701d1317238d4208b50096ca64358ddefc765f691d2f6f522e6e19f66b4786767364364915ea523075aea
6
+ metadata.gz: ca775c4f1ae0d31ef4c06432ef47cee2a733d49101943a859e573ed1050f4a2bedceac47dfb2aa474effb7679af5af86f530a167c332e1a1e2bce77126a9950e
7
+ data.tar.gz: 49abcfd2f699c06d35df8424919a273fb6a0c95a2e73a2b75a8348e2bee0b6fefc2eeeeeeac5d51a1fe19eab9bca7f72c8c7048251f45fa399bfcf3c3a5e73ce
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- puppet (6.20.0)
4
+ puppet (6.21.0)
5
5
  CFPropertyList (~> 2.2)
6
6
  concurrent-ruby (~> 1.0)
7
7
  deep_merge (~> 1.0)
@@ -20,16 +20,16 @@ GEM
20
20
  addressable (2.7.0)
21
21
  public_suffix (>= 2.0.2, < 5.0)
22
22
  artifactory (2.8.2)
23
- ast (2.4.1)
23
+ ast (2.4.2)
24
24
  coderay (1.1.3)
25
- concurrent-ruby (1.1.7)
25
+ concurrent-ruby (1.1.8)
26
26
  crack (0.4.5)
27
27
  rexml
28
28
  csv (3.1.5)
29
29
  deep_merge (1.2.1)
30
30
  diff-lcs (1.4.4)
31
31
  docopt (0.6.1)
32
- facter (4.0.49)
32
+ facter (4.0.50)
33
33
  hocon (~> 1.3)
34
34
  thor (>= 1.0.1, < 2.0)
35
35
  fast_gettext (1.1.2)
@@ -56,7 +56,7 @@ GEM
56
56
  memory_profiler (1.0.0)
57
57
  method_source (1.0.0)
58
58
  minitar (0.9)
59
- msgpack (1.3.3)
59
+ msgpack (1.4.2)
60
60
  multi_json (1.15.0)
61
61
  mustache (1.1.1)
62
62
  optimist (3.0.1)
@@ -103,10 +103,10 @@ GEM
103
103
  rspec-its (1.3.0)
104
104
  rspec-core (>= 3.0.0)
105
105
  rspec-expectations (>= 3.0.0)
106
- rspec-mocks (3.10.1)
106
+ rspec-mocks (3.10.2)
107
107
  diff-lcs (>= 1.2.0, < 2.0)
108
108
  rspec-support (~> 3.10.0)
109
- rspec-support (3.10.1)
109
+ rspec-support (3.10.2)
110
110
  rubocop (0.49.1)
111
111
  parallel (~> 1.10)
112
112
  parser (>= 2.3.3.1, < 3.0)
@@ -120,10 +120,10 @@ GEM
120
120
  ruby-progressbar (1.11.0)
121
121
  semantic_puppet (1.0.3)
122
122
  text (1.3.1)
123
- thor (1.0.1)
123
+ thor (1.1.0)
124
124
  unicode-display_width (1.7.0)
125
125
  vcr (5.1.0)
126
- webmock (3.11.1)
126
+ webmock (3.11.2)
127
127
  addressable (>= 2.3.6)
128
128
  crack (>= 0.3.2)
129
129
  hashdiff (>= 0.4.0, < 2.0.0)
@@ -47,7 +47,7 @@ module Puppet
47
47
  #ok, some 'convention' if the list property is named groups, provider should implement a groups method
48
48
  tmp = provider.send(name) if provider
49
49
  if tmp && tmp != :absent
50
- return tmp.split(delimiter)
50
+ return tmp.instance_of?(Array) ? tmp : tmp.split(delimiter)
51
51
  else
52
52
  return :absent
53
53
  end
@@ -130,16 +130,21 @@ Puppet::Type.type(:group).provide :groupadd, :parent => Puppet::Provider::NameSe
130
130
  private
131
131
 
132
132
  def findgroup(key, value)
133
- group_file = "/etc/group"
133
+ group_file = '/etc/group'
134
134
  group_keys = [:group_name, :password, :gid, :user_list]
135
- index = group_keys.index(key)
136
- @group_content ||= File.read(group_file)
137
- @group_content.each_line do |line|
138
- group = line.split(":")
139
- if group[index] == value
140
- return Hash[group_keys.zip(group)]
135
+
136
+ unless @groups
137
+ unless Puppet::FileSystem.exist?(group_file)
138
+ raise Puppet::Error.new("Forcelocal set for group resource '#{resource[:name]}', but #{group_file} does not exist")
139
+ end
140
+
141
+ @groups = []
142
+ Puppet::FileSystem.each_line(group_file) do |line|
143
+ group = line.chomp.split(':')
144
+ @groups << Hash[group_keys.zip(group)]
141
145
  end
142
146
  end
143
- false
147
+
148
+ @groups.find { |param| param[key] == value } || false
144
149
  end
145
150
  end
@@ -42,7 +42,11 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do
42
42
 
43
43
  def query
44
44
  hash = super
45
- hash[:mark] = :manual if aptmark('showmanual').split("\n").include?(@resource[:name])
45
+
46
+ if !%i(absent purged).include?(hash[:ensure]) && aptmark('showmanual', @resource[:name]).strip == @resource[:name]
47
+ hash[:mark] = :manual
48
+ end
49
+
46
50
  hash
47
51
  end
48
52
 
@@ -147,7 +151,13 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do
147
151
  end
148
152
 
149
153
  cmd += install_options if @resource[:install_options]
150
- cmd << :install << str
154
+ cmd << :install
155
+
156
+ if source
157
+ cmd << source
158
+ else
159
+ cmd << str
160
+ end
151
161
 
152
162
  self.unhold if self.properties[:mark] == :hold
153
163
  begin
@@ -155,6 +165,18 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do
155
165
  ensure
156
166
  self.hold if @resource[:mark] == :hold
157
167
  end
168
+
169
+ # If a source file was specified, we must make sure the expected version was installed from specified file
170
+ if source && !%i(present installed).include?(should)
171
+ is = self.query
172
+ raise Puppet::Error, _("Could not find package %{name}") % { name: self.name } unless is
173
+
174
+ version = is[:ensure]
175
+
176
+ raise Puppet::Error, _("Failed to update to version %{should}, got version %{version} instead") % { should: should, version: version } unless
177
+ insync?(version)
178
+ end
179
+
158
180
  end
159
181
 
160
182
  # What's the latest package version available?
@@ -231,4 +253,10 @@ Puppet::Type.type(:package).provide :apt, :parent => :dpkg, :source => :dpkg do
231
253
  end
232
254
  should_range.include?(is_version)
233
255
  end
256
+
257
+ private
258
+
259
+ def source
260
+ @source ||= @resource[:source]
261
+ end
234
262
  end
@@ -26,4 +26,10 @@ Puppet::Type.type(:package).provide :aptitude, :parent => :apt, :source => :dpkg
26
26
  def purge
27
27
  aptitude '-y', 'purge', @resource[:name]
28
28
  end
29
+
30
+ private
31
+
32
+ def source
33
+ nil
34
+ end
29
35
  end
@@ -17,6 +17,8 @@ Puppet::Type.type(:service).provide :debian, :parent => :init do
17
17
  commands :invoke_rc => "/usr/sbin/invoke-rc.d"
18
18
  commands :service => "/usr/sbin/service"
19
19
 
20
+ confine :false => Puppet::FileSystem.exist?('/proc/1/comm') && Puppet::FileSystem.read('/proc/1/comm').include?('systemd')
21
+
20
22
  defaultfor :operatingsystem => :cumuluslinux, :operatingsystemmajrelease => ['1','2']
21
23
  defaultfor :operatingsystem => :debian, :operatingsystemmajrelease => ['5','6','7']
22
24
  defaultfor :operatingsystem => :devuan
@@ -59,23 +59,37 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
59
59
  get(:uid)
60
60
  end
61
61
 
62
+ def gid
63
+ return localgid if @resource.forcelocal?
64
+ get(:gid)
65
+ end
66
+
62
67
  def comment
63
68
  return localcomment if @resource.forcelocal?
64
69
  get(:comment)
65
70
  end
66
71
 
72
+ def groups
73
+ return localgroups if @resource.forcelocal?
74
+ super
75
+ end
76
+
67
77
  def finduser(key, value)
68
- passwd_file = "/etc/passwd"
78
+ passwd_file = '/etc/passwd'
69
79
  passwd_keys = [:account, :password, :uid, :gid, :gecos, :directory, :shell]
70
- index = passwd_keys.index(key)
71
- @passwd_content ||= File.read(passwd_file)
72
- @passwd_content.each_line do |line|
73
- user = line.split(":")
74
- if user[index] == value
75
- return Hash[passwd_keys.zip(user)]
80
+
81
+ unless @users
82
+ unless Puppet::FileSystem.exist?(passwd_file)
83
+ raise Puppet::Error.new("Forcelocal set for user resource '#{resource[:name]}', but #{passwd_file} does not exist")
84
+ end
85
+
86
+ @users = []
87
+ Puppet::FileSystem.each_line(passwd_file) do |line|
88
+ user = line.chomp.split(':')
89
+ @users << Hash[passwd_keys.zip(user)]
76
90
  end
77
91
  end
78
- false
92
+ @users.find { |param| param[key] == value } || false
79
93
  end
80
94
 
81
95
  def local_username
@@ -88,16 +102,49 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
88
102
  false
89
103
  end
90
104
 
105
+ def localgid
106
+ user = finduser(:account, resource[:name])
107
+ return user[:gid] if user
108
+ false
109
+ end
110
+
91
111
  def localcomment
92
112
  user = finduser(:account, resource[:name])
93
113
  user[:gecos]
94
114
  end
95
115
 
116
+ def localgroups
117
+ @groups_of ||= {}
118
+ group_file = '/etc/group'
119
+ user = resource[:name]
120
+
121
+ return @groups_of[user] if @groups_of[user]
122
+
123
+ @groups_of[user] = []
124
+
125
+ unless Puppet::FileSystem.exist?(group_file)
126
+ raise Puppet::Error.new("Forcelocal set for user resource '#{user}', but #{group_file} does not exist")
127
+ end
128
+
129
+ Puppet::FileSystem.each_line(group_file) do |line|
130
+ data = line.chomp.split(':')
131
+ if data.last.split(',').include?(user)
132
+ @groups_of[user] << data.first
133
+ end
134
+ end
135
+
136
+ @groups_of[user]
137
+ end
138
+
96
139
  def shell=(value)
97
140
  check_valid_shell
98
141
  set(:shell, value)
99
142
  end
100
143
 
144
+ def groups=(value)
145
+ set(:groups, value)
146
+ end
147
+
101
148
  verify :gid, "GID must be an integer" do |value|
102
149
  value.is_a? Integer
103
150
  end
@@ -426,10 +426,10 @@ module Puppet
426
426
  end
427
427
 
428
428
  newparam(:source) do
429
- desc "Where to find the package file. This is only used by providers that don't
429
+ desc "Where to find the package file. This is mostly used by providers that don't
430
430
  automatically download packages from a central repository. (For example:
431
- the `yum` and `apt` providers ignore this attribute, but the `rpm` and
432
- `dpkg` providers require it.)
431
+ the `yum` provider ignores this attribute, `apt` provider uses it if present
432
+ and the `rpm` and `dpkg` providers require it.)
433
433
 
434
434
  Different providers accept different values for `source`. Most providers
435
435
  accept paths to local files stored on the target system. Some providers
@@ -191,7 +191,7 @@ module Puppet::Util::Windows
191
191
  SERVICE_CONFIG_PRESHUTDOWN_INFO = 0x00000007
192
192
  SERVICE_CONFIG_TRIGGER_INFO = 0x00000008
193
193
  SERVICE_CONFIG_PREFERRED_NODE = 0x00000009
194
- SERVICE_CONFIG_LAUNCH_PROTECTED = 0x00000012
194
+ SERVICE_CONFIG_LAUNCH_PROTECTED = 0x0000000C
195
195
  SERVICE_NO_CHANGE = 0xffffffff
196
196
  SERVICE_CONFIG_TYPES = {
197
197
  SERVICE_CONFIG_DESCRIPTION => :SERVICE_CONFIG_DESCRIPTION,
@@ -6,7 +6,7 @@
6
6
  # Raketasks and such to set the version based on the output of `git describe`
7
7
 
8
8
  module Puppet
9
- PUPPETVERSION = '6.20.0'
9
+ PUPPETVERSION = '6.21.0'
10
10
 
11
11
  ##
12
12
  # version is a public API method intended to always provide a fast and
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPETCONF" "5" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  \fBThis page is autogenerated; any changes will get overwritten\fR
6
6
  .
7
7
  .SH "Configuration settings"
@@ -931,7 +931,7 @@ The time to wait for data to be read from an HTTP connection\. If nothing is rea
931
931
  The HTTP User\-Agent string to send when making network requests\.
932
932
  .
933
933
  .IP "\(bu" 4
934
- \fIDefault\fR: Puppet/6\.20\.0 Ruby/2\.5\.1\-p57 (x86_64\-linux)
934
+ \fIDefault\fR: Puppet/6\.21\.0 Ruby/2\.5\.1\-p57 (x86_64\-linux)
935
935
  .
936
936
  .IP "" 0
937
937
  .
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-AGENT" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-agent\fR \- The puppet agent daemon
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-APPLY" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-apply\fR \- Apply Puppet manifests locally
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-CATALOG" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-catalog\fR \- Compile, save, view, and convert catalogs\.
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-CONFIG" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-config\fR \- Interact with Puppet\'s settings\.
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DESCRIBE" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-describe\fR \- Display help about resource types
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DEVICE" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-device\fR \- Manage remote network devices
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DOC" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-doc\fR \- Generate Puppet references
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-EPP" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-epp\fR \- Interact directly with the EPP template parser/renderer\.
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-FACTS" "8" "February 2021" "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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-FILEBUCKET" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-filebucket\fR \- Store and retrieve files in a filebucket
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-GENERATE" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-generate\fR \- Generates Puppet code from Ruby definitions\.
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-HELP" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-help\fR \- Display Puppet help\.
@@ -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\-KEY" "8" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-KEY" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-key\fR \- Create, save, and remove certificate keys\.
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-LOOKUP" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-lookup\fR \- Interactive Hiera lookup
@@ -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\-MAN" "8" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-MAN" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-man\fR \- Display Puppet manual pages\.
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-MODULE" "8" "February 2021" "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\.
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-NODE" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-node\fR \- View and manage node definitions\.
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-PARSER" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-parser\fR \- Interact directly with the parser\.
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-PLUGIN" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-plugin\fR \- Interact with the Puppet plugin system\.
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-REPORT" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-report\fR \- Create, display, and submit reports\.
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-RESOURCE" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-resource\fR \- The resource abstraction layer shell
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-SCRIPT" "8" "February 2021" "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
@@ -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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-SSL" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-ssl\fR \- Manage SSL keys and certificates for puppet SSL clients
@@ -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\-STATUS" "8" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-STATUS" "8" "February 2021" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-status\fR \- View puppet server status\.
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" "January 2021" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET" "8" "February 2021" "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 v6\.20\.0
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 v6\.21\.0
@@ -600,4 +600,37 @@ describe "puppet agent", unless: Puppet::Util::Platform.jruby? do
600
600
  expect(File).to_not be_exist(cached_catalog)
601
601
  end
602
602
  end
603
+
604
+ context "reporting" do
605
+ it "stores a finalized report" do
606
+ catalog_handler = -> (req, res) {
607
+ catalog = compile_to_catalog(<<-MANIFEST, node)
608
+ notify { 'foo':
609
+ require => Notify['bar']
610
+ }
611
+
612
+ notify { 'bar':
613
+ require => Notify['foo']
614
+ }
615
+ MANIFEST
616
+
617
+ res.body = formatter.render(catalog)
618
+ res['Content-Type'] = formatter.mime
619
+ }
620
+
621
+ server.start_server(mounts: {catalog: catalog_handler}) do |port|
622
+ Puppet[:serverport] = port
623
+ expect {
624
+ agent.command_line.args << '--test'
625
+ agent.run
626
+ }.to exit_with(1)
627
+ .and output(%r{Applying configuration}).to_stdout
628
+ .and output(%r{Found 1 dependency cycle}).to_stderr
629
+
630
+ report = Puppet::Transaction::Report.convert_from(:yaml, File.read(Puppet[:lastrunreport]))
631
+ expect(report.status).to eq("failed")
632
+ expect(report.metrics).to_not be_empty
633
+ end
634
+ end
635
+ end
603
636
  end
@@ -198,7 +198,10 @@ describe Puppet::Type.type(:group).provider(:groupadd) do
198
198
  end
199
199
 
200
200
  describe "#findgroup" do
201
- before { allow(File).to receive(:read).with('/etc/group').and_return(content) }
201
+ before do
202
+ allow(Puppet::FileSystem).to receive(:exist?).with('/etc/group').and_return(true)
203
+ allow(Puppet::FileSystem).to receive(:each_line).with('/etc/group').and_yield(content)
204
+ end
202
205
 
203
206
  let(:content) { "sample_group_name:sample_password:sample_gid:sample_user_list" }
204
207
  let(:output) do
@@ -221,7 +224,7 @@ describe Puppet::Type.type(:group).provider(:groupadd) do
221
224
  end
222
225
 
223
226
  it "reads the group file only once per resource" do
224
- expect(File).to receive(:read).with('/etc/group').once
227
+ expect(Puppet::FileSystem).to receive(:each_line).with('/etc/group').once
225
228
  5.times { provider.send(:findgroup, :group_name, 'sample_group_name') }
226
229
  end
227
230
  end
@@ -115,24 +115,12 @@ Version table:
115
115
  allow(provider).to receive(:dpkgquery).and_return("name: #{resource.name}" )
116
116
  end
117
117
 
118
- context "when package is manual marked" do
119
- before do
120
- allow(described_class).to receive(:aptmark).with('showmanual').and_return("#{resource.name}\n")
121
- end
122
-
123
- it 'sets mark to manual' do
124
- result = provider.query
125
- expect(result[:mark]).to eql(:manual)
126
- end
127
- end
128
-
129
- context 'when package is not manual marked ' do
130
- before do
131
- allow(described_class).to receive(:aptmark).with('showmanual').and_return('')
132
- end
133
118
 
119
+ context 'when package is not installed on the system' do
134
120
  it 'does not set mark to manual' do
135
121
  result = provider.query
122
+
123
+ expect(described_class).not_to receive(:aptmark)
136
124
  expect(result[:mark]).to be_nil
137
125
  end
138
126
  end
@@ -289,5 +277,26 @@ Version table:
289
277
 
290
278
  provider.install
291
279
  end
280
+
281
+ it "should install using the source attribute if present" do
282
+ resource[:ensure] = :installed
283
+ resource[:source] = '/my/local/package/file'
284
+
285
+ expect(provider).to receive(:aptget).with(any_args, :install, resource[:source])
286
+ expect(provider).to receive(:properties).and_return({:mark => :none})
287
+
288
+ provider.install
289
+ end
290
+
291
+ it "should install specific version using the source attribute if present" do
292
+ resource[:ensure] = '1.2.3'
293
+ resource[:source] = '/my/local/package/file'
294
+
295
+ expect(provider).to receive(:aptget).with(any_args, :install, resource[:source])
296
+ expect(provider).to receive(:properties).and_return({:mark => :none})
297
+ expect(provider).to receive(:query).and_return({:ensure => '1.2.3'})
298
+
299
+ provider.install
300
+ end
292
301
  end
293
302
  end
@@ -13,7 +13,7 @@ describe Puppet::Type.type(:package).provider(:aptitude) do
13
13
 
14
14
  before do
15
15
  allow(Puppet::Util).to receive(:which).with('/usr/bin/dpkg-query').and_return(dpkgquery_path)
16
- allow(described_class).to receive(:aptmark).with('showmanual').and_return("")
16
+ allow(described_class).to receive(:aptmark).with('showmanual', 'faff').and_return("")
17
17
  end
18
18
 
19
19
  { :absent => "deinstall ok config-files faff 1.2.3-1\n",
@@ -152,6 +152,7 @@ describe Puppet::Type.type(:user).provider(:useradd) do
152
152
 
153
153
  it "should not use -G for luseradd and should call usermod with -G after luseradd when groups property is set" do
154
154
  resource[:groups] = ['group1', 'group2']
155
+ allow(provider).to receive(:localgroups)
155
156
  expect(provider).to receive(:execute).with(include('/usr/sbin/luseradd').and(excluding('-G')), hash_including(custom_environment: hash_including('LIBUSER_CONF')))
156
157
  expect(provider).to receive(:execute).with(include('/usr/sbin/usermod').and(include('-G')), hash_including(custom_environment: hash_including('LIBUSER_CONF')))
157
158
  provider.create
@@ -337,7 +338,8 @@ describe Puppet::Type.type(:user).provider(:useradd) do
337
338
 
338
339
  it "should return the local comment string when forcelocal is true" do
339
340
  resource[:forcelocal] = true
340
- allow(File).to receive(:read).with('/etc/passwd').and_return(content)
341
+ allow(Puppet::FileSystem).to receive(:exist?).with('/etc/passwd').and_return(true)
342
+ allow(Puppet::FileSystem).to receive(:each_line).with('/etc/passwd').and_yield(content)
341
343
  expect(provider.comment).to eq('local comment')
342
344
  end
343
345
 
@@ -349,8 +351,58 @@ describe Puppet::Type.type(:user).provider(:useradd) do
349
351
  end
350
352
  end
351
353
 
354
+ describe "#gid" do
355
+ before { described_class.has_feature :manages_local_users_and_groups }
356
+
357
+ let(:content) { "myuser:x:x:999:x:x:x" }
358
+
359
+ it "should return the local GID when forcelocal is true" do
360
+ resource[:forcelocal] = true
361
+ allow(Puppet::FileSystem).to receive(:exist?).with('/etc/passwd').and_return(true)
362
+ allow(Puppet::FileSystem).to receive(:each_line).with('/etc/passwd').and_yield(content)
363
+ expect(provider.gid).to eq('999')
364
+ end
365
+
366
+ it "should fall back to nameservice GID when forcelocal is false" do
367
+ resource[:forcelocal] = false
368
+ allow(provider).to receive(:get).with(:gid).and_return('1234')
369
+ expect(provider).not_to receive(:localgid)
370
+ expect(provider.gid).to eq('1234')
371
+ end
372
+ end
373
+
374
+ describe "#groups" do
375
+ before { described_class.has_feature :manages_local_users_and_groups }
376
+
377
+ let(:content) do
378
+ <<~EOF
379
+ group1:x:0:myuser
380
+ group2:x:999:
381
+ group3:x:998:myuser
382
+ EOF
383
+ end
384
+
385
+ it "should return the local groups string when forcelocal is true" do
386
+ resource[:forcelocal] = true
387
+ group1, group2, group3 = content.split
388
+ allow(Puppet::FileSystem).to receive(:exist?).with('/etc/group').and_return(true)
389
+ allow(Puppet::FileSystem).to receive(:each_line).with('/etc/group').and_yield(group1).and_yield(group2).and_yield(group3)
390
+ expect(provider.groups).to eq(['group1', 'group3'])
391
+ end
392
+
393
+ it "should fall back to nameservice groups when forcelocal is false" do
394
+ resource[:forcelocal] = false
395
+ allow(Puppet::Util::POSIX).to receive(:groups_of).with('myuser').and_return(['remote groups'])
396
+ expect(provider).not_to receive(:localgroups)
397
+ expect(provider.groups).to eq('remote groups')
398
+ end
399
+ end
400
+
352
401
  describe "#finduser" do
353
- before { allow(File).to receive(:read).with('/etc/passwd').and_return(content) }
402
+ before do
403
+ allow(Puppet::FileSystem).to receive(:exist?).with('/etc/passwd').and_return(true)
404
+ allow(Puppet::FileSystem).to receive(:each_line).with('/etc/passwd').and_yield(content)
405
+ end
354
406
 
355
407
  let(:content) { "sample_account:sample_password:sample_uid:sample_gid:sample_gecos:sample_directory:sample_shell" }
356
408
  let(:output) do
@@ -376,7 +428,7 @@ describe Puppet::Type.type(:user).provider(:useradd) do
376
428
  end
377
429
 
378
430
  it "reads the user file only once per resource" do
379
- expect(File).to receive(:read).with('/etc/passwd').once
431
+ expect(Puppet::FileSystem).to receive(:each_line).with('/etc/passwd').once
380
432
  5.times { provider.finduser(:account, 'sample_account') }
381
433
  end
382
434
  end
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: 6.20.0
4
+ version: 6.21.0
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-18 00:00:00.000000000 Z
11
+ date: 2021-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter