puppet 6.4.3-x86-mingw32 → 6.4.4-x86-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 (104) hide show
  1. checksums.yaml +4 -4
  2. data/CODEOWNERS +9 -9
  3. data/Gemfile +2 -2
  4. data/Gemfile.lock +23 -23
  5. data/ext/project_data.yaml +2 -2
  6. data/install.rb +3 -21
  7. data/lib/puppet/application/agent.rb +12 -0
  8. data/lib/puppet/application/device.rb +14 -4
  9. data/lib/puppet/application/resource.rb +4 -4
  10. data/lib/puppet/defaults.rb +12 -0
  11. data/lib/puppet/face/config.rb +10 -48
  12. data/lib/puppet/face/facts.rb +1 -1
  13. data/lib/puppet/face/help.rb +1 -1
  14. data/lib/puppet/face/plugin.rb +9 -2
  15. data/lib/puppet/indirector/catalog/compiler.rb +11 -5
  16. data/lib/puppet/module_tool/tar/mini.rb +11 -1
  17. data/lib/puppet/network/http/factory.rb +1 -11
  18. data/lib/puppet/provider/file/posix.rb +5 -0
  19. data/lib/puppet/provider/nameservice.rb +10 -3
  20. data/lib/puppet/provider/package/dnf.rb +1 -1
  21. data/lib/puppet/provider/package/pip.rb +2 -2
  22. data/lib/puppet/provider/package/rpm.rb +51 -13
  23. data/lib/puppet/provider/package/yum.rb +8 -4
  24. data/lib/puppet/provider/service/launchd.rb +20 -5
  25. data/lib/puppet/provider/service/systemd.rb +5 -10
  26. data/lib/puppet/provider/service/windows.rb +8 -0
  27. data/lib/puppet/provider/user/pw.rb +12 -3
  28. data/lib/puppet/provider/user/user_role_add.rb +4 -0
  29. data/lib/puppet/provider/user/useradd.rb +23 -7
  30. data/lib/puppet/resource.rb +17 -0
  31. data/lib/puppet/settings.rb +40 -0
  32. data/lib/puppet/type/exec.rb +14 -6
  33. data/lib/puppet/type/package.rb +10 -0
  34. data/lib/puppet/type/service.rb +7 -2
  35. data/lib/puppet/util/execution.rb +4 -3
  36. data/lib/puppet/util/http_proxy.rb +19 -5
  37. data/lib/puppet/util/selinux.rb +5 -1
  38. data/lib/puppet/util/windows/security.rb +2 -0
  39. data/lib/puppet/util/windows/service.rb +149 -4
  40. data/lib/puppet/util/windows/sid.rb +1 -0
  41. data/lib/puppet/version.rb +1 -1
  42. data/locales/puppet.pot +168 -152
  43. data/man/man5/puppet.conf.5 +18 -2
  44. data/man/man8/puppet-agent.8 +1 -1
  45. data/man/man8/puppet-apply.8 +1 -1
  46. data/man/man8/puppet-catalog.8 +1 -1
  47. data/man/man8/puppet-config.8 +1 -1
  48. data/man/man8/puppet-describe.8 +1 -1
  49. data/man/man8/puppet-device.8 +1 -1
  50. data/man/man8/puppet-doc.8 +1 -1
  51. data/man/man8/puppet-epp.8 +1 -1
  52. data/man/man8/puppet-facts.8 +1 -1
  53. data/man/man8/puppet-filebucket.8 +1 -1
  54. data/man/man8/puppet-generate.8 +1 -1
  55. data/man/man8/puppet-help.8 +1 -1
  56. data/man/man8/puppet-key.8 +1 -1
  57. data/man/man8/puppet-lookup.8 +1 -1
  58. data/man/man8/puppet-man.8 +1 -1
  59. data/man/man8/puppet-module.8 +1 -1
  60. data/man/man8/puppet-node.8 +1 -1
  61. data/man/man8/puppet-parser.8 +1 -1
  62. data/man/man8/puppet-plugin.8 +1 -1
  63. data/man/man8/puppet-report.8 +1 -1
  64. data/man/man8/puppet-resource.8 +1 -1
  65. data/man/man8/puppet-script.8 +1 -1
  66. data/man/man8/puppet-ssl.8 +1 -1
  67. data/man/man8/puppet-status.8 +1 -1
  68. data/man/man8/puppet.8 +3 -3
  69. data/spec/integration/provider/service/systemd_spec.rb +8 -5
  70. data/spec/integration/type/file_spec.rb +28 -0
  71. data/spec/integration/util/execution_spec.rb +27 -0
  72. data/spec/unit/application/agent_spec.rb +20 -8
  73. data/spec/unit/application/device_spec.rb +27 -1
  74. data/spec/unit/face/facts_spec.rb +9 -0
  75. data/spec/unit/face/plugin_spec.rb +8 -0
  76. data/spec/unit/indirector/catalog/compiler_spec.rb +62 -5
  77. data/spec/unit/module_tool/tar/mini_spec.rb +1 -1
  78. data/spec/unit/network/http/api/indirected_routes_spec.rb +25 -10
  79. data/spec/unit/network/http/factory_spec.rb +27 -5
  80. data/spec/unit/pops/validator/validator_spec.rb +7 -0
  81. data/spec/unit/provider/package/aptrpm_spec.rb +1 -1
  82. data/spec/unit/provider/package/dnf_spec.rb +7 -0
  83. data/spec/unit/provider/package/dpkg_spec.rb +2 -2
  84. data/spec/unit/provider/package/pip_spec.rb +8 -0
  85. data/spec/unit/provider/package/rpm_spec.rb +150 -16
  86. data/spec/unit/provider/package/yum_spec.rb +7 -0
  87. data/spec/unit/provider/service/launchd_spec.rb +28 -0
  88. data/spec/unit/provider/service/systemd_spec.rb +14 -0
  89. data/spec/unit/provider/service/windows_spec.rb +20 -0
  90. data/spec/unit/provider/user/pw_spec.rb +37 -0
  91. data/spec/unit/provider/user/useradd_spec.rb +42 -0
  92. data/spec/unit/resource_spec.rb +26 -1
  93. data/spec/unit/transaction_spec.rb +18 -0
  94. data/spec/unit/type/exec_spec.rb +9 -0
  95. data/spec/unit/type/file/source_spec.rb +4 -4
  96. data/spec/unit/type/schedule_spec.rb +3 -1
  97. data/spec/unit/type/service_spec.rb +16 -0
  98. data/spec/unit/util/http_proxy_spec.rb +40 -1
  99. data/spec/unit/util/log_spec.rb +27 -1
  100. data/spec/unit/util/windows/service_spec.rb +9 -0
  101. metadata +5 -9
  102. data/ext/windows/eventlog/Rakefile +0 -32
  103. data/ext/windows/eventlog/puppetres.dll +0 -0
  104. data/ext/windows/eventlog/puppetres.mc +0 -18
