puppet 6.24.0-x64-mingw32 → 6.25.0-x64-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/Gemfile.lock +12 -12
- data/{ext → examples/enc}/regexp_nodes/classes/databases +0 -0
- data/{ext → examples/enc}/regexp_nodes/classes/webservers +0 -0
- data/{ext → examples/enc}/regexp_nodes/environment/development +0 -0
- data/{ext → examples/enc}/regexp_nodes/parameters/service/prod +0 -0
- data/{ext → examples/enc}/regexp_nodes/parameters/service/qa +0 -0
- data/{ext → examples/enc}/regexp_nodes/parameters/service/sandbox +0 -0
- data/{ext → examples/enc}/regexp_nodes/regexp_nodes.rb +0 -0
- data/{ext → examples}/nagios/check_puppet.rb +2 -2
- data/ext/README.md +13 -0
- data/lib/puppet/application/agent.rb +4 -0
- data/lib/puppet/application/apply.rb +20 -2
- data/lib/puppet/application/resource.rb +15 -13
- data/lib/puppet/concurrent/thread_local_singleton.rb +1 -0
- data/lib/puppet/configurer.rb +85 -57
- data/lib/puppet/confine/variable.rb +1 -1
- data/lib/puppet/defaults.rb +36 -30
- data/lib/puppet/environments.rb +66 -26
- data/lib/puppet/face/facts.rb +1 -1
- data/lib/puppet/facter_impl.rb +96 -0
- data/lib/puppet/file_serving/configuration/parser.rb +2 -0
- data/lib/puppet/file_serving/configuration.rb +3 -0
- data/lib/puppet/file_serving/mount/file.rb +4 -4
- data/lib/puppet/file_serving/mount/scripts.rb +24 -0
- data/lib/puppet/file_system/file_impl.rb +3 -1
- data/lib/puppet/forge.rb +1 -1
- data/lib/puppet/functions/find_template.rb +2 -2
- data/lib/puppet/http/service/compiler.rb +6 -1
- data/lib/puppet/indirector/catalog/compiler.rb +24 -6
- data/lib/puppet/indirector/catalog/rest.rb +1 -0
- data/lib/puppet/indirector/facts/facter.rb +6 -6
- data/lib/puppet/indirector/indirection.rb +1 -1
- data/lib/puppet/indirector/terminus.rb +4 -0
- data/lib/puppet/module/plan.rb +0 -1
- data/lib/puppet/module/task.rb +1 -1
- data/lib/puppet/module.rb +1 -0
- data/lib/puppet/module_tool/applications/installer.rb +8 -4
- data/lib/puppet/module_tool/applications/uninstaller.rb +1 -1
- data/lib/puppet/module_tool/applications/upgrader.rb +1 -1
- data/lib/puppet/network/http/api/indirected_routes.rb +1 -1
- data/lib/puppet/node/environment.rb +10 -11
- data/lib/puppet/pal/pal_impl.rb +1 -1
- data/lib/puppet/parser/scope.rb +1 -0
- data/lib/puppet/parser/templatewrapper.rb +1 -0
- data/lib/puppet/pops/lookup/lookup_adapter.rb +3 -2
- data/lib/puppet/pops/model/ast.rb +1 -0
- data/lib/puppet/pops/model/factory.rb +2 -1
- data/lib/puppet/pops/parser/eparser.rb +201 -201
- data/lib/puppet/pops/parser/lexer2.rb +92 -91
- data/lib/puppet/pops/parser/slurp_support.rb +1 -0
- data/lib/puppet/pops/serialization/to_data_converter.rb +18 -6
- data/lib/puppet/pops/serialization/to_stringified_converter.rb +1 -1
- data/lib/puppet/pops/types/type_formatter.rb +4 -3
- data/lib/puppet/pops/types/types.rb +1 -1
- data/lib/puppet/provider/aix_object.rb +1 -1
- data/lib/puppet/provider/group/groupadd.rb +5 -2
- data/lib/puppet/provider/package/pkg.rb +19 -2
- data/lib/puppet/provider/package/puppetserver_gem.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +1 -1
- data/lib/puppet/provider/service/base.rb +1 -1
- data/lib/puppet/provider/service/init.rb +5 -5
- data/lib/puppet/provider/service/launchd.rb +2 -2
- data/lib/puppet/provider/service/redhat.rb +1 -1
- data/lib/puppet/provider/service/smf.rb +3 -3
- data/lib/puppet/provider/service/systemd.rb +2 -2
- data/lib/puppet/provider/service/upstart.rb +5 -5
- data/lib/puppet/provider/user/aix.rb +44 -1
- data/lib/puppet/provider/user/directoryservice.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +72 -16
- data/lib/puppet/provider.rb +1 -1
- data/lib/puppet/reference/providers.rb +2 -2
- data/lib/puppet/resource/type_collection.rb +1 -0
- data/lib/puppet/runtime.rb +11 -1
- data/lib/puppet/settings.rb +2 -2
- data/lib/puppet/test/test_helper.rb +4 -1
- data/lib/puppet/transaction/persistence.rb +11 -1
- data/lib/puppet/transaction/report.rb +15 -1
- data/lib/puppet/type/exec.rb +19 -2
- data/lib/puppet/type/file.rb +6 -6
- data/lib/puppet/type/filebucket.rb +3 -3
- data/lib/puppet/type/group.rb +0 -1
- data/lib/puppet/type/resources.rb +1 -1
- data/lib/puppet/type/service.rb +8 -3
- data/lib/puppet/type/user.rb +0 -1
- data/lib/puppet/type.rb +1 -1
- data/lib/puppet/util/command_line.rb +1 -1
- data/lib/puppet/util/filetype.rb +2 -2
- data/lib/puppet/util/json.rb +3 -0
- data/lib/puppet/util/log.rb +1 -2
- data/lib/puppet/util/logging.rb +1 -25
- data/lib/puppet/util/pidlock.rb +1 -1
- data/lib/puppet/util/rdoc/parser/puppet_parser_core.rb +1 -1
- data/lib/puppet/util/suidmanager.rb +1 -2
- data/lib/puppet/util/tagging.rb +1 -0
- data/lib/puppet/util/windows/user.rb +0 -2
- data/lib/puppet/util.rb +4 -3
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet.rb +2 -6
- data/locales/puppet.pot +246 -230
- data/man/man5/puppet.conf.5 +33 -25
- data/man/man8/puppet-agent.8 +4 -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 +3 -3
- 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 +2 -2
- data/spec/fixtures/integration/application/agent/lib/facter/agent_spec_role.rb +3 -0
- data/spec/fixtures/integration/l10n/envs/prod/modules/demo/Gemfile +4 -0
- data/spec/fixtures/integration/l10n/envs/prod/modules/demo/Rakefile +3 -0
- data/spec/fixtures/integration/l10n/envs/prod/modules/demo/lib/puppet/functions/l10n.rb +8 -0
- data/spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/config.yaml +25 -0
- data/spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/ja/puppet-l10n.po +19 -0
- data/spec/fixtures/integration/l10n/envs/prod/modules/demo/locales/puppet-l10n.pot +20 -0
- data/spec/fixtures/integration/l10n/envs/prod/modules/demo/metadata.json +8 -0
- data/spec/integration/application/agent_spec.rb +113 -37
- data/spec/integration/application/filebucket_spec.rb +5 -0
- data/spec/integration/configurer_spec.rb +18 -2
- data/spec/integration/indirector/facts/facter_spec.rb +3 -3
- data/spec/integration/l10n/compiler_spec.rb +37 -0
- data/spec/integration/transaction/report_spec.rb +1 -1
- data/spec/integration/type/file_spec.rb +2 -2
- data/spec/integration/type/package_spec.rb +6 -6
- data/spec/integration/util/rdoc/parser_spec.rb +1 -1
- data/spec/integration/util/windows/process_spec.rb +1 -9
- data/spec/lib/puppet_spec/modules.rb +13 -2
- data/spec/lib/puppet_spec/puppetserver.rb +15 -0
- data/spec/shared_behaviours/documentation_on_faces.rb +0 -2
- data/spec/shared_contexts/l10n.rb +27 -0
- data/spec/spec_helper.rb +1 -10
- data/spec/unit/application/apply_spec.rb +76 -56
- data/spec/unit/application/resource_spec.rb +29 -0
- data/spec/unit/configurer_spec.rb +171 -56
- data/spec/unit/defaults_spec.rb +1 -0
- data/spec/unit/environments_spec.rb +150 -1
- data/spec/unit/facter_impl_spec.rb +31 -0
- data/spec/unit/file_bucket/dipper_spec.rb +2 -2
- data/spec/unit/file_serving/configuration/parser_spec.rb +23 -0
- data/spec/unit/file_serving/configuration_spec.rb +14 -4
- data/spec/unit/file_serving/mount/scripts_spec.rb +69 -0
- data/spec/unit/file_system_spec.rb +7 -0
- data/spec/unit/functions/logging_spec.rb +1 -0
- data/spec/unit/functions/lookup_spec.rb +64 -0
- data/spec/unit/http/service/compiler_spec.rb +8 -0
- data/spec/unit/indirector/catalog/compiler_spec.rb +87 -0
- data/spec/unit/indirector/catalog/rest_spec.rb +8 -0
- data/spec/unit/indirector/indirection_spec.rb +10 -3
- data/spec/unit/interface/action_spec.rb +0 -9
- data/spec/unit/module_spec.rb +15 -1
- data/spec/unit/module_tool/applications/installer_spec.rb +39 -12
- data/spec/unit/network/authstore_spec.rb +0 -15
- data/spec/unit/network/formats_spec.rb +6 -0
- data/spec/unit/pops/parser/parse_containers_spec.rb +0 -11
- data/spec/unit/pops/serialization/to_from_hr_spec.rb +58 -0
- data/spec/unit/pops/serialization/to_stringified_spec.rb +5 -0
- data/spec/unit/pops/types/type_calculator_spec.rb +6 -0
- data/spec/unit/provider/package/gem_spec.rb +1 -1
- data/spec/unit/provider/package/pip2_spec.rb +1 -1
- data/spec/unit/provider/package/pip3_spec.rb +1 -1
- data/spec/unit/provider/package/pip_spec.rb +1 -1
- data/spec/unit/provider/package/pkg_spec.rb +29 -4
- data/spec/unit/provider/package/puppet_gem_spec.rb +1 -1
- data/spec/unit/provider/package/puppetserver_gem_spec.rb +1 -1
- data/spec/unit/provider/service/launchd_spec.rb +11 -0
- data/spec/unit/provider/service/systemd_spec.rb +1 -1
- data/spec/unit/provider/user/aix_spec.rb +100 -0
- data/spec/unit/provider/user/directoryservice_spec.rb +1 -1
- data/spec/unit/provider/user/useradd_spec.rb +43 -2
- data/spec/unit/provider_spec.rb +4 -4
- data/spec/unit/puppet_spec.rb +12 -4
- data/spec/unit/ssl/certificate_request_spec.rb +8 -14
- data/spec/unit/type/service_spec.rb +27 -0
- data/spec/unit/type_spec.rb +2 -2
- data/spec/unit/util/logging_spec.rb +2 -0
- data/tasks/parallel.rake +3 -3
- metadata +37 -94
- data/ext/README.environment +0 -8
- data/ext/dbfix.sql +0 -132
- data/ext/debian/README.Debian +0 -8
- data/ext/debian/README.source +0 -2
- data/ext/debian/TODO.Debian +0 -1
- data/ext/debian/changelog.erb +0 -1122
- data/ext/debian/compat +0 -1
- data/ext/debian/control +0 -144
- data/ext/debian/copyright +0 -339
- data/ext/debian/docs +0 -1
- data/ext/debian/fileserver.conf +0 -41
- data/ext/debian/puppet-common.dirs +0 -13
- data/ext/debian/puppet-common.install +0 -3
- data/ext/debian/puppet-common.lintian-overrides +0 -5
- data/ext/debian/puppet-common.manpages +0 -28
- data/ext/debian/puppet-common.postinst +0 -35
- data/ext/debian/puppet-common.postrm +0 -33
- data/ext/debian/puppet-el.dirs +0 -1
- data/ext/debian/puppet-el.emacsen-install +0 -25
- data/ext/debian/puppet-el.emacsen-remove +0 -11
- data/ext/debian/puppet-el.emacsen-startup +0 -9
- data/ext/debian/puppet-el.install +0 -1
- data/ext/debian/puppet-testsuite.install +0 -2
- data/ext/debian/puppet-testsuite.lintian-overrides +0 -4
- data/ext/debian/puppet.lintian-overrides +0 -3
- data/ext/debian/puppet.logrotate +0 -20
- data/ext/debian/puppet.postinst +0 -20
- data/ext/debian/puppet.postrm +0 -20
- data/ext/debian/puppet.preinst +0 -20
- data/ext/debian/puppetmaster-common.install +0 -2
- data/ext/debian/puppetmaster-common.manpages +0 -2
- data/ext/debian/puppetmaster-common.postinst +0 -6
- data/ext/debian/puppetmaster-passenger.dirs +0 -4
- data/ext/debian/puppetmaster-passenger.postinst +0 -162
- data/ext/debian/puppetmaster-passenger.postrm +0 -61
- data/ext/debian/puppetmaster.README.debian +0 -17
- data/ext/debian/puppetmaster.default +0 -14
- data/ext/debian/puppetmaster.init +0 -137
- data/ext/debian/puppetmaster.lintian-overrides +0 -3
- data/ext/debian/puppetmaster.postinst +0 -20
- data/ext/debian/puppetmaster.postrm +0 -5
- data/ext/debian/puppetmaster.preinst +0 -22
- data/ext/debian/rules +0 -132
- data/ext/debian/source/format +0 -1
- data/ext/debian/source/options +0 -1
- data/ext/debian/vim-puppet.README.Debian +0 -13
- data/ext/debian/vim-puppet.dirs +0 -5
- data/ext/debian/vim-puppet.yaml +0 -7
- data/ext/debian/watch +0 -2
- data/ext/freebsd/puppetd +0 -26
- data/ext/freebsd/puppetmasterd +0 -26
- data/ext/gentoo/conf.d/puppet +0 -5
- data/ext/gentoo/conf.d/puppetmaster +0 -12
- data/ext/gentoo/init.d/puppet +0 -38
- data/ext/gentoo/init.d/puppetmaster +0 -51
- data/ext/gentoo/puppet/fileserver.conf +0 -41
- data/ext/ips/puppet-agent +0 -44
- data/ext/ips/puppet-master +0 -44
- data/ext/ips/puppet.p5m.erb +0 -12
- data/ext/ips/puppetagent.xml +0 -42
- data/ext/ips/puppetmaster.xml +0 -42
- data/ext/ips/rules +0 -19
- data/ext/ips/transforms +0 -34
- data/ext/ldap/puppet.schema +0 -24
- data/ext/logcheck/puppet +0 -23
- data/ext/osx/file_mapping.yaml +0 -33
- data/ext/osx/postflight.erb +0 -109
- data/ext/osx/preflight.erb +0 -52
- data/ext/osx/prototype.plist.erb +0 -38
- data/ext/redhat/fileserver.conf +0 -41
- data/ext/redhat/logrotate +0 -21
- data/ext/redhat/puppet.spec.erb +0 -842
- data/ext/redhat/server.init +0 -128
- data/ext/redhat/server.sysconfig +0 -13
- data/ext/solaris/pkginfo +0 -6
- data/ext/solaris/smf/puppetd.xml +0 -77
- data/ext/solaris/smf/puppetmasterd.xml +0 -77
- data/ext/solaris/smf/svc-puppetd +0 -71
- data/ext/solaris/smf/svc-puppetmasterd +0 -67
- data/ext/suse/puppet.spec +0 -310
- data/ext/suse/server.init +0 -173
- data/ext/yaml_nodes.rb +0 -105
- data/spec/unit/indirector/store_configs_spec.rb +0 -7
    
        data/lib/puppet/defaults.rb
    CHANGED
    
    | @@ -3,7 +3,7 @@ require 'puppet/util/platform' | |
