puppet 3.0.0.rc5 → 3.0.0.rc7
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.
- data/LICENSE +1 -1
- data/README_DEVELOPER.md +209 -1
- data/README_HIERA.md +148 -0
- data/Rakefile +25 -27
- data/bin/extlookup2hiera +56 -0
- data/conf/auth.conf +34 -34
- data/examples/hiera/README.md +91 -0
- data/examples/hiera/etc/hiera.yaml +15 -0
- data/examples/hiera/etc/hieradb/common.yaml +3 -0
- data/examples/hiera/etc/hieradb/dc1.yaml +6 -0
- data/examples/hiera/etc/hieradb/development.yaml +2 -0
- data/examples/hiera/etc/puppet.conf +3 -0
- data/examples/hiera/modules/data/manifests/common.pp +3 -0
- data/examples/hiera/modules/ntp/manifests/config.pp +5 -0
- data/examples/hiera/modules/ntp/manifests/data.pp +3 -0
- data/examples/hiera/modules/ntp/templates/ntp.conf.erb +3 -0
- data/examples/hiera/modules/users/manifests/common.pp +3 -0
- data/examples/hiera/modules/users/manifests/dc1.pp +3 -0
- data/examples/hiera/modules/users/manifests/development.pp +3 -0
- data/examples/hiera/site.pp +3 -0
- data/ext/build_defaults.yaml +23 -0
- data/ext/debian/README.Debian +8 -0
- data/ext/debian/README.source +2 -0
- data/ext/debian/TODO.Debian +1 -0
- data/ext/debian/changelog.erb +1104 -0
- data/ext/debian/compat +1 -0
- data/ext/debian/control +143 -0
- data/ext/debian/copyright +361 -0
- data/ext/debian/docs +1 -0
- data/ext/debian/fileserver.conf +17 -0
- data/ext/debian/puppet-common.dirs +8 -0
- data/ext/debian/puppet-common.install +4 -0
- data/ext/debian/puppet-common.lintian-overrides +5 -0
- data/ext/debian/puppet-common.manpages +2 -0
- data/ext/debian/puppet-common.postinst +35 -0
- data/ext/debian/puppet-common.postrm +32 -0
- data/ext/debian/puppet-el.dirs +1 -0
- data/ext/debian/puppet-el.emacsen-install +25 -0
- data/ext/debian/puppet-el.emacsen-remove +11 -0
- data/ext/debian/puppet-el.emacsen-startup +9 -0
- data/ext/debian/puppet-el.install +1 -0
- data/ext/debian/puppet-testsuite.install +2 -0
- data/ext/debian/puppet-testsuite.lintian-overrides +4 -0
- data/ext/debian/puppet.conf +14 -0
- data/ext/debian/puppet.default +7 -0
- data/ext/debian/puppet.init +118 -0
- data/ext/debian/puppet.lintian-overrides +3 -0
- data/ext/debian/puppet.logrotate +11 -0
- data/ext/debian/puppet.manpages +32 -0
- data/ext/debian/puppet.postinst +20 -0
- data/ext/debian/puppet.postrm +20 -0
- data/ext/debian/puppet.preinst +20 -0
- data/ext/debian/puppetmaster-common.install +2 -0
- data/ext/debian/puppetmaster-common.manpages +2 -0
- data/ext/debian/puppetmaster-common.puppetqd.default +27 -0
- data/ext/debian/puppetmaster-common.puppetqd.init +84 -0
- data/ext/debian/puppetmaster-passenger.dirs +4 -0
- data/ext/debian/puppetmaster-passenger.postinst +66 -0
- data/ext/debian/puppetmaster-passenger.postrm +33 -0
- data/ext/debian/puppetmaster.README.debian +16 -0
- data/ext/debian/puppetmaster.default +38 -0
- data/ext/debian/puppetmaster.init +158 -0
- data/ext/debian/puppetmaster.lintian-overrides +3 -0
- data/ext/debian/puppetmaster.postinst +20 -0
- data/ext/debian/puppetmaster.postrm +5 -0
- data/ext/debian/puppetmaster.preinst +22 -0
- data/ext/debian/rules +128 -0
- data/ext/debian/source/format +1 -0
- data/ext/debian/source/options +1 -0
- data/ext/debian/vim-puppet.README.Debian +13 -0
- data/ext/debian/vim-puppet.dirs +3 -0
- data/ext/debian/vim-puppet.yaml +5 -0
- data/ext/debian/watch +2 -0
- data/ext/emacs/puppet-mode.el +1 -0
- data/ext/envpuppet +4 -0
- data/ext/envpuppet.bat +3 -2
- data/{conf → ext}/freebsd/puppetd +0 -0
- data/{conf → ext}/freebsd/puppetmasterd +0 -0
- data/{conf → ext}/gentoo/conf.d/puppet +0 -0
- data/{conf → ext}/gentoo/conf.d/puppetmaster +0 -0
- data/{conf → ext}/gentoo/init.d/puppet +0 -0
- data/{conf → ext}/gentoo/init.d/puppetmaster +0 -0
- data/{conf → ext}/gentoo/puppet/fileserver.conf +0 -0
- data/{conf → ext}/gentoo/puppet/puppet.conf +0 -0
- data/ext/ips/puppet-agent +49 -0
- data/ext/ips/puppet-master +44 -0
- data/ext/ips/puppet.conf +29 -0
- data/ext/ips/puppet.p5m.erb +12 -0
- data/ext/ips/puppetagent.xml +46 -0
- data/ext/ips/puppetmaster.xml +42 -0
- data/ext/ips/rules +19 -0
- data/ext/ips/transforms +34 -0
- data/{conf → ext}/osx/PackageInfo.plist +0 -0
- data/{conf → ext}/osx/createpackage.sh +1 -1
- data/ext/osx/file_mapping.yaml +33 -0
- data/ext/osx/preflight.erb +37 -0
- data/{tasks/rake/templates → ext/osx}/prototype.plist.erb +0 -0
- data/ext/packaging/README-Solaris.md +117 -0
- data/ext/packaging/README.md +89 -0
- data/ext/packaging/tasks/00_utils.rb +236 -0
- data/ext/packaging/tasks/10_setupvars.rake +62 -0
- data/ext/packaging/tasks/apple.rake +201 -0
- data/ext/packaging/tasks/clean.rake +5 -0
- data/ext/packaging/tasks/deb.rake +105 -0
- data/ext/packaging/tasks/gem.rake +52 -0
- data/ext/packaging/tasks/ips.rake +78 -0
- data/ext/packaging/tasks/mock.rake +88 -0
- data/ext/packaging/tasks/release.rake +20 -0
- data/ext/packaging/tasks/rpm.rake +39 -0
- data/ext/packaging/tasks/ship.rake +34 -0
- data/ext/packaging/tasks/sign.rake +76 -0
- data/ext/packaging/tasks/tar.rake +20 -0
- data/ext/project_data.yaml +25 -0
- data/ext/rack/files/apache2.conf +2 -1
- data/{conf → ext}/redhat/client.init +0 -0
- data/{conf → ext}/redhat/client.sysconfig +0 -0
- data/{conf → ext}/redhat/fileserver.conf +0 -0
- data/{conf → ext}/redhat/logrotate +0 -0
- data/{conf → ext}/redhat/puppet.conf +0 -0
- data/{conf/redhat/puppet.spec → ext/redhat/puppet.spec.erb} +140 -33
- data/{conf → ext}/redhat/queue.init +0 -0
- data/{conf → ext}/redhat/rundir-perms.patch +0 -0
- data/{conf → ext}/redhat/server.init +0 -0
- data/{conf → ext}/redhat/server.sysconfig +0 -0
- data/{conf → ext}/solaris/pkginfo +0 -0
- data/{conf → ext}/solaris/smf/puppetd.xml +0 -0
- data/{conf → ext}/solaris/smf/puppetmasterd.xml +0 -0
- data/{conf → ext}/solaris/smf/svc-puppetd +0 -0
- data/{conf → ext}/solaris/smf/svc-puppetmasterd +0 -0
- data/{conf → ext}/suse/client.init +0 -0
- data/{conf → ext}/suse/fileserver.conf +0 -0
- data/{conf → ext}/suse/logrotate +0 -0
- data/{conf → ext}/suse/puppet.conf +0 -0
- data/{conf → ext}/suse/puppet.spec +1 -1
- data/{conf → ext}/suse/server.init +0 -0
- data/ext/systemd/puppetagent.service +13 -0
- data/ext/systemd/puppetmaster.service +13 -0
- data/{conf → ext}/windows/eventlog/Rakefile +0 -0
- data/{conf → ext}/windows/eventlog/puppetres.dll +0 -0
- data/{conf → ext}/windows/eventlog/puppetres.mc +0 -0
- data/ext/windows/service/daemon.bat +6 -0
- data/ext/windows/service/daemon.rb +90 -0
- data/install.rb +22 -32
- data/lib/hiera/backend/puppet_backend.rb +102 -0
- data/lib/hiera/scope.rb +42 -0
- data/lib/hiera_puppet.rb +89 -0
- data/lib/puppet.rb +1 -1
- data/lib/puppet/agent.rb +2 -2
- data/lib/puppet/agent/locker.rb +12 -9
- data/lib/puppet/application.rb +10 -8
- data/lib/puppet/application/agent.rb +12 -8
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/application/cert.rb +6 -6
- data/lib/puppet/application/certificate.rb +1 -4
- data/lib/puppet/application/describe.rb +1 -1
- data/lib/puppet/application/device.rb +5 -2
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/face_base.rb +3 -13
- data/lib/puppet/application/filebucket.rb +1 -1
- data/lib/puppet/application/inspect.rb +1 -1
- data/lib/puppet/application/kick.rb +4 -2
- data/lib/puppet/application/master.rb +2 -2
- data/lib/puppet/application/queue.rb +3 -1
- data/lib/puppet/application/resource.rb +1 -1
- data/lib/puppet/configurer.rb +11 -7
- data/lib/puppet/configurer/downloader.rb +1 -4
- data/lib/puppet/daemon.rb +4 -4
- data/lib/puppet/defaults.rb +64 -60
- data/lib/puppet/external/dot.rb +1 -1
- data/lib/puppet/external/pson/common.rb +15 -0
- data/lib/puppet/external/pson/pure.rb +0 -62
- data/lib/puppet/external/pson/pure/generator.rb +1 -1
- data/lib/puppet/external/pson/pure/parser.rb +2 -2
- data/lib/puppet/face/ca.rb +19 -14
- data/lib/puppet/face/config.rb +2 -2
- data/lib/puppet/face/facts.rb +1 -1
- data/lib/puppet/face/help/action.erb +0 -1
- data/lib/puppet/face/help/face.erb +0 -1
- data/lib/puppet/face/help/man.erb +3 -6
- data/lib/puppet/face/module/install.rb +1 -1
- data/lib/puppet/face/module/list.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/node.rb +1 -1
- data/lib/puppet/face/node/clean.rb +30 -25
- data/lib/puppet/feature/base.rb +0 -3
- data/lib/puppet/feature/rails.rb +2 -1
- data/lib/puppet/file_serving/terminus_selector.rb +1 -1
- data/lib/puppet/indirector/catalog/active_record.rb +5 -0
- data/lib/puppet/indirector/catalog/static_compiler.rb +2 -3
- data/lib/puppet/indirector/certificate/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_request/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/face.rb +3 -3
- data/lib/puppet/indirector/facts/active_record.rb +5 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -4
- data/lib/puppet/indirector/facts/inventory_active_record.rb +6 -0
- data/lib/puppet/indirector/file_bucket_file/file.rb +2 -1
- data/lib/puppet/indirector/indirection.rb +2 -2
- data/lib/puppet/indirector/key/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/node/active_record.rb +5 -0
- data/lib/puppet/indirector/request.rb +4 -0
- data/lib/puppet/indirector/resource/active_record.rb +5 -0
- data/lib/puppet/network/authentication.rb +30 -0
- data/lib/puppet/network/http.rb +0 -13
- data/lib/puppet/network/http/connection.rb +10 -2
- data/lib/puppet/network/http/handler.rb +8 -0
- data/lib/puppet/network/http/mongrel/rest.rb +5 -0
- data/lib/puppet/network/http/rack/rest.rb +7 -0
- data/lib/puppet/network/http/webrick.rb +3 -6
- data/lib/puppet/network/http/webrick/rest.rb +4 -0
- data/lib/puppet/network/server.rb +9 -33
- data/lib/puppet/node.rb +1 -1
- data/lib/puppet/node/facts.rb +0 -1
- data/lib/puppet/parser/compiler.rb +1 -1
- data/lib/puppet/parser/functions.rb +12 -1
- data/lib/puppet/parser/functions/hiera.rb +8 -0
- data/lib/puppet/parser/functions/hiera_array.rb +8 -0
- data/lib/puppet/parser/functions/hiera_hash.rb +8 -0
- data/lib/puppet/parser/functions/hiera_include.rb +11 -0
- data/lib/puppet/parser/functions/shellquote.rb +21 -29
- data/lib/puppet/parser/lexer.rb +2 -1
- data/lib/puppet/parser/scope.rb +8 -0
- data/lib/puppet/provider/exec/windows.rb +1 -1
- data/lib/puppet/provider/group/groupadd.rb +2 -3
- data/lib/puppet/provider/package/pkg.rb +37 -10
- data/lib/puppet/provider/service/daemontools.rb +1 -1
- data/lib/puppet/provider/service/launchd.rb +1 -1
- data/lib/puppet/provider/service/redhat.rb +1 -1
- data/lib/puppet/provider/service/runit.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +8 -3
- data/lib/puppet/provider/user/windows_adsi.rb +11 -0
- data/lib/puppet/provider/zfs/zfs.rb +29 -2
- data/lib/puppet/provider/zone/solaris.rb +144 -39
- data/lib/puppet/provider/zpool/zpool.rb +7 -10
- data/lib/puppet/settings.rb +50 -86
- data/lib/puppet/settings/duration_setting.rb +34 -0
- data/lib/puppet/settings/terminus_setting.rb +16 -0
- data/lib/puppet/ssl/base.rb +49 -9
- data/lib/puppet/ssl/certificate.rb +13 -9
- data/lib/puppet/ssl/certificate_authority.rb +4 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +10 -17
- data/lib/puppet/ssl/certificate_factory.rb +4 -21
- data/lib/puppet/ssl/certificate_request.rb +1 -10
- data/lib/puppet/ssl/certificate_revocation_list.rb +1 -3
- data/lib/puppet/ssl/digest.rb +20 -0
- data/lib/puppet/ssl/host.rb +31 -6
- data/lib/puppet/test/test_helper.rb +1 -1
- data/lib/puppet/transaction/report.rb +2 -1
- data/lib/puppet/type.rb +1 -1
- data/lib/puppet/type/augeas.rb +1 -1
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +7 -8
- data/lib/puppet/type/file.rb +1 -1
- data/lib/puppet/type/file/content.rb +2 -2
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/file/mode.rb +1 -1
- data/lib/puppet/type/file/selcontext.rb +6 -2
- data/lib/puppet/type/file/source.rb +1 -1
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/scheduled_task.rb +1 -1
- data/lib/puppet/type/tidy.rb +1 -1
- data/lib/puppet/type/zone.rb +126 -253
- data/lib/puppet/util.rb +10 -23
- data/lib/puppet/util/adsi.rb +22 -14
- data/lib/puppet/util/log/destinations.rb +7 -0
- data/lib/puppet/util/log/rate_limited_logger.rb +40 -0
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/monkey_patches.rb +8 -0
- data/lib/puppet/util/platform.rb +7 -0
- data/lib/puppet/util/selinux.rb +31 -36
- data/lib/puppet/util/windows/error.rb +1 -1
- data/lib/puppet/util/windows/process.rb +3 -3
- data/lib/puppet/util/windows/security.rb +7 -7
- data/lib/puppet/util/windows/user.rb +65 -2
- data/lib/puppet/util/zaml.rb +90 -46
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/hiera.yaml +9 -0
- data/spec/fixtures/manifests/site.pp +0 -0
- data/spec/integration/defaults_spec.rb +25 -11
- data/spec/integration/faces/ca_spec.rb +11 -16
- data/spec/integration/network/server/webrick_spec.rb +14 -27
- data/spec/integration/node_spec.rb +4 -1
- data/spec/integration/parser/functions/require_spec.rb +3 -3
- data/spec/integration/parser/undef_param_spec.rb +88 -0
- data/spec/integration/provider/mount_spec.rb +4 -1
- data/spec/integration/ssl/certificate_authority_spec.rb +18 -0
- data/spec/lib/puppet_spec/files.rb +3 -3
- data/spec/lib/puppet_spec/settings.rb +0 -1
- data/spec/shared_contexts/platform.rb +8 -0
- data/spec/spec_helper.rb +6 -0
- data/spec/unit/agent/locker_spec.rb +8 -2
- data/spec/unit/application/agent_spec.rb +29 -7
- data/spec/unit/application/apply_spec.rb +1 -1
- data/spec/unit/application/device_spec.rb +18 -1
- data/spec/unit/application/face_base_spec.rb +16 -2
- data/spec/unit/application/kick_spec.rb +8 -0
- data/spec/unit/application/queue_spec.rb +5 -0
- data/spec/unit/application_spec.rb +13 -23
- data/spec/unit/configurer/downloader_spec.rb +2 -11
- data/spec/unit/configurer_spec.rb +6 -0
- data/spec/unit/face/node_spec.rb +1 -1
- data/spec/unit/hiera/backend/puppet_backend_spec.rb +140 -0
- data/spec/unit/hiera/scope_spec.rb +62 -0
- data/spec/unit/hiera_puppet_spec.rb +111 -0
- data/spec/unit/indirector/catalog/active_record_spec.rb +4 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +194 -0
- data/spec/unit/indirector/certificate/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/facts/active_record_spec.rb +37 -26
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +5 -0
- data/spec/unit/indirector/hiera_spec.rb +2 -1
- data/spec/unit/indirector/key/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/node/active_record_spec.rb +7 -0
- data/spec/unit/indirector/request_spec.rb +22 -0
- data/spec/unit/indirector/resource/active_record_spec.rb +5 -0
- data/spec/unit/module_tool/application_spec.rb +1 -1
- data/spec/unit/network/authentication_spec.rb +86 -0
- data/spec/unit/network/http/connection_spec.rb +21 -0
- data/spec/unit/network/http/handler_spec.rb +12 -0
- data/spec/unit/network/http/rack/rest_spec.rb +7 -0
- data/spec/unit/network/http/webrick_spec.rb +11 -26
- data/spec/unit/network/server_spec.rb +79 -192
- data/spec/unit/node/facts_spec.rb +2 -2
- data/spec/unit/parser/ast/vardef_spec.rb +4 -4
- data/spec/unit/parser/files_spec.rb +3 -0
- data/spec/unit/parser/functions/defined_spec.rb +5 -5
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +1 -1
- data/spec/unit/parser/functions/hiera_array_spec.rb +23 -0
- data/spec/unit/parser/functions/hiera_hash_spec.rb +19 -0
- data/spec/unit/parser/functions/hiera_include_spec.rb +19 -0
- data/spec/unit/parser/functions/hiera_spec.rb +21 -0
- data/spec/unit/parser/functions/include_spec.rb +3 -3
- data/spec/unit/parser/functions/realize_spec.rb +3 -3
- data/spec/unit/parser/functions/require_spec.rb +5 -5
- data/spec/unit/parser/functions/shellquote_spec.rb +0 -4
- data/spec/unit/parser/functions_spec.rb +6 -10
- data/spec/unit/parser/lexer_spec.rb +13 -0
- data/spec/unit/parser/scope_spec.rb +16 -1
- data/spec/unit/provider/exec/posix_spec.rb +7 -6
- data/spec/unit/provider/group/groupadd_spec.rb +36 -30
- data/spec/unit/provider/package/pkg_spec.rb +16 -2
- data/spec/unit/provider/service/redhat_spec.rb +2 -2
- data/spec/unit/provider/sshkey/parsed_spec.rb +4 -0
- data/spec/unit/provider/user/user_role_add_spec.rb +125 -126
- data/spec/unit/provider/user/useradd_spec.rb +147 -118
- data/spec/unit/provider/user/windows_adsi_spec.rb +22 -0
- data/spec/unit/provider/zone/solaris_spec.rb +126 -7
- data/spec/unit/provider/zpool/zpool_spec.rb +4 -3
- data/spec/unit/puppet_spec.rb +7 -0
- data/spec/unit/settings/duration_setting_spec.rb +45 -0
- data/spec/unit/settings/terminus_setting_spec.rb +28 -0
- data/spec/unit/settings_spec.rb +21 -23
- data/spec/unit/ssl/base_spec.rb +68 -19
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +19 -30
- data/spec/unit/ssl/certificate_authority_spec.rb +3 -2
- data/spec/unit/ssl/certificate_factory_spec.rb +15 -6
- data/spec/unit/ssl/certificate_request_spec.rb +80 -113
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +1 -1
- data/spec/unit/ssl/certificate_spec.rb +26 -2
- data/spec/unit/ssl/digest_spec.rb +35 -0
- data/spec/unit/ssl/host_spec.rb +73 -27
- data/spec/unit/ssl/key_spec.rb +0 -4
- data/spec/unit/type/exec_spec.rb +1 -1
- data/spec/unit/type/file_spec.rb +2 -1
- data/spec/unit/type/scheduled_task_spec.rb +2 -2
- data/spec/unit/type/zone_spec.rb +52 -10
- data/spec/unit/util/adsi_spec.rb +19 -0
- data/spec/unit/util/checksums_spec.rb +2 -3
- data/spec/unit/util/execution_spec.rb +1 -1
- data/spec/unit/util/log/destinations_spec.rb +1 -0
- data/spec/unit/util/log/rate_limited_logger_spec.rb +51 -0
- data/spec/unit/util/logging_spec.rb +6 -6
- data/spec/unit/util/selinux_spec.rb +24 -32
- data/spec/unit/util/zaml_spec.rb +94 -6
- data/spec/unit/util_spec.rb +17 -0
- data/spec/watchr.rb +2 -6
- data/tasks/{rake/manpages.rake → manpages.rake} +0 -0
- data/tasks/{rake/parser.rake → parser.rake} +0 -0
- metadata +1003 -119
- data/CHANGELOG +0 -9233
- data/conf/osx/preflight +0 -24
- data/lib/puppet/network/http/mongrel.rb +0 -35
- data/lib/puppet/util/config_timeout.rb +0 -24
- data/spec/unit/network/http/mongrel/rest_spec.rb +0 -257
- data/spec/unit/network/http/mongrel_spec.rb +0 -91
- data/spec/unit/network/http_spec.rb +0 -31
- data/spec/unit/util/config_timeout_spec.rb +0 -57
- data/tasks/rake/apple.rake +0 -176
- data/tasks/rake/changelog.rake +0 -15
- data/tasks/rake/ci.rake +0 -22
- data/tasks/rake/dailybuild.rake +0 -9
- data/tasks/rake/gem.rake +0 -63
- data/tasks/rake/git_workflow.rake +0 -134
- data/tasks/rake/metrics.rake +0 -14
- data/tasks/rake/sign.rake +0 -14
- data/tasks/rake/testbranch.rake +0 -16
- data/tasks/rake/yard.rake +0 -11
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'puppet/indirector/code'
|
2
|
+
require 'puppet/ssl/certificate'
|
3
|
+
|
4
|
+
class Puppet::SSL::Certificate::DisabledCa < Puppet::Indirector::Code
|
5
|
+
desc "Manage SSL certificates on disk, but reject any remote access
|
6
|
+
to the SSL data store. Used when a master has an explicitly disabled
|
7
|
+
CA to prevent clients getting confusing 'success' behaviour."
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@file = Puppet::SSL::Certificate.indirection.terminus(:file)
|
11
|
+
end
|
12
|
+
|
13
|
+
[:find, :head, :search, :save, :destroy].each do |name|
|
14
|
+
define_method(name) do |request|
|
15
|
+
if request.remote?
|
16
|
+
raise Puppet::Error, "this master is not a CA"
|
17
|
+
else
|
18
|
+
@file.send(name, request)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'puppet/indirector/code'
|
2
|
+
require 'puppet/ssl/certificate_request'
|
3
|
+
|
4
|
+
class Puppet::SSL::CertificateRequest::DisabledCa < Puppet::Indirector::Code
|
5
|
+
desc "Manage SSL certificate requests on disk, but reject any remote access
|
6
|
+
to the SSL data store. Used when a master has an explicitly disabled CA to
|
7
|
+
prevent clients getting confusing 'success' behaviour."
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@file = Puppet::SSL::CertificateRequest.indirection.terminus(:file)
|
11
|
+
end
|
12
|
+
|
13
|
+
[:find, :head, :search, :save, :destroy].each do |name|
|
14
|
+
define_method(name) do |request|
|
15
|
+
if request.remote?
|
16
|
+
raise Puppet::Error, "this master is not a CA"
|
17
|
+
else
|
18
|
+
@file.send(name, request)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'puppet/indirector/code'
|
2
|
+
require 'puppet/ssl/certificate_revocation_list'
|
3
|
+
|
4
|
+
class Puppet::SSL::CertificateRevocationList::DisabledCa < Puppet::Indirector::Code
|
5
|
+
desc "Manage SSL certificate revocation lists, but reject any remote access
|
6
|
+
to the SSL data store. Used when a master has an explicitly disabled CA to
|
7
|
+
prevent clients getting confusing 'success' behaviour."
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@file = Puppet::SSL::CertificateRevocationList.indirection.terminus(:file)
|
11
|
+
end
|
12
|
+
|
13
|
+
[:find, :head, :search, :save, :destroy].each do |name|
|
14
|
+
define_method(name) do |request|
|
15
|
+
if request.remote?
|
16
|
+
raise Puppet::Error, "this master is not a CA"
|
17
|
+
else
|
18
|
+
@file.send(name, request)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -51,11 +51,11 @@ class Puppet::Indirector::Face < Puppet::Face
|
|
51
51
|
|
52
52
|
option "--extra HASH" do
|
53
53
|
summary "Extra arguments to pass to the indirection request"
|
54
|
-
description <<-
|
54
|
+
description <<-EOT
|
55
55
|
A terminus can take additional arguments to refine the operation, which
|
56
56
|
are passed as an arbitrary hash to the back-end. Anything passed as
|
57
57
|
the extra value is just send direct to the back-end.
|
58
|
-
|
58
|
+
EOT
|
59
59
|
default_to do Hash.new end
|
60
60
|
end
|
61
61
|
|
@@ -94,7 +94,7 @@ class Puppet::Indirector::Face < Puppet::Face
|
|
94
94
|
description <<-EOT
|
95
95
|
Prints the default terminus class for this subcommand. Note that different
|
96
96
|
run modes may have different default termini; when in doubt, specify the
|
97
|
-
run mode with the '--
|
97
|
+
run mode with the '--run_mode' option.
|
98
98
|
EOT
|
99
99
|
|
100
100
|
when_invoked do |options|
|
@@ -6,6 +6,11 @@ require 'puppet/indirector/active_record'
|
|
6
6
|
class Puppet::Node::Facts::ActiveRecord < Puppet::Indirector::ActiveRecord
|
7
7
|
use_ar_model Puppet::Rails::Host
|
8
8
|
|
9
|
+
def initialize
|
10
|
+
Puppet.deprecation_warning "ActiveRecord-based storeconfigs and inventory are deprecated. See http://links.puppetlabs.com/activerecord-deprecation"
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
9
14
|
# Find the Rails host and pull its facts as a Facts instance.
|
10
15
|
def find(request)
|
11
16
|
return nil unless host = ar_model.find_by_name(request.key, :include => {:fact_values => :fact_name})
|
@@ -1,10 +1,7 @@
|
|
1
1
|
require 'puppet/node/facts'
|
2
2
|
require 'puppet/indirector/code'
|
3
|
-
require 'puppet/util/config_timeout'
|
4
3
|
|
5
4
|
class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
|
6
|
-
extend Puppet::Util::ConfigTimeout
|
7
|
-
|
8
5
|
desc "Retrieve facts from Facter. This provides a somewhat abstract interface
|
9
6
|
between Puppet and Facter. It's only `somewhat` abstract because it always
|
10
7
|
returns the local host's facts, regardless of what you attempt to find."
|
@@ -35,7 +32,7 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
|
|
35
32
|
fqfile = ::File.join(dir, file)
|
36
33
|
begin
|
37
34
|
Puppet.info "Loading facts in #{fqfile}"
|
38
|
-
::Timeout::timeout(
|
35
|
+
::Timeout::timeout(Puppet[:configtimeout]) do
|
39
36
|
load file
|
40
37
|
end
|
41
38
|
rescue SystemExit,NoMemoryError
|
@@ -5,6 +5,12 @@ require 'puppet/indirector/active_record'
|
|
5
5
|
require 'puppet/util/retryaction'
|
6
6
|
|
7
7
|
class Puppet::Node::Facts::InventoryActiveRecord < Puppet::Indirector::ActiveRecord
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
Puppet.deprecation_warning "ActiveRecord-based storeconfigs and inventory are deprecated. See http://links.puppetlabs.com/activerecord-deprecation"
|
11
|
+
super
|
12
|
+
end
|
13
|
+
|
8
14
|
def find(request)
|
9
15
|
node = Puppet::Rails::InventoryNode.find_by_name(request.key)
|
10
16
|
return nil unless node
|
@@ -67,9 +67,10 @@ module Puppet::FileBucketFile
|
|
67
67
|
dir_path = path_for(bucket_file.bucket_path, bucket_file.checksum_data)
|
68
68
|
paths_path = ::File.join(dir_path, 'paths')
|
69
69
|
|
70
|
-
# If the file already exists,
|
70
|
+
# If the file already exists, touch it.
|
71
71
|
if ::File.exist?(filename)
|
72
72
|
verify_identical_file!(bucket_file)
|
73
|
+
::FileUtils.touch(filename)
|
73
74
|
else
|
74
75
|
# Make the directories if necessary.
|
75
76
|
unless ::File.directory?(dir_path)
|
@@ -72,7 +72,7 @@ class Puppet::Indirector::Indirection
|
|
72
72
|
|
73
73
|
# Default to the runinterval for the ttl.
|
74
74
|
def ttl
|
75
|
-
@ttl ||= Puppet[:runinterval]
|
75
|
+
@ttl ||= Puppet[:runinterval]
|
76
76
|
end
|
77
77
|
|
78
78
|
# Calculate the expiration date for a returned instance.
|
@@ -133,7 +133,7 @@ class Puppet::Indirector::Indirection
|
|
133
133
|
def terminus_class
|
134
134
|
unless @terminus_class
|
135
135
|
if setting = self.terminus_setting
|
136
|
-
self.terminus_class = Puppet.settings[setting]
|
136
|
+
self.terminus_class = Puppet.settings[setting]
|
137
137
|
else
|
138
138
|
raise Puppet::DevError, "No terminus class nor terminus setting was provided for indirection #{self.name}"
|
139
139
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'puppet/indirector/code'
|
2
|
+
require 'puppet/ssl/key'
|
3
|
+
|
4
|
+
class Puppet::SSL::Key::DisabledCa < Puppet::Indirector::Code
|
5
|
+
desc "Manage the CA private key, but reject any remote access
|
6
|
+
to the SSL data store. Used when a master has an explicitly disabled CA to
|
7
|
+
prevent clients getting confusing 'success' behaviour."
|
8
|
+
|
9
|
+
def initialize
|
10
|
+
@file = Puppet::SSL::Key.indirection.terminus(:file)
|
11
|
+
end
|
12
|
+
|
13
|
+
[:find, :head, :search, :save, :destroy].each do |name|
|
14
|
+
define_method(name) do |request|
|
15
|
+
if request.remote?
|
16
|
+
raise Puppet::Error, "this master is not a CA"
|
17
|
+
else
|
18
|
+
@file.send(name, request)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -5,6 +5,11 @@ require 'puppet/node'
|
|
5
5
|
class Puppet::Node::ActiveRecord < Puppet::Indirector::ActiveRecord
|
6
6
|
use_ar_model Puppet::Rails::Host
|
7
7
|
|
8
|
+
def initialize
|
9
|
+
Puppet.deprecation_warning "ActiveRecord-based storeconfigs and inventory are deprecated. See http://links.puppetlabs.com/activerecord-deprecation"
|
10
|
+
super
|
11
|
+
end
|
12
|
+
|
8
13
|
def find(request)
|
9
14
|
node = super
|
10
15
|
node.environment = request.environment
|
@@ -1,6 +1,11 @@
|
|
1
1
|
require 'puppet/indirector/active_record'
|
2
2
|
|
3
3
|
class Puppet::Resource::ActiveRecord < Puppet::Indirector::ActiveRecord
|
4
|
+
def initialize
|
5
|
+
Puppet.deprecation_warning "ActiveRecord-based storeconfigs and inventory are deprecated. See http://links.puppetlabs.com/activerecord-deprecation"
|
6
|
+
super
|
7
|
+
end
|
8
|
+
|
4
9
|
def search(request)
|
5
10
|
type = request_to_type_name(request)
|
6
11
|
host = request.options[:host]
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'puppet/ssl/certificate_authority'
|
2
|
+
require 'puppet/util/log/rate_limited_logger'
|
3
|
+
|
4
|
+
# Place for any authentication related bits
|
5
|
+
module Puppet::Network::Authentication
|
6
|
+
# Create a rate-limited logger for the expiration warning that uses the run interval
|
7
|
+
# as the minimum amount of time before a warning about the same cert can be logged again.
|
8
|
+
# This is a class variable so that all classes that include the module share the same logger.
|
9
|
+
@@logger = Puppet::Util::Log::RateLimitedLogger.new(Puppet[:runinterval])
|
10
|
+
|
11
|
+
# Check the expiration of known certificates and optionally any that are specified as part of a request
|
12
|
+
def warn_if_near_expiration(*certs)
|
13
|
+
# Check CA cert if we're functioning as a CA
|
14
|
+
certs << Puppet::SSL::CertificateAuthority.instance.host.certificate if Puppet::SSL::CertificateAuthority.ca?
|
15
|
+
|
16
|
+
# Always check the host cert if we have one, this will be the agent or master cert depending on the run mode
|
17
|
+
certs << Puppet::SSL::Host.localhost.certificate if FileTest.exist?(Puppet[:hostcert])
|
18
|
+
|
19
|
+
# Remove nil values for caller convenience
|
20
|
+
certs.compact.each do |cert|
|
21
|
+
# Allow raw OpenSSL certificate instances or Puppet certificate wrappers to be specified
|
22
|
+
cert = Puppet::SSL::Certificate.from_instance(cert) if cert.is_a?(OpenSSL::X509::Certificate)
|
23
|
+
raise ArgumentError, "Invalid certificate '#{cert.inspect}'" unless cert.is_a?(Puppet::SSL::Certificate)
|
24
|
+
|
25
|
+
if cert.near_expiration?
|
26
|
+
@@logger.warning("Certificate '#{cert.unmunged_name}' will expire on #{cert.expiration.strftime('%Y-%m-%dT%H:%M:%S%Z')}")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/puppet/network/http.rb
CHANGED
@@ -1,15 +1,2 @@
|
|
1
1
|
module Puppet::Network::HTTP
|
2
|
-
def self.server_class_by_type(kind)
|
3
|
-
case kind.to_sym
|
4
|
-
when :webrick
|
5
|
-
require 'puppet/network/http/webrick'
|
6
|
-
return Puppet::Network::HTTP::WEBrick
|
7
|
-
when :mongrel
|
8
|
-
raise ArgumentError, "Mongrel is not installed on this platform" unless Puppet.features.mongrel?
|
9
|
-
require 'puppet/network/http/mongrel'
|
10
|
-
return Puppet::Network::HTTP::Mongrel
|
11
|
-
else
|
12
|
-
raise ArgumentError, "Unknown HTTP server name [#{kind}]"
|
13
|
-
end
|
14
|
-
end
|
15
2
|
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'net/https'
|
2
2
|
require 'puppet/ssl/host'
|
3
3
|
require 'puppet/ssl/configuration'
|
4
|
+
require 'puppet/network/authentication'
|
4
5
|
|
5
6
|
module Puppet::Network::HTTP
|
6
7
|
|
@@ -14,6 +15,7 @@ module Puppet::Network::HTTP
|
|
14
15
|
# * Provides some useful error handling for any SSL errors that occur
|
15
16
|
# during a request.
|
16
17
|
class Connection
|
18
|
+
include Puppet::Network::Authentication
|
17
19
|
|
18
20
|
def initialize(host, port, use_ssl = true)
|
19
21
|
@host = host
|
@@ -50,7 +52,7 @@ module Puppet::Network::HTTP
|
|
50
52
|
# constructing the error message if the verification failed.
|
51
53
|
# This is necessary since we don't have direct access to the
|
52
54
|
# cert that we expected the connection to use otherwise.
|
53
|
-
peer_certs << Puppet::SSL::Certificate.
|
55
|
+
peer_certs << Puppet::SSL::Certificate.from_instance(ssl_context.current_cert)
|
54
56
|
# And also keep the detailed verification error if such an error occurs
|
55
57
|
if ssl_context.error_string and not preverify_ok
|
56
58
|
verify_errors << "#{ssl_context.error_string} for #{ssl_context.current_cert.subject}"
|
@@ -58,7 +60,13 @@ module Puppet::Network::HTTP
|
|
58
60
|
preverify_ok
|
59
61
|
end
|
60
62
|
|
61
|
-
connection.send(method, *args)
|
63
|
+
response = connection.send(method, *args)
|
64
|
+
|
65
|
+
# Now that the request completed successfully, lets check the involved
|
66
|
+
# certificates for approaching expiration dates
|
67
|
+
warn_if_near_expiration(*peer_certs)
|
68
|
+
|
69
|
+
response
|
62
70
|
rescue OpenSSL::SSL::SSLError => error
|
63
71
|
if error.message.include? "certificate verify failed"
|
64
72
|
msg = error.message
|
@@ -3,12 +3,14 @@ end
|
|
3
3
|
|
4
4
|
require 'puppet/network/http/api/v1'
|
5
5
|
require 'puppet/network/authorization'
|
6
|
+
require 'puppet/network/authentication'
|
6
7
|
require 'puppet/network/rights'
|
7
8
|
require 'resolv'
|
8
9
|
|
9
10
|
module Puppet::Network::HTTP::Handler
|
10
11
|
include Puppet::Network::HTTP::API::V1
|
11
12
|
include Puppet::Network::Authorization
|
13
|
+
include Puppet::Network::Authentication
|
12
14
|
|
13
15
|
attr_reader :server, :handler
|
14
16
|
|
@@ -64,6 +66,7 @@ module Puppet::Network::HTTP::Handler
|
|
64
66
|
indirection, method, key, params = uri2indirection(http_method(request), path(request), params(request))
|
65
67
|
|
66
68
|
check_authorization(indirection, method, key, params)
|
69
|
+
warn_if_near_expiration(client_cert(request))
|
67
70
|
|
68
71
|
send("do_#{method}", indirection, key, params, request, response)
|
69
72
|
rescue SystemExit,NoMemoryError
|
@@ -216,6 +219,11 @@ module Puppet::Network::HTTP::Handler
|
|
216
219
|
raise NotImplementedError
|
217
220
|
end
|
218
221
|
|
222
|
+
# Retrieve the client certificate from the request if possible
|
223
|
+
def client_cert(request)
|
224
|
+
raise NotImplementedError
|
225
|
+
end
|
226
|
+
|
219
227
|
def decode_params(params)
|
220
228
|
params.inject({}) do |result, ary|
|
221
229
|
param, value = ary
|
@@ -51,6 +51,11 @@ class Puppet::Network::HTTP::MongrelREST < Mongrel::HttpHandler
|
|
51
51
|
body
|
52
52
|
end
|
53
53
|
|
54
|
+
# There is no standard way of retrieving the client certificate since it is completely
|
55
|
+
# dictated by the web server environment; this is a stub to prevent a NotImplementedError
|
56
|
+
def client_cert(request)
|
57
|
+
end
|
58
|
+
|
54
59
|
def set_content_type(response, format)
|
55
60
|
response.header['Content-Type'] = format_to_mime(format)
|
56
61
|
end
|
@@ -79,6 +79,13 @@ class Puppet::Network::HTTP::RackREST < Puppet::Network::HTTP::RackHttpHandler
|
|
79
79
|
request.body.read
|
80
80
|
end
|
81
81
|
|
82
|
+
def client_cert(request)
|
83
|
+
# This environment variable is set by mod_ssl, note that it
|
84
|
+
# requires the `+ExportCertData` option in the `SSLOptions` directive
|
85
|
+
return nil unless cert = request.env['SSL_CLIENT_CERT']
|
86
|
+
OpenSSL::X509::Certificate.new(cert)
|
87
|
+
end
|
88
|
+
|
82
89
|
def extract_client_info(request)
|
83
90
|
result = {}
|
84
91
|
result[:ip] = request.ip
|
@@ -8,16 +8,13 @@ require 'puppet/ssl/certificate_revocation_list'
|
|
8
8
|
require 'puppet/ssl/configuration'
|
9
9
|
|
10
10
|
class Puppet::Network::HTTP::WEBrick
|
11
|
-
def initialize
|
11
|
+
def initialize
|
12
12
|
@listening = false
|
13
13
|
@mutex = Mutex.new
|
14
14
|
end
|
15
15
|
|
16
|
-
def listen(
|
17
|
-
|
18
|
-
raise ArgumentError, ":port must be specified." unless args[:port]
|
19
|
-
|
20
|
-
arguments = {:BindAddress => args[:address], :Port => args[:port]}
|
16
|
+
def listen(address, port)
|
17
|
+
arguments = {:BindAddress => address, :Port => port}
|
21
18
|
arguments.merge!(setup_logger)
|
22
19
|
arguments.merge!(setup_ssl)
|
23
20
|
|
@@ -44,6 +44,10 @@ class Puppet::Network::HTTP::WEBrickREST < WEBrick::HTTPServlet::AbstractServlet
|
|
44
44
|
request.body
|
45
45
|
end
|
46
46
|
|
47
|
+
def client_cert(request)
|
48
|
+
request.client_cert
|
49
|
+
end
|
50
|
+
|
47
51
|
# Set the specified format as the content type of the response.
|
48
52
|
def set_content_type(response, format)
|
49
53
|
response["content-type"] = format_to_mime(format)
|
@@ -1,8 +1,9 @@
|
|
1
1
|
require 'puppet/network/http'
|
2
2
|
require 'puppet/util/pidlock'
|
3
|
+
require 'puppet/network/http/webrick'
|
3
4
|
|
4
5
|
class Puppet::Network::Server
|
5
|
-
attr_reader :
|
6
|
+
attr_reader :address, :port
|
6
7
|
|
7
8
|
# TODO: does anything actually call this? It seems like it's a duplicate of
|
8
9
|
# the code in Puppet::Daemon, but that it's not actually called anywhere.
|
@@ -45,19 +46,14 @@ class Puppet::Network::Server
|
|
45
46
|
Puppet[:pidfile]
|
46
47
|
end
|
47
48
|
|
48
|
-
def initialize(
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
@server_type = Puppet[:servertype] or raise "No servertype configuration found." # e.g., WEBrick, Mongrel, etc.
|
53
|
-
http_server_class || raise(ArgumentError, "Could not determine HTTP Server class for server type [#{@server_type}]")
|
54
|
-
|
55
|
-
@port = args[:port] || Puppet[:masterport] || raise(ArgumentError, "Must specify :port or configure Puppet :masterport")
|
56
|
-
@address = determine_bind_address
|
49
|
+
def initialize(address, port, handlers = nil)
|
50
|
+
@port = port
|
51
|
+
@address = address
|
52
|
+
@http_server = Puppet::Network::HTTP::WEBrick.new
|
57
53
|
|
58
54
|
@listening = false
|
59
55
|
@routes = {}
|
60
|
-
self.register(
|
56
|
+
self.register(handlers) if handlers
|
61
57
|
|
62
58
|
# Make sure we have all of the directories we need to function.
|
63
59
|
Puppet.settings.use(:main, :ssl, :application)
|
@@ -93,19 +89,15 @@ class Puppet::Network::Server
|
|
93
89
|
def listen
|
94
90
|
raise "Cannot listen -- already listening." if listening?
|
95
91
|
@listening = true
|
96
|
-
http_server.listen(
|
92
|
+
@http_server.listen(address, port)
|
97
93
|
end
|
98
94
|
|
99
95
|
def unlisten
|
100
96
|
raise "Cannot unlisten -- not currently listening." unless listening?
|
101
|
-
http_server.unlisten
|
97
|
+
@http_server.unlisten
|
102
98
|
@listening = false
|
103
99
|
end
|
104
100
|
|
105
|
-
def http_server_class
|
106
|
-
http_server_class_by_type(@server_type)
|
107
|
-
end
|
108
|
-
|
109
101
|
def start
|
110
102
|
create_pidfile
|
111
103
|
close_streams if Puppet[:daemonize]
|
@@ -116,20 +108,4 @@ class Puppet::Network::Server
|
|
116
108
|
unlisten
|
117
109
|
remove_pidfile
|
118
110
|
end
|
119
|
-
|
120
|
-
private
|
121
|
-
|
122
|
-
def http_server
|
123
|
-
@http_server ||= http_server_class.new
|
124
|
-
end
|
125
|
-
|
126
|
-
def http_server_class_by_type(kind)
|
127
|
-
Puppet::Network::HTTP.server_class_by_type(kind)
|
128
|
-
end
|
129
|
-
|
130
|
-
def determine_bind_address
|
131
|
-
tmp = Puppet[:bindaddress]
|
132
|
-
return tmp if tmp != ""
|
133
|
-
server_type.to_s == "webrick" ? "0.0.0.0" : "127.0.0.1"
|
134
|
-
end
|
135
111
|
end
|