@@ -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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPETCONF" "5" "October 2019" "Puppet, Inc." "Puppet manual"
5
5
  \fBThis page is autogenerated; any changes will get overwritten\fR
6
6
  .
7
7
  .SH "Configuration settings"
@@ -433,6 +433,14 @@ Boolean; whether to generate the default schedule resources\. Setting this to fa
433
433
  .
434
434
  .IP "" 0
435
435
  .
436
+ .SS "deviceconfdir"
437
+ The root directory of devices\' $confdir\.
438
+ .
439
+ .IP "\(bu" 4
440
+ \fIDefault\fR: $confdir/devices
441
+ .
442
+ .IP "" 0
443
+ .
436
444
  .SS "deviceconfig"
437
445
  Path to the device config file for puppet device\.
438
446
  .
@@ -876,7 +884,7 @@ The time to wait for data to be read from an HTTP connection\. If nothing is rea
876
884
  The HTTP User\-Agent string to send when making network requests\.
877
885
  .
878
886
  .IP "\(bu" 4
879
- \fIDefault\fR: Puppet/6\.4\.3 Ruby/2\.4\.1\-p111 (x86_64\-linux)
887
+ \fIDefault\fR: Puppet/6\.4\.4 Ruby/2\.4\.1\-p111 (x86_64\-linux)
880
888
  .
881
889
  .IP "" 0
882
890
  .
@@ -1184,6 +1192,14 @@ The name of the application, if we are running as one\. The default is essential
1184
1192
  .TP
1185
1193
  \fIDefault\fR:
1186
1194
 
1195
+ .
1196
+ .SS "no_proxy"
1197
+ List of domain names that should not go through \fBhttp_proxy_host\fR\. Environment variable no_proxy or NO_PROXY will override this value\.
1198
+ .
1199
+ .IP "\(bu" 4
1200
+ \fIDefault\fR: localhost, 127\.0\.0\.1
1201
+ .
1202
+ .IP "" 0
1187
1203
  .
1188
1204
  .SS "node_cache_terminus"
1189
1205
  How to store cached nodes\. Valid values are (none), \'json\', \'msgpack\', or \'yaml\'\.