| 3 3 | 
             
            module Puppet
         | 
| 4 4 |  | 
| 5 5 | 
             
              def self.default_diffargs
         | 
| 6 | 
            -
                if ( | 
| 6 | 
            +
                if (Puppet.runtime[:facter].value(:kernel) == "AIX" && Puppet.runtime[:facter].value(:kernelmajversion) == "5300")
         | 
| 7 7 | 
             
                  ""
         | 
| 8 8 | 
             
                else
         | 
| 9 9 | 
             
                  "-u"
         | 
| @@ -90,7 +90,7 @@ module Puppet | |
| 90 90 | 
             
                      This setting is still experimental.',
         | 
| 91 91 | 
             
                    :hook    => proc do |value|
         | 
| 92 92 | 
             
                      value = munge(value)
         | 
| 93 | 
            -
                      if value && Puppet::Util::Package.versioncmp( | 
| 93 | 
            +
                      if value && Puppet::Util::Package.versioncmp(Puppet.runtime[:facter].value('facterversion'), '4.0.0') < 0
         | 
| 94 94 | 
             
                        begin
         | 
| 95 95 | 
             
                          original_facter = Object.const_get(:Facter)
         | 
| 96 96 | 
             
                          Object.send(:remove_const, :Facter)
         | 
| @@ -218,7 +218,7 @@ module Puppet | |
| 218 218 |  | 
| 219 219 | 
             
                    The strictness level is for both language semantics and runtime
         | 
| 220 220 | 
             
                    evaluation validation. In addition to controlling the behavior with
         | 
| 221 | 
            -
                    this  | 
| 221 | 
            +
                    this primary server switch some individual warnings may also be controlled
         | 
| 222 222 | 
             
                    by the disable_warnings setting.
         | 
| 223 223 |  | 
| 224 224 | 
             
                    No new validations will be added to a micro (x.y.z) release,
         | 
| @@ -262,7 +262,7 @@ module Puppet | |
| 262 262 | 
             
                      internal Ruby stack trace interleaved with Puppet function frames.",
         | 
| 263 263 | 
             
                    :hook     => proc do |value|
         | 
| 264 264 | 
             
                      # Enable or disable Facter's trace option too
         | 
| 265 | 
            -
                       | 
| 265 | 
            +
                      Puppet.runtime[:facter].trace(value)
         | 
| 266 266 | 
             
                    end
         | 
| 267 267 | 
             
                },
         | 
| 268 268 | 
             
                :puppet_trace => {
         | 
| @@ -294,7 +294,7 @@ module Puppet | |
| 294 294 | 
             
                  :default    => true,
         | 
| 295 295 | 
             
                  :type       => :boolean,
         | 
| 296 296 | 
             
                  :desc       => "Whether to compile a [static catalog](https://puppet.com/docs/puppet/latest/static_catalogs.html#enabling-or-disabling-static-catalogs),
         | 
| 297 | 
            -
                    which occurs only on  | 
| 297 | 
            +
                    which occurs only on Puppet Server when the `code-id-command` and
         | 
| 298 298 | 
             
                    `code-content-command` settings are configured in its `puppetserver.conf` file.",
         | 
| 299 299 | 
             
                },
         | 
| 300 300 | 
             
                :strict_environment_mode => {
         | 
| @@ -412,13 +412,13 @@ module Puppet | |
| 412 412 | 
             
                    :default  => "production",
         | 
| 413 413 | 
             
                    :desc     => "The environment in which Puppet is running. For clients,
         | 
| 414 414 | 
             
                      such as `puppet agent`, this determines the environment itself, which
         | 
| 415 | 
            -
                      Puppet uses to find modules and much more. For servers, such as `puppet  | 
| 415 | 
            +
                      Puppet uses to find modules and much more. For servers, such as `puppet server`,
         | 
| 416 416 | 
             
                      this provides the default environment for nodes that Puppet knows nothing about.
         | 
| 417 417 |  | 
| 418 418 | 
             
                      When defining an environment in the `[agent]` section, this refers to the
         | 
| 419 | 
            -
                      environment that the agent requests from the  | 
| 419 | 
            +
                      environment that the agent requests from the primary server. The environment doesn't
         | 
| 420 420 | 
             
                      have to exist on the local filesystem because the agent fetches it from the
         | 
| 421 | 
            -
                       | 
| 421 | 
            +
                      primary server. This definition is used when running `puppet agent`.
         | 
| 422 422 |  | 
| 423 423 | 
             
                      When defined in the `[user]` section, the environment refers to the path that
         | 
| 424 424 | 
             
                      Puppet uses to search for code and modules related to its execution. This
         | 
| @@ -830,7 +830,7 @@ Valid values are 0 (never cache) and 15 (15 second minimum wait time). | |
| 830 830 | 
             
                :certname => {
         | 
| 831 831 | 
             
                  :default => lambda { Puppet::Settings.default_certname.downcase },
         | 
| 832 832 | 
             
                  :desc => "The name to use when handling certificates. When a node
         | 
| 833 | 
            -
                    requests a certificate from the CA  | 
| 833 | 
            +
                    requests a certificate from the CA Puppet Server, it uses the value of the
         | 
| 834 834 | 
             
                    `certname` setting as its requested Subject CN.
         | 
| 835 835 |  | 
| 836 836 | 
             
                    This is the name used when managing a node's permissions in
         | 
| @@ -893,7 +893,7 @@ EOT | |
| 893 893 | 
             
                  :desc => <<EOT
         | 
| 894 894 | 
             
            An optional file containing custom attributes to add to certificate signing
         | 
| 895 895 | 
             
            requests (CSRs). You should ensure that this file does not exist on your CA
         | 
| 896 | 
            -
             | 
| 896 | 
            +
            Puppet Server; if it does, unwanted certificate extensions may leak into
         | 
| 897 897 | 
             
            certificates created with the `puppetserver ca generate` command.
         | 
| 898 898 |  | 
| 899 899 | 
             
            If present, this file must be a YAML hash containing a `custom_attributes` key
         | 
| @@ -1205,7 +1205,7 @@ EOT | |
| 1205 1205 | 
             
                  :default => "$confdir/autosign.conf",
         | 
| 1206 1206 | 
             
                  :type => :autosign,
         | 
| 1207 1207 | 
             
                  :desc => "Whether (and how) to autosign certificate requests. This setting
         | 
| 1208 | 
            -
                    is only relevant on a  | 
| 1208 | 
            +
                    is only relevant on a Puppet Server acting as a certificate authority (CA).
         | 
| 1209 1209 |  | 
| 1210 1210 | 
             
                    Valid values are true (autosigns all certificate requests; not recommended),
         | 
| 1211 1211 | 
             
                    false (disables autosigning certificates), or the absolute path to a file.
         | 
| @@ -1216,7 +1216,7 @@ EOT | |
| 1216 1216 | 
             
                    file, it will be treated as a policy executable; otherwise, it will be
         | 
| 1217 1217 | 
             
                    treated as a config file.
         | 
| 1218 1218 |  | 
| 1219 | 
            -
                    If a custom policy executable is configured, the CA  | 
| 1219 | 
            +
                    If a custom policy executable is configured, the CA Puppet Server will run it
         | 
| 1220 1220 | 
             
                    every time it receives a CSR. The executable will be passed the subject CN of the
         | 
| 1221 1221 | 
             
                    request _as a command line argument,_ and the contents of the CSR in PEM format
         | 
| 1222 1222 | 
             
                    _on stdin._ It should exit with a status of 0 if the cert should be autosigned
         | 
| @@ -1302,7 +1302,7 @@ EOT | |
| 1302 1302 | 
             
                :manifest => {
         | 
| 1303 1303 | 
             
                  :default    => nil,
         | 
| 1304 1304 | 
             
                  :type       => :file_or_directory,
         | 
| 1305 | 
            -
                  :desc       => "The entry-point manifest for  | 
| 1305 | 
            +
                  :desc       => "The entry-point manifest for the primary server. This can be one file
         | 
| 1306 1306 | 
             
                    or a directory of manifests to be evaluated in alphabetical order. Puppet manages
         | 
| 1307 1307 | 
             
                    this path as a directory if one exists or if the path ends with a / or \\.
         | 
| 1308 1308 |  | 
| @@ -1509,8 +1509,8 @@ EOT | |
| 1509 1509 | 
             
                    their names should be comma-separated, with whitespace allowed. (For example,
         | 
| 1510 1510 | 
             
                    `reports = http, store`.)
         | 
| 1511 1511 |  | 
| 1512 | 
            -
                    This setting is relevant to puppet  | 
| 1513 | 
            -
                     | 
| 1512 | 
            +
                    This setting is relevant to puppet server and puppet apply. The primary Puppet
         | 
| 1513 | 
            +
                    server will call these report handlers with the reports it receives from
         | 
| 1514 1514 | 
             
                    agent nodes, and puppet apply will call them with its own report. (In
         | 
| 1515 1515 | 
             
                    all cases, the node applying the catalog must have `report = true`.)
         | 
| 1516 1516 |  | 
| @@ -1578,7 +1578,7 @@ EOT | |
| 1578 1578 | 
             
                :node_name_value => {
         | 
| 1579 1579 | 
             
                  :default => "$certname",
         | 
| 1580 1580 | 
             
                  :desc => "The explicit value used for the node name for all requests the agent
         | 
| 1581 | 
            -
                    makes to the  | 
| 1581 | 
            +
                    makes to the primary server. WARNING: This setting is mutually exclusive with
         | 
| 1582 1582 | 
             
                    node_name_fact.  Changing this setting also requires changes to the default
         | 
| 1583 1583 | 
             
                    auth.conf configuration on the Puppet Master.  Please see
         | 
| 1584 1584 | 
             
                    http://links.puppet.com/node_name_value for more information."
         | 
| @@ -1586,7 +1586,7 @@ EOT | |
| 1586 1586 | 
             
                :node_name_fact => {
         | 
| 1587 1587 | 
             
                  :default => "",
         | 
| 1588 1588 | 
             
                  :desc => "The fact name used to determine the node name used for all requests the agent
         | 
| 1589 | 
            -
                    makes to the  | 
| 1589 | 
            +
                    makes to the primary server. WARNING: This setting is mutually exclusive with
         | 
| 1590 1590 | 
             
                    node_name_value.  Changing this setting also requires changes to the default
         | 
| 1591 1591 | 
             
                    auth.conf configuration on the Puppet Master.  Please see
         | 
| 1592 1592 | 
             
                    http://links.puppet.com/node_name_fact for more information.",
         | 
| @@ -1600,8 +1600,8 @@ EOT | |
| 1600 1600 | 
             
                  :default => "$statedir/state.yaml",
         | 
| 1601 1601 | 
             
                  :type => :file,
         | 
| 1602 1602 | 
             
                  :mode => "0640",
         | 
| 1603 | 
            -
                  :desc => "Where  | 
| 1604 | 
            -
                    with the running configuration.  In the case of  | 
| 1603 | 
            +
                  :desc => "Where Puppet agent and Puppet Server store state associated
         | 
| 1604 | 
            +
                    with the running configuration.  In the case of Puppet Server,
         | 
| 1605 1605 | 
             
                    this file reflects the state discovered through interacting
         | 
| 1606 1606 | 
             
                    with clients."
         | 
| 1607 1607 | 
             
                },
         | 
| @@ -1638,6 +1638,12 @@ EOT | |
| 1638 1638 | 
             
                  :mode => "0750",
         | 
| 1639 1639 | 
             
                  :desc => "The directory in which serialized data is stored on the client."
         | 
| 1640 1640 | 
             
                },
         | 
| 1641 | 
            +
                :write_catalog_summary => {
         | 
| 1642 | 
            +
                  :default => true,
         | 
| 1643 | 
            +
                  :type => :boolean,
         | 
| 1644 | 
            +
                  :desc => "Whether to write the `classfile` and `resourcefile` after applying
         | 
| 1645 | 
            +
                    the catalog. It is enabled by default, except when running `puppet apply`.",
         | 
| 1646 | 
            +
                },
         | 
| 1641 1647 | 
             
                :classfile => {
         | 
| 1642 1648 | 
             
                  :default => "$statedir/classes.txt",
         | 
| 1643 1649 | 
             
                  :type => :file,
         | 
| @@ -1664,11 +1670,11 @@ EOT | |
| 1664 1670 | 
             
                    the POSIX syslog service and the Windows Event Log are unavailable. (Currently,
         | 
| 1665 1671 | 
             
                    no supported operating systems match that description.)
         | 
| 1666 1672 |  | 
| 1667 | 
            -
                    Despite the name, both puppet agent and puppet  | 
| 1673 | 
            +
                    Despite the name, both puppet agent and puppet server will use this file
         | 
| 1668 1674 | 
             
                    as the fallback logging destination.
         | 
| 1669 1675 |  | 
| 1670 1676 | 
             
                    For control over logging destinations, see the `--logdest` command line
         | 
| 1671 | 
            -
                    option in the manual pages for puppet  | 
| 1677 | 
            +
                    option in the manual pages for puppet server, puppet agent, and puppet
         | 
| 1672 1678 | 
             
                    apply. You can see man pages by running `puppet <SUBCOMMAND> --help`,
         | 
| 1673 1679 | 
             
                    or read them online at https://puppet.com/docs/puppet/latest/man/."
         | 
| 1674 1680 | 
             
                },
         | 
| @@ -1682,12 +1688,12 @@ EOT | |
| 1682 1688 | 
             
                },
         | 
| 1683 1689 | 
             
                :server => {
         | 
| 1684 1690 | 
             
                  :default => "puppet",
         | 
| 1685 | 
            -
                  :desc => "The  | 
| 1691 | 
            +
                  :desc => "The primary Puppet server to which the Puppet agent should connect.",
         | 
| 1686 1692 | 
             
                },
         | 
| 1687 1693 | 
             
                :server_list => {
         | 
| 1688 1694 | 
             
                  :default => [],
         | 
| 1689 1695 | 
             
                  :type => :server_list,
         | 
| 1690 | 
            -
                  :desc => "The list of  | 
| 1696 | 
            +
                  :desc => "The list of primary Puppet servers to which the Puppet agent should connect,
         | 
| 1691 1697 | 
             
                    in the order that they will be tried.",
         | 
| 1692 1698 | 
             
                },
         | 
| 1693 1699 | 
             
                :use_srv_records => {
         | 
| @@ -1702,7 +1708,7 @@ EOT | |
| 1702 1708 | 
             
                :http_extra_headers => {
         | 
| 1703 1709 | 
             
                  :default => [],
         | 
| 1704 1710 | 
             
                  :type => :http_extra_headers,
         | 
| 1705 | 
            -
                  :desc => "The list of extra headers that will be sent with http requests to the  | 
| 1711 | 
            +
                  :desc => "The list of extra headers that will be sent with http requests to the primary server.
         | 
| 1706 1712 | 
             
                  The header definition consists of a name and a value separated by a colon."
         | 
| 1707 1713 | 
             
                },
         | 
| 1708 1714 | 
             
                :ignoreschedules => {
         | 
| @@ -1728,7 +1734,7 @@ EOT | |
| 1728 1734 | 
             
                    like it does when running normally. However, if a resource attribute is not in
         | 
| 1729 1735 | 
             
                    the desired state (as declared in the catalog), Puppet will take no
         | 
| 1730 1736 | 
             
                    action, and will instead report the changes it _would_ have made. These
         | 
| 1731 | 
            -
                    simulated changes will appear in the report sent to the  | 
| 1737 | 
            +
                    simulated changes will appear in the report sent to the primary Puppet server, or
         | 
| 1732 1738 | 
             
                    be shown on the console if running puppet agent or puppet apply in the
         | 
| 1733 1739 | 
             
                    foreground. The simulated changes will not send refresh events to any
         | 
| 1734 1740 | 
             
                    subscribing or notified resources, although Puppet will log that a refresh
         | 
| @@ -1800,7 +1806,7 @@ EOT | |
| 1800 1806 | 
             
                  :desc       => "Whether to only use the cached catalog rather than compiling a new catalog
         | 
| 1801 1807 | 
             
                    on every run.  Puppet can be run with this enabled by default and then selectively
         | 
| 1802 1808 | 
             
                    disabled when a recompile is desired. Because a Puppet agent using cached catalogs
         | 
| 1803 | 
            -
                    does not contact the  | 
| 1809 | 
            +
                    does not contact the primary server for a new catalog, it also does not upload facts at
         | 
| 1804 1810 | 
             
                    the beginning of the Puppet run.",
         | 
| 1805 1811 | 
             
                },
         | 
| 1806 1812 | 
             
                :ignoremissingtypes => {
         | 
| @@ -1808,7 +1814,7 @@ EOT | |
| 1808 1814 | 
             
                  :type       => :boolean,
         | 
| 1809 1815 | 
             
                  :desc       => "Skip searching for classes and definitions that were missing during a
         | 
| 1810 1816 | 
             
                    prior compilation. The list of missing objects is maintained per-environment and
         | 
| 1811 | 
            -
                    persists until the environment is cleared or the  | 
| 1817 | 
            +
                    persists until the environment is cleared or the primary server is restarted.",
         | 
| 1812 1818 | 
             
                },
         | 
| 1813 1819 | 
             
                :splaylimit => {
         | 
| 1814 1820 | 
             
                  :default    => "$runinterval",
         | 
| @@ -1838,7 +1844,7 @@ EOT | |
| 1838 1844 | 
             
                    If you restart an agent's puppet service with `splay` enabled, it
         | 
| 1839 1845 | 
             
                    recalculates its splay period and delays its first agent run after
         | 
| 1840 1846 | 
             
                    restarting for this new period. If you simultaneously restart a group of
         | 
| 1841 | 
            -
                    puppet agents with `splay` enabled, their checkins to your  | 
| 1847 | 
            +
                    puppet agents with `splay` enabled, their checkins to your primary servers
         | 
| 1842 1848 | 
             
                    can be distributed more evenly.",
         | 
| 1843 1849 | 
             
                },
         | 
| 1844 1850 | 
             
                :clientbucketdir => {
         | 
| @@ -1930,7 +1936,7 @@ EOT | |
| 1930 1936 |  | 
| 1931 1937 | 
             
                  When starting for the first time, puppet agent will submit a certificate
         | 
| 1932 1938 | 
             
                  signing request (CSR) to the server named in the `ca_server` setting
         | 
| 1933 | 
            -
                  (usually the  | 
| 1939 | 
            +
                  (usually the primary Puppet server); this may be autosigned, or may need to be
         | 
| 1934 1940 | 
             
                  approved by a human, depending on the CA server's configuration.
         | 
| 1935 1941 |  | 
| 1936 1942 | 
             
                  Puppet agent cannot apply configurations until its approved certificate is
         | 
| @@ -2044,7 +2050,7 @@ EOT | |
| 2044 2050 | 
             
                  :call_hook => :on_initialize_and_write, # Call our hook with the default value, so we always get the value added to facter.
         | 
| 2045 2051 | 
             
                  :hook => proc do |value|
         | 
| 2046 2052 | 
             
                    paths = value.split(File::PATH_SEPARATOR)
         | 
| 2047 | 
            -
                     | 
| 2053 | 
            +
                    Puppet.runtime[:facter].search(*paths)
         | 
| 2048 2054 | 
             
                  end
         | 
| 2049 2055 | 
             
                }
         | 
| 2050 2056 | 
             
              )
         | 
    
        data/lib/puppet/environments.rb
    CHANGED
    
    | @@ -48,6 +48,13 @@ module Puppet::Environments | |
| 48 48 | 
             
                    root.instance_variable_set(:@rich_data, nil)
         | 
| 49 49 | 
             
                  end
         | 
| 50 50 | 
             
                end
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                # The base implementation is a noop, because `get` returns a new environment
         | 
| 53 | 
            +
                # each time.
         | 
| 54 | 
            +
                #
         | 
| 55 | 
            +
                # @see Puppet::Environments::Cached#guard
         | 
| 56 | 
            +
                def guard(name); end
         | 
| 57 | 
            +
                def unguard(name); end
         | 
| 51 58 | 
             
              end
         | 
| 52 59 |  | 
| 53 60 | 
             
              # @!macro [new] loader_search_paths
         | 
| @@ -188,7 +195,7 @@ module Puppet::Environments | |
| 188 195 |  | 
| 189 196 | 
             
                def self.real_path(dir)
         | 
| 190 197 | 
             
                  if Puppet::FileSystem.symlink?(dir) && Puppet[:versioned_environment_dirs]
         | 
| 191 | 
            -
                    dir = Puppet::FileSystem.expand_path(Puppet::FileSystem.readlink(dir))
         | 
| 198 | 
            +
                    dir = Pathname.new Puppet::FileSystem.expand_path(Puppet::FileSystem.readlink(dir))
         | 
| 192 199 | 
             
                  end
         | 
| 193 200 | 
             
                  return dir
         | 
| 194 201 | 
             
                end
         | 
| @@ -241,7 +248,7 @@ module Puppet::Environments | |
| 241 248 |  | 
| 242 249 | 
             
                def validated_directory(envdir)
         | 
| 243 250 | 
             
                  env_name = Puppet::FileSystem.basename_string(envdir)
         | 
| 244 | 
            -
                  envdir = Puppet::Environments::Directories.real_path(envdir)
         | 
| 251 | 
            +
                  envdir = Puppet::Environments::Directories.real_path(envdir).to_s
         | 
| 245 252 | 
             
                  if Puppet::FileSystem.directory?(envdir) && Puppet::Node::Environment.valid_name?(env_name)
         | 
| 246 253 | 
             
                    envdir
         | 
| 247 254 | 
             
                  else
         | 
| @@ -330,21 +337,13 @@ module Puppet::Environments | |
| 330 337 | 
             
                end
         | 
| 331 338 |  | 
| 332 339 | 
             
                def self.cache_expiration_service=(service)
         | 
| 333 | 
            -
                  @ | 
| 340 | 
            +
                  @cache_expiration_service_singleton = service
         | 
| 334 341 | 
             
                end
         | 
| 335 342 |  | 
| 336 343 | 
             
                def self.cache_expiration_service
         | 
| 337 | 
            -
                  @ | 
| 344 | 
            +
                  @cache_expiration_service_singleton || DefaultCacheExpirationService.new
         | 
| 338 345 | 
             
                end
         | 
| 339 346 |  | 
| 340 | 
            -
                # Returns the end of time (the next Mesoamerican Long Count cycle-end after 2012 (5125+2012) = 7137
         | 
| 341 | 
            -
                def self.end_of_time
         | 
| 342 | 
            -
                  Time.gm(7137)
         | 
| 343 | 
            -
                end
         | 
| 344 | 
            -
             | 
| 345 | 
            -
                END_OF_TIME = end_of_time
         | 
| 346 | 
            -
                START_OF_TIME = Time.gm(1)
         | 
| 347 | 
            -
             | 
| 348 347 | 
             
                def initialize(loader)
         | 
| 349 348 | 
             
                  @loader = loader
         | 
| 350 349 | 
             
                  @cache_expiration_service = Puppet::Environments::Cached.cache_expiration_service
         | 
| @@ -356,7 +355,7 @@ module Puppet::Environments | |
| 356 355 | 
             
                  # Evict all that have expired, in the same way as `get`
         | 
| 357 356 | 
             
                  clear_all_expired
         | 
| 358 357 |  | 
| 359 | 
            -
                  # Evict all that was removed from  | 
| 358 | 
            +
                  # Evict all that was removed from disk
         | 
| 360 359 | 
             
                  cached_envs = @cache.keys.map!(&:to_sym)
         | 
| 361 360 | 
             
                  loader_envs = @loader.list.map!(&:name)
         | 
| 362 361 | 
             
                  removed_envs = cached_envs - loader_envs
         | 
| @@ -385,27 +384,35 @@ module Puppet::Environments | |
| 385 384 |  | 
| 386 385 | 
             
                # @!macro loader_get
         | 
| 387 386 | 
             
                def get(name)
         | 
| 387 | 
            +
                  entry = get_entry(name)
         | 
| 388 | 
            +
                  entry ? entry.value : nil
         | 
| 389 | 
            +
                end
         | 
| 390 | 
            +
             | 
| 391 | 
            +
                # Get a cache entry for an envionment. It returns nil if the
         | 
| 392 | 
            +
                # environment doesn't exist.
         | 
| 393 | 
            +
                def get_entry(name, check_expired = true)
         | 
| 388 394 | 
             
                  # Aggressively evict all that has expired
         | 
| 389 395 | 
             
                  # This strategy favors smaller memory footprint over environment
         | 
| 390 396 | 
             
                  # retrieval time.
         | 
| 391 | 
            -
                  clear_all_expired
         | 
| 392 | 
            -
                   | 
| 393 | 
            -
                   | 
| 394 | 
            -
             | 
| 397 | 
            +
                  clear_all_expired if check_expired
         | 
| 398 | 
            +
                  name = name.to_sym
         | 
| 399 | 
            +
                  entry = @cache[name]
         | 
| 400 | 
            +
                  if entry
         | 
| 401 | 
            +
                    Puppet.debug {"Found in cache #{name.inspect} #{entry.label}"}
         | 
| 395 402 | 
             
                    # found in cache
         | 
| 396 | 
            -
                     | 
| 397 | 
            -
             | 
| 398 | 
            -
                  elsif (result = @loader.get(name))
         | 
| 403 | 
            +
                    entry.touch
         | 
| 404 | 
            +
                  elsif (env = @loader.get(name))
         | 
| 399 405 | 
             
                    # environment loaded, cache it
         | 
| 400 | 
            -
                     | 
| 401 | 
            -
                    add_entry(name,  | 
| 402 | 
            -
                    result
         | 
| 406 | 
            +
                    entry = entry(env)
         | 
| 407 | 
            +
                    add_entry(name, entry)
         | 
| 403 408 | 
             
                  end
         | 
| 409 | 
            +
                  entry
         | 
| 404 410 | 
             
                end
         | 
| 411 | 
            +
                private :get_entry
         | 
| 405 412 |  | 
| 406 413 | 
             
                # Adds a cache entry to the cache
         | 
| 407 414 | 
             
                def add_entry(name, cache_entry)
         | 
| 408 | 
            -
                  Puppet.debug {"Caching environment  | 
| 415 | 
            +
                  Puppet.debug {"Caching environment #{name.inspect} #{cache_entry.label}"}
         | 
| 409 416 | 
             
                  @cache[name] = cache_entry
         | 
| 410 417 | 
             
                  @cache_expiration_service.created(cache_entry.value)
         | 
| 411 418 | 
             
                end
         | 
| @@ -413,7 +420,7 @@ module Puppet::Environments | |
| 413 420 |  | 
| 414 421 | 
             
                def clear_entry(name, entry)
         | 
| 415 422 | 
             
                  @cache.delete(name)
         | 
| 416 | 
            -
                  Puppet.debug {"Evicting cache entry for environment  | 
| 423 | 
            +
                  Puppet.debug {"Evicting cache entry for environment #{name.inspect}"}
         | 
| 417 424 | 
             
                  @cache_expiration_service.evicted(name.to_sym)
         | 
| 418 425 | 
             
                  Puppet::GettextConfig.delete_text_domain(name)
         | 
| 419 426 | 
             
                  Puppet.settings.clear_environment_settings(name)
         | 
| @@ -423,6 +430,7 @@ module Puppet::Environments | |
| 423 430 | 
             
                # Clears the cache of the environment with the given name.
         | 
| 424 431 | 
             
                # (The intention is that this could be used from a MANUAL cache eviction command (TBD)
         | 
| 425 432 | 
             
                def clear(name)
         | 
| 433 | 
            +
                  name = name.to_sym
         | 
| 426 434 | 
             
                  entry = @cache[name]
         | 
| 427 435 | 
             
                  clear_entry(name, entry) if entry
         | 
| 428 436 | 
             
                end
         | 
| @@ -443,19 +451,21 @@ module Puppet::Environments | |
| 443 451 | 
             
                # Clears all environments that have expired, either by exceeding their time to live, or
         | 
| 444 452 | 
             
                # through an explicit eviction determined by the cache expiration service.
         | 
| 445 453 | 
             
                #
         | 
| 446 | 
            -
                def clear_all_expired | 
| 454 | 
            +
                def clear_all_expired
         | 
| 447 455 | 
             
                  t = Time.now
         | 
| 448 456 |  | 
| 449 457 | 
             
                  @cache.each_pair do |name, entry|
         | 
| 450 458 | 
             
                    clear_if_expired(name, entry, t)
         | 
| 451 459 | 
             
                  end
         | 
| 452 460 | 
             
                end
         | 
| 461 | 
            +
                private :clear_all_expired
         | 
| 453 462 |  | 
| 454 463 | 
             
                # Clear an environment if it is expired, either by exceeding its time to live, or
         | 
| 455 464 | 
             
                # through an explicit eviction determined by the cache expiration service.
         | 
| 456 465 | 
             
                #
         | 
| 457 466 | 
             
                def clear_if_expired(name, entry, t = Time.now)
         | 
| 458 467 | 
             
                  return unless entry
         | 
| 468 | 
            +
                  return if entry.guarded?
         | 
| 459 469 |  | 
| 460 470 | 
             
                  if entry.expired?(t) || @cache_expiration_service.expired?(name.to_sym)
         | 
| 461 471 | 
             
                    clear_entry(name, entry)
         | 
| @@ -472,10 +482,25 @@ module Puppet::Environments | |
| 472 482 | 
             
                #
         | 
| 473 483 | 
             
                # @!macro loader_get_conf
         | 
| 474 484 | 
             
                def get_conf(name)
         | 
| 485 | 
            +
                  name = name.to_sym
         | 
| 475 486 | 
             
                  clear_if_expired(name, @cache[name])
         | 
| 476 487 | 
             
                  @loader.get_conf(name)
         | 
| 477 488 | 
             
                end
         | 
| 478 489 |  | 
| 490 | 
            +
                # Guard an environment so it can't be evicted while it's in use. The method
         | 
| 491 | 
            +
                # may be called multiple times, provided it is unguarded the same number of
         | 
| 492 | 
            +
                # times. If you call this method, you must call `unguard` in an ensure block.
         | 
| 493 | 
            +
                def guard(name)
         | 
| 494 | 
            +
                  entry = get_entry(name, false)
         | 
| 495 | 
            +
                  entry.guard if entry
         | 
| 496 | 
            +
                end
         | 
| 497 | 
            +
             | 
| 498 | 
            +
                # Unguard an environment.
         | 
| 499 | 
            +
                def unguard(name)
         | 
| 500 | 
            +
                  entry = get_entry(name, false)
         | 
| 501 | 
            +
                  entry.unguard if entry
         | 
| 502 | 
            +
                end
         | 
| 503 | 
            +
             | 
| 479 504 | 
             
                # Creates a suitable cache entry given the time to live for one environment
         | 
| 480 505 | 
             
                #
         | 
| 481 506 | 
             
                def entry(env)
         | 
| @@ -505,6 +530,7 @@ module Puppet::Environments | |
| 505 530 |  | 
| 506 531 | 
             
                  def initialize(value)
         | 
| 507 532 | 
             
                    @value = value
         | 
| 533 | 
            +
                    @guards = 0
         | 
| 508 534 | 
             
                  end
         | 
| 509 535 |  | 
| 510 536 | 
             
                  def touch
         | 
| @@ -517,6 +543,20 @@ module Puppet::Environments | |
| 517 543 | 
             
                  def label
         | 
| 518 544 | 
             
                    ""
         | 
| 519 545 | 
             
                  end
         | 
| 546 | 
            +
             | 
| 547 | 
            +
                  # These are not protected with a lock, because all of the Cached
         | 
| 548 | 
            +
                  # methods are protected.
         | 
| 549 | 
            +
                  def guarded?
         | 
| 550 | 
            +
                    @guards > 0
         | 
| 551 | 
            +
                  end
         | 
| 552 | 
            +
             | 
| 553 | 
            +
                  def guard
         | 
| 554 | 
            +
                    @guards += 1
         | 
| 555 | 
            +
                  end
         | 
| 556 | 
            +
             | 
| 557 | 
            +
                  def unguard
         | 
| 558 | 
            +
                    @guards -= 1
         | 
| 559 | 
            +
                  end
         | 
| 520 560 | 
             
                end
         | 
| 521 561 |  | 
| 522 562 | 
             
                # Always evicting entry
         | 
    
        data/lib/puppet/face/facts.rb
    CHANGED
    
    | @@ -132,7 +132,7 @@ Puppet::Indirector::Face.define(:facts, '0.0.1') do | |
| 132 132 | 
             
                  Puppet.settings.preferred_run_mode = :agent
         | 
| 133 133 | 
             
                  Puppet::Node::Facts.indirection.terminus_class = :facter
         | 
| 134 134 |  | 
| 135 | 
            -
                  if Puppet::Util::Package.versioncmp( | 
| 135 | 
            +
                  if Puppet::Util::Package.versioncmp(Puppet.runtime[:facter].value('facterversion'), '4.0.0') < 0
         | 
| 136 136 | 
             
                    cmd_flags = '--render-as json --show-legacy'
         | 
| 137 137 |  | 
| 138 138 | 
             
                    # puppet/ruby are in PATH since it was updated in the wrapper script
         | 
| @@ -0,0 +1,96 @@ | |
| 1 | 
            +
            # frozen_string_literal: true
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            #
         | 
| 4 | 
            +
            # @api private
         | 
| 5 | 
            +
            # Default Facter implementation that delegates to Facter API
         | 
| 6 | 
            +
            #
         | 
| 7 | 
            +
             | 
| 8 | 
            +
            module Puppet
         | 
| 9 | 
            +
              class FacterImpl
         | 
| 10 | 
            +
                def initialize
         | 
| 11 | 
            +
                  require 'facter'
         | 
| 12 | 
            +
             | 
| 13 | 
            +
                  setup_logging
         | 
| 14 | 
            +
                end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                def value(fact_name)
         | 
| 17 | 
            +
                  ::Facter.value(fact_name)
         | 
| 18 | 
            +
                end
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                def add(name, &block)
         | 
| 21 | 
            +
                  ::Facter.add(name, &block)
         | 
| 22 | 
            +
                end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
                def to_hash
         | 
| 25 | 
            +
                  ::Facter.to_hash
         | 
| 26 | 
            +
                end
         | 
| 27 | 
            +
             | 
| 28 | 
            +
                def clear
         | 
| 29 | 
            +
                  ::Facter.clear
         | 
| 30 | 
            +
                end
         | 
| 31 | 
            +
             | 
| 32 | 
            +
                def reset
         | 
| 33 | 
            +
                  ::Facter.reset
         | 
| 34 | 
            +
                end
         | 
| 35 | 
            +
             | 
| 36 | 
            +
                def resolve(options)
         | 
| 37 | 
            +
                  ::Facter.resolve(options)
         | 
| 38 | 
            +
                end
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                def search_external(dirs)
         | 
| 41 | 
            +
                  ::Facter.search_external(dirs)
         | 
| 42 | 
            +
                end
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                def search(*dirs)
         | 
| 45 | 
            +
                  ::Facter.search(*dirs)
         | 
| 46 | 
            +
                end
         | 
| 47 | 
            +
             | 
| 48 | 
            +
                def trace(value)
         | 
| 49 | 
            +
                  ::Facter.trace(value) if ::Facter.respond_to? :trace
         | 
| 50 | 
            +
                end
         | 
| 51 | 
            +
             | 
| 52 | 
            +
                def debugging(value)
         | 
| 53 | 
            +
                  ::Facter.debugging(value) if ::Facter.respond_to?(:debugging)
         | 
| 54 | 
            +
                end
         | 
| 55 | 
            +
             | 
| 56 | 
            +
                def load_external?
         | 
| 57 | 
            +
                  ::Facter.respond_to?(:load_external)
         | 
| 58 | 
            +
                end
         | 
| 59 | 
            +
             | 
| 60 | 
            +
                def load_external(value)
         | 
| 61 | 
            +
                  ::Facter.load_external(value) if self.load_external?
         | 
| 62 | 
            +
                end
         | 
| 63 | 
            +
             | 
| 64 | 
            +
                private
         | 
| 65 | 
            +
             | 
| 66 | 
            +
                def setup_logging
         | 
| 67 | 
            +
                  return unless ::Facter.respond_to? :on_message
         | 
| 68 | 
            +
             | 
| 69 | 
            +
                  ::Facter.on_message do |level, message|
         | 
| 70 | 
            +
                    case level
         | 
| 71 | 
            +
                    when :trace, :debug
         | 
| 72 | 
            +
                      level = :debug
         | 
| 73 | 
            +
                    when :info
         | 
| 74 | 
            +
                      # Same as Puppet
         | 
| 75 | 
            +
                    when :warn
         | 
| 76 | 
            +
                      level = :warning
         | 
| 77 | 
            +
                    when :error
         | 
| 78 | 
            +
                      level = :err
         | 
| 79 | 
            +
                    when :fatal
         | 
| 80 | 
            +
                      level = :crit
         | 
| 81 | 
            +
                    else
         | 
| 82 | 
            +
                      next
         | 
| 83 | 
            +
                    end
         | 
| 84 | 
            +
             | 
| 85 | 
            +
                    Puppet::Util::Log.create(
         | 
| 86 | 
            +
                      {
         | 
| 87 | 
            +
                        :level => level,
         | 
| 88 | 
            +
                        :source => 'Facter',
         | 
| 89 | 
            +
                        :message => message
         | 
| 90 | 
            +
                      }
         | 
| 91 | 
            +
                    )
         | 
| 92 | 
            +
                    nil
         | 
| 93 | 
            +
                  end
         | 
| 94 | 
            +
                end
         | 
| 95 | 
            +
              end
         | 
| 96 | 
            +
            end
         | 
| @@ -104,6 +104,8 @@ class Puppet::FileServing::Configuration::Parser | |
| 104 104 | 
             
                  mount = Mount::Modules.new(name)
         | 
| 105 105 | 
             
                when "plugins"
         | 
| 106 106 | 
             
                  mount = Mount::Plugins.new(name)
         | 
| 107 | 
            +
                when "scripts"
         | 
| 108 | 
            +
                  mount = Mount::Scripts.new(name)
         | 
| 107 109 | 
             
                when "tasks"
         | 
| 108 110 | 
             
                  mount = Mount::Tasks.new(name)
         | 
| 109 111 | 
             
                when "locales"
         | 
| @@ -6,6 +6,7 @@ require 'puppet/file_serving/mount/modules' | |
| 6 6 | 
             
            require 'puppet/file_serving/mount/plugins'
         | 
| 7 7 | 
             
            require 'puppet/file_serving/mount/locales'
         | 
| 8 8 | 
             
            require 'puppet/file_serving/mount/pluginfacts'
         | 
| 9 | 
            +
            require 'puppet/file_serving/mount/scripts'
         | 
| 9 10 | 
             
            require 'puppet/file_serving/mount/tasks'
         | 
| 10 11 |  | 
| 11 12 | 
             
            class Puppet::FileServing::Configuration
         | 
| @@ -87,6 +88,8 @@ class Puppet::FileServing::Configuration | |
| 87 88 | 
             
                @mounts["locales"].allow('*') if @mounts["locales"].empty?
         | 
| 88 89 | 
             
                @mounts["pluginfacts"] ||= Mount::PluginFacts.new("pluginfacts")
         | 
| 89 90 | 
             
                @mounts["pluginfacts"].allow('*') if @mounts["pluginfacts"].empty?
         | 
| 91 | 
            +
                @mounts["scripts"] ||= Mount::Scripts.new("scripts")
         | 
| 92 | 
            +
                @mounts["scripts"].allow('*') if @mounts["scripts"].empty?
         | 
| 90 93 | 
             
                @mounts["tasks"] ||= Mount::Tasks.new("tasks")
         | 
| 91 94 | 
             
                @mounts["tasks"].allow('*') if @mounts["tasks"].empty?
         | 
| 92 95 | 
             
              end
         | 
| @@ -3,12 +3,12 @@ require 'puppet/file_serving/mount' | |
| 3 3 | 
             
            class Puppet::FileServing::Mount::File < Puppet::FileServing::Mount
         | 
| 4 4 | 
             
              def self.localmap
         | 
| 5 5 | 
             
                @localmap ||= {
         | 
| 6 | 
            -
                  "h" =>  | 
| 6 | 
            +
                  "h" => Puppet.runtime[:facter].value("hostname"),
         | 
| 7 7 | 
             
                  "H" => [
         | 
| 8 | 
            -
                            | 
| 9 | 
            -
                            | 
| 8 | 
            +
                           Puppet.runtime[:facter].value("hostname"),
         | 
| 9 | 
            +
                           Puppet.runtime[:facter].value("domain")
         | 
| 10 10 | 
             
                         ].join("."),
         | 
| 11 | 
            -
                  "d" =>  | 
| 11 | 
            +
                  "d" => Puppet.runtime[:facter].value("domain")
         | 
| 12 12 | 
             
                }
         | 
| 13 13 | 
             
              end
         | 
| 14 14 |  | 
| @@ -0,0 +1,24 @@ | |
| 1 | 
            +
            require 'puppet/file_serving/mount'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            class Puppet::FileServing::Mount::Scripts < Puppet::FileServing::Mount
         | 
| 4 | 
            +
              # Return an instance of the appropriate class.
         | 
| 5 | 
            +
              def find(path, request)
         | 
| 6 | 
            +
                raise _("No module specified") if path.to_s.empty?
         | 
| 7 | 
            +
                module_name, relative_path = path.split("/", 2)
         | 
| 8 | 
            +
                mod = request.environment.module(module_name)
         | 
| 9 | 
            +
                return nil unless mod
         | 
| 10 | 
            +
             | 
| 11 | 
            +
                mod.script(relative_path)
         | 
| 12 | 
            +
              end
         | 
| 13 | 
            +
             | 
| 14 | 
            +
              def search(path, request)
         | 
| 15 | 
            +
                result = find(path, request)
         | 
| 16 | 
            +
                if result
         | 
| 17 | 
            +
                  [result]
         | 
| 18 | 
            +
                end
         | 
| 19 | 
            +
              end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
              def valid?
         | 
| 22 | 
            +
                true
         | 
| 23 | 
            +
              end
         | 
| 24 | 
            +
            end
         | 
| @@ -84,7 +84,9 @@ class Puppet::FileSystem::FileImpl | |
| 84 84 | 
             
              end
         | 
| 85 85 |  | 
| 86 86 | 
             
              def read_preserve_line_endings(path)
         | 
| 87 | 
            -
                 | 
| 87 | 
            +
                default_encoding = Encoding.default_external.name
         | 
| 88 | 
            +
                encoding = default_encoding.downcase.start_with?('utf-') ? "bom|#{default_encoding}" : default_encoding
         | 
| 89 | 
            +
                read(path, encoding: encoding)
         | 
| 88 90 | 
             
              end
         | 
| 89 91 |  | 
| 90 92 | 
             
              def binread(path)
         | 
    
        data/lib/puppet/forge.rb
    CHANGED
    
    | @@ -213,7 +213,7 @@ class Puppet::Forge < SemanticPuppet::Dependency::Source | |
| 213 213 | 
             
                end
         | 
| 214 214 |  | 
| 215 215 | 
             
                def validate_checksum(file, checksum, digest_class)
         | 
| 216 | 
            -
                  if  | 
| 216 | 
            +
                  if Puppet.runtime[:facter].value(:fips_enabled) && digest_class == Digest::MD5
         | 
| 217 217 | 
             
                    raise _("Module install using MD5 is prohibited in FIPS mode.")
         | 
| 218 218 | 
             
                  end
         | 
| 219 219 |  | 
| @@ -2,11 +2,11 @@ | |
| 2 2 | 
             
            #
         | 
| 3 3 | 
             
            # This function accepts an argument that is a String as a `<MODULE NAME>/<TEMPLATE>`
         | 
| 4 4 | 
             
            # reference, which searches for `<TEMPLATE>` relative to a module's `templates`
         | 
| 5 | 
            -
            # directory on the  | 
| 5 | 
            +
            # directory on the primary server. (For example, the reference `mymod/secret.conf.epp`
         | 
| 6 6 | 
             
            # will search for the file `<MODULES DIRECTORY>/mymod/templates/secret.conf.epp`.)
         | 
| 7 7 | 
             
            #
         | 
| 8 8 | 
             
            # The primary use case is for agent-side template rendering with late-bound variables
         | 
| 9 | 
            -
            # resolved, such as from secret stores inaccessible to the  | 
| 9 | 
            +
            # resolved, such as from secret stores inaccessible to the primary server, such as
         | 
| 10 10 | 
             
            #
         | 
| 11 11 | 
             
            # ```
         | 
| 12 12 | 
             
            # $variables = {
         |