@@ -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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-AGENT" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-APPLY" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-CATALOG" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-CONFIG" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DESCRIBE" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DEVICE" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-DOC" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-EPP" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-FACTS" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-FILEBUCKET" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-GENERATE" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-HELP" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-KEY" "8" "October 2019" "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 "LOOKUP" "8" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "LOOKUP" "8" "October 2019" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBlookup\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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-MAN" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-MODULE" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-NODE" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-PARSER" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-PLUGIN" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-REPORT" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-RESOURCE" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-SCRIPT" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-SSL" "8" "October 2019" "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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET\-STATUS" "8" "October 2019" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\-status\fR \- View puppet server status\.
@@ -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" "July 2019" "Puppet, Inc." "Puppet manual"
4
+ .TH "PUPPET" "8" "October 2019" "Puppet, Inc." "Puppet manual"
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBpuppet\fR
@@ -22,7 +22,7 @@ agent The puppet agent daemon apply Apply Puppet manifests locally config Intera
22
22
  Specialized:
23
23
  .
24
24
  .br
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\. script Run a puppet manifests as a script without compiling a catalog ssl Manage SSL keys and certificates for puppet SSL clients
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\.4\.3
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\.4\.4
@@ -7,16 +7,19 @@ describe test_title, unless: Puppet::Util::Platform.jruby? do
7
7
 
8
8
  # TODO: Unfortunately there does not seem a way to stub the executable
9
9
  # checks in the systemd provider because they happen at load time.
10
- it "should be considered suitable if /bin/systemctl is present", :if => File.executable?('/bin/systemctl') do
10
+
11
+ it "should be considered suitable if /proc/1/comm is present and contains 'systemd'",
12
+ :if => File.exist?('/proc/1/comm') && Puppet::FileSystem.read('/proc/1/comm').include?('systemd') do
11
13
  expect(provider_class).to be_suitable
12
14
  end
13
15
 
14
- it "should be considered suitable if /usr/bin/systemctl is present", :if => File.executable?('/usr/bin/systemctl') do
15
- expect(provider_class).to be_suitable
16
+ it "should not be considered suitable if /proc/1/comm is present it does not contain 'systemd'",
17
+ :if => File.exist?('/proc/1/comm') && !Puppet::FileSystem.read('/proc/1/comm').include?('systemd') do
18
+ expect(provider_class).not_to be_suitable
16
19
  end
17
20
 
18
- it "should not be cosidered suitable if systemctl is absent",
19
- :unless => (File.executable?('/bin/systemctl') or File.executable?('/usr/bin/systemctl')) do
21
+ it "should not be considered suitable if /proc/1/comm is absent",
22
+ :if => !File.exist?('/proc/1/comm') do
20
23
  expect(provider_class).not_to be_suitable
21
24
  end
22
25
  end
@@ -21,6 +21,13 @@ describe Puppet::Type.type(:file), :uses_checksums => true do
21
21
  File.join(parent, 'file_testing')
22
22
  end
23
23
 
24
+ let(:path_protected) do
25
+ # we create a file inside windows protected folders (C:\Windows, C:\Windows\system32, etc)
26
+ # the file will also be removed after the tests
27
+ parent = 'C:\Windows'
28
+ File.join(parent, 'file_testing')
29
+ end
30
+
24
31
  let(:dir) do
25
32
  # we create a directory first so backups of :path that are stored in
26
33
  # the same directory will also be removed after the tests
@@ -268,6 +275,27 @@ describe Puppet::Type.type(:file), :uses_checksums => true do
268
275
  expect(get_mode(path) & 07777).to eq(0666)
269
276
  end
270
277
 
278
+ context "file is in protected windows directory", :if => Puppet.features.microsoft_windows? do
279
+ after { FileUtils.rm(path_protected) }
280
+
281
+ it "should set and get the correct mode for files inside protected windows folders" do
282
+ catalog.add_resource described_class.new(:path => path_protected, :ensure => :file, :mode => '0640')
283
+ catalog.apply
284
+
285
+ expect(get_mode(path_protected) & 07777).to eq(0640)
286
+ end
287
+
288
+ it "should not change resource's status inside protected windows folders if mode is the same" do
289
+ FileUtils.touch(path_protected)
290
+ set_mode(0644, path_protected)
291
+ catalog.add_resource described_class.new(:path => path_protected, :ensure => :file, :mode => '0644')
292
+ result = catalog.apply
293
+ status = result.report.resource_statuses["File[#{path_protected}]"]
294
+ expect(status).not_to be_failed
295
+ expect(status).not_to be_changed
296
+ end
297
+ end
298
+
271
299
  it "should not set executable bits when replacing an executable directory (#10365)" do
272
300
  pending("bug #10365")
273
301
 
@@ -25,6 +25,33 @@ describe Puppet::Util::Execution, unless: Puppet::Util::Platform.jruby? do
25
25
  end
26
26
  end
27
27
 
28
+ describe "#execute" do
29
+ if Puppet::Util::Platform.windows?
30
+ let(:argv) { ["cmd", "/c", "echo", 123] }
31
+ else
32
+ let(:argv) { ["echo", 123] }
33
+ end
34
+
35
+ it 'stringifies sensitive arguments when given an array containing integers' do
36
+ result = Puppet::Util::Execution.execute(argv, sensitive: true)
37
+ expect(result.to_s.strip).to eq("123")
38
+ expect(result.exitstatus).to eq(0)
39
+ end
40
+
41
+ it 'redacts sensitive arguments when given an array' do
42
+ Puppet[:log_level] = :debug
43
+ Puppet::Util::Execution.execute(argv, sensitive: true)
44
+ expect(@logs).to include(an_object_having_attributes(level: :debug, message: "Executing: '[redacted]'"))
45
+ end
46
+
47
+ it 'redacts sensitive arguments when given a string' do
48
+ Puppet[:log_level] = :debug
49
+ str = argv.map(&:to_s).join(' ')
50
+ Puppet::Util::Execution.execute(str, sensitive: true)
51
+ expect(@logs).to include(an_object_having_attributes(level: :debug, message: "Executing: '[redacted]'"))
52
+ end
53
+ end
54
+
28
55
  describe "#execute (non-Windows)", :if => !Puppet::Util::Platform.windows? do
29
56
  it "should execute basic shell command" do
30
57
  result = Puppet::Util::Execution.execute("ls /tmp", :failonfail => true)
@@ -30,6 +30,7 @@ describe Puppet::Application::Agent do
30
30
  allow(Puppet::Node::Facts.indirection).to receive(:terminus_class=)
31
31
 
32
32
  allow(Puppet.settings).to receive(:use)
33
+ allow(Puppet::SSL::StateMachine).to receive(:new).and_return(machine)
33
34
  end
34
35
 
35
36
  it "should operate in agent run_mode" do
@@ -393,8 +394,6 @@ describe Puppet::Application::Agent do
393
394
  it "should inform the daemon about our agent if :client is set to 'true'" do
394
395
  @puppetd.options[:client] = true
395
396
 
396
- allow(Puppet::SSL::StateMachine).to receive(:new).and_return(machine)
397
-
398
397
  execute_agent
399
398
 
400
399
  expect(@daemon.agent).to eq(@agent)
@@ -405,8 +404,6 @@ describe Puppet::Application::Agent do
405
404
  Puppet[:daemonize] = true
406
405
  allow(Signal).to receive(:trap)
407
406
 
408
- allow(Puppet::SSL::StateMachine).to receive(:new).and_return(machine)
409
-
410
407
  expect(@daemon).to receive(:daemonize)
411
408
 
412
409
  execute_agent
@@ -470,7 +467,6 @@ describe Puppet::Application::Agent do
470
467
 
471
468
  it "should dispatch to onetime if --onetime is used" do
472
469
  Puppet[:onetime] = true
473
- allow(Puppet::SSL::StateMachine).to receive(:new).and_return(machine)
474
470
 
475
471
  expect(@puppetd).to receive(:onetime)
476
472
 
@@ -479,7 +475,6 @@ describe Puppet::Application::Agent do
479
475
 
480
476
  it "should dispatch to main if --onetime and --fingerprint are not used" do
481
477
  Puppet[:onetime] = false
482
- allow(Puppet::SSL::StateMachine).to receive(:new).and_return(machine)
483
478
 
484
479
  expect(@puppetd).to receive(:main)
485
480
 
@@ -493,7 +488,7 @@ describe Puppet::Application::Agent do
493
488
  @puppetd.options[:client] = :client
494
489
  @puppetd.options[:detailed_exitcodes] = false
495
490
 
496
- allow(Puppet::SSL::StateMachine).to receive(:new).and_return(machine)
491
+
497
492
  end
498
493
 
499
494
  it "should setup traps" do
@@ -592,7 +587,6 @@ describe Puppet::Application::Agent do
592
587
  describe "without --onetime and --fingerprint" do
593
588
  before :each do
594
589
  allow(Puppet).to receive(:notice)
595
- allow(Puppet::SSL::StateMachine).to receive(:new).and_return(machine)
596
590
  end
597
591
 
598
592
  it "should start our daemon" do
@@ -603,6 +597,24 @@ describe Puppet::Application::Agent do
603
597
  end
604
598
  end
605
599
 
600
+ describe "when starting in daemon mode on non-windows", :unless => Puppet.features.microsoft_windows? do
601
+ before :each do
602
+ allow(Puppet).to receive(:notice)
603
+ Puppet[:daemonize] = true
604
+ end
605
+
606
+ it "should not print config in default mode" do
607
+ execute_agent
608
+ expect(@logs).to be_empty
609
+ end
610
+
611
+ it "should print config in debug mode" do
612
+ @puppetd.options[:debug] = true
613
+ execute_agent
614
+ expect(@logs).to include(an_object_having_attributes(level: :debug, message: /agent_catalog_run_lockfile=/))
615
+ end
616
+ end
617
+
606
618
  def execute_agent
607
619
  @puppetd.setup
608
620
  @puppetd.run_command