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,33 @@
|
|
1
|
+
#! /usr/bin/env ruby -S rspec
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'puppet/indirector/certificate_revocation_list/disabled_ca'
|
4
|
+
|
5
|
+
describe Puppet::SSL::CertificateRevocationList::DisabledCa do
|
6
|
+
def request(type, remote)
|
7
|
+
r = Puppet::Indirector::Request.new(:certificate_revocation_list, type, "foo.com", nil)
|
8
|
+
if remote
|
9
|
+
r.ip = '10.0.0.1'
|
10
|
+
r.node = 'agent.example.com'
|
11
|
+
end
|
12
|
+
r
|
13
|
+
end
|
14
|
+
|
15
|
+
context "when not a CA" do
|
16
|
+
before :each do
|
17
|
+
Puppet[:ca] = false
|
18
|
+
Puppet::SSL::Host.ca_location = :none
|
19
|
+
end
|
20
|
+
|
21
|
+
[:find, :head, :search, :save, :destroy].each do |name|
|
22
|
+
it "should fail remote #{name} requests" do
|
23
|
+
expect { subject.send(name, request(name, true)) }.
|
24
|
+
to raise_error Puppet::Error, /is not a CA/
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should forward local #{name} requests" do
|
28
|
+
Puppet::SSL::CertificateRevocationList.indirection.terminus(:file).expects(name)
|
29
|
+
subject.send(name, request(name, false))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -9,7 +9,15 @@ describe "Puppet::Node::Facts::ActiveRecord", :if => Puppet.features.rails? do
|
|
9
9
|
require 'puppet/indirector/facts/active_record'
|
10
10
|
Puppet.features.stubs(:rails?).returns true
|
11
11
|
Puppet::Rails.stubs(:init)
|
12
|
-
|
12
|
+
end
|
13
|
+
|
14
|
+
let :terminus do
|
15
|
+
Puppet::Node::Facts::ActiveRecord.new
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should issue a deprecation warning" do
|
19
|
+
Puppet.expects(:deprecation_warning).with() { |msg| msg =~ /ActiveRecord-based storeconfigs and inventory are deprecated/ }
|
20
|
+
terminus
|
13
21
|
end
|
14
22
|
|
15
23
|
it "should be a subclass of the ActiveRecord terminus class" do
|
@@ -21,24 +29,23 @@ describe "Puppet::Node::Facts::ActiveRecord", :if => Puppet.features.rails? do
|
|
21
29
|
end
|
22
30
|
|
23
31
|
describe "when finding an instance" do
|
24
|
-
|
25
|
-
|
32
|
+
let :request do
|
33
|
+
stub 'request', :key => "foo"
|
26
34
|
end
|
27
35
|
|
28
36
|
it "should use the Hosts ActiveRecord class to find the host" do
|
29
37
|
Puppet::Rails::Host.expects(:find_by_name).with { |key, args| key == "foo" }
|
30
|
-
|
38
|
+
terminus.find(request)
|
31
39
|
end
|
32
40
|
|
33
41
|
it "should include the fact names and values when finding the host" do
|
34
42
|
Puppet::Rails::Host.expects(:find_by_name).with { |key, args| args[:include] == {:fact_values => :fact_name} }
|
35
|
-
|
43
|
+
terminus.find(request)
|
36
44
|
end
|
37
45
|
|
38
46
|
it "should return nil if no host instance can be found" do
|
39
47
|
Puppet::Rails::Host.expects(:find_by_name).returns nil
|
40
|
-
|
41
|
-
@terminus.find(@request).should be_nil
|
48
|
+
terminus.find(request).should be_nil
|
42
49
|
end
|
43
50
|
|
44
51
|
it "should convert the node's parameters into a Facts instance if a host instance is found" do
|
@@ -47,7 +54,7 @@ describe "Puppet::Node::Facts::ActiveRecord", :if => Puppet.features.rails? do
|
|
47
54
|
|
48
55
|
Puppet::Rails::Host.expects(:find_by_name).returns host
|
49
56
|
|
50
|
-
result =
|
57
|
+
result = terminus.find(request)
|
51
58
|
|
52
59
|
result.should be_instance_of(Puppet::Node::Facts)
|
53
60
|
result.name.should == "foo"
|
@@ -60,43 +67,47 @@ describe "Puppet::Node::Facts::ActiveRecord", :if => Puppet.features.rails? do
|
|
60
67
|
|
61
68
|
Puppet::Rails::Host.expects(:find_by_name).returns host
|
62
69
|
|
63
|
-
|
70
|
+
terminus.find(request).values["one"].should == "two"
|
64
71
|
end
|
65
72
|
end
|
66
73
|
|
67
74
|
describe "when saving an instance" do
|
75
|
+
let :facts do
|
76
|
+
Puppet::Node::Facts.new("foo", "one" => "two", "three" => "four")
|
77
|
+
end
|
78
|
+
|
79
|
+
let :request do
|
80
|
+
stub 'request', :key => "foo", :instance => facts
|
81
|
+
end
|
82
|
+
|
83
|
+
let :host do
|
84
|
+
stub 'host', :name => "foo", :save => nil, :merge_facts => nil
|
85
|
+
end
|
86
|
+
|
68
87
|
before do
|
69
|
-
|
70
|
-
Puppet::Rails::Host.stubs(:find_by_name).returns @host
|
71
|
-
@facts = Puppet::Node::Facts.new("foo", "one" => "two", "three" => "four")
|
72
|
-
@request = stub 'request', :key => "foo", :instance => @facts
|
88
|
+
Puppet::Rails::Host.stubs(:find_by_name).returns host
|
73
89
|
end
|
74
90
|
|
75
91
|
it "should find the Rails host with the same name" do
|
76
|
-
Puppet::Rails::Host.expects(:find_by_name).with("foo").returns
|
77
|
-
|
78
|
-
@terminus.save(@request)
|
92
|
+
Puppet::Rails::Host.expects(:find_by_name).with("foo").returns host
|
93
|
+
terminus.save(request)
|
79
94
|
end
|
80
95
|
|
81
96
|
it "should create a new Rails host if none can be found" do
|
82
97
|
Puppet::Rails::Host.expects(:find_by_name).with("foo").returns nil
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
@terminus.save(@request)
|
98
|
+
Puppet::Rails::Host.expects(:create).with(:name => "foo").returns host
|
99
|
+
terminus.save(request)
|
87
100
|
end
|
88
101
|
|
89
102
|
it "should set the facts as facts on the Rails host instance" do
|
90
103
|
# There is other stuff added to the hash.
|
91
|
-
|
92
|
-
|
93
|
-
@terminus.save(@request)
|
104
|
+
host.expects(:merge_facts).with { |args| args["one"] == "two" and args["three"] == "four" }
|
105
|
+
terminus.save(request)
|
94
106
|
end
|
95
107
|
|
96
108
|
it "should save the Rails host instance" do
|
97
|
-
|
98
|
-
|
99
|
-
@terminus.save(@request)
|
109
|
+
host.expects(:save)
|
110
|
+
terminus.save(request)
|
100
111
|
end
|
101
112
|
end
|
102
113
|
end
|
@@ -23,6 +23,11 @@ describe "Puppet::Node::Facts::InventoryActiveRecord", :if => can_use_scratch_da
|
|
23
23
|
setup_scratch_database
|
24
24
|
end
|
25
25
|
|
26
|
+
it "should issue a deprecation warning" do
|
27
|
+
Puppet.expects(:deprecation_warning).with() { |msg| msg =~ /ActiveRecord-based storeconfigs and inventory are deprecated/ }
|
28
|
+
terminus
|
29
|
+
end
|
30
|
+
|
26
31
|
describe "#save" do
|
27
32
|
let(:node) {
|
28
33
|
Puppet::Rails::InventoryNode.new(:name => "foo", :timestamp => Time.now)
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'puppet/indirector/hiera'
|
3
|
+
require 'hiera/backend'
|
3
4
|
|
4
5
|
describe Puppet::Indirector::Hiera do
|
5
6
|
include PuppetSpec::Files
|
@@ -65,7 +66,7 @@ describe Puppet::Indirector::Hiera do
|
|
65
66
|
let(:datadir) { my_fixture_dir }
|
66
67
|
|
67
68
|
it "should be the default data_binding terminus" do
|
68
|
-
Puppet.settings[:data_binding_terminus].should ==
|
69
|
+
Puppet.settings[:data_binding_terminus].should == :hiera
|
69
70
|
end
|
70
71
|
|
71
72
|
it "should raise an error if we don't have the hiera feature" do
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#! /usr/bin/env ruby -S rspec
|
2
|
+
require 'spec_helper'
|
3
|
+
require 'puppet/indirector/key/disabled_ca'
|
4
|
+
|
5
|
+
describe Puppet::SSL::Key::DisabledCa do
|
6
|
+
def request(type, remote)
|
7
|
+
r = Puppet::Indirector::Request.new(:key, type, "foo.com", nil)
|
8
|
+
if remote
|
9
|
+
r.ip = '10.0.0.1'
|
10
|
+
r.node = 'agent.example.com'
|
11
|
+
end
|
12
|
+
r
|
13
|
+
end
|
14
|
+
|
15
|
+
context "when not a CA" do
|
16
|
+
before :each do
|
17
|
+
Puppet[:ca] = false
|
18
|
+
Puppet::SSL::Host.ca_location = :none
|
19
|
+
end
|
20
|
+
|
21
|
+
[:find, :head, :search, :save, :destroy].each do |name|
|
22
|
+
it "should fail remote #{name} requests" do
|
23
|
+
expect { subject.send(name, request(name, true)) }.
|
24
|
+
to raise_error Puppet::Error, /is not a CA/
|
25
|
+
end
|
26
|
+
|
27
|
+
it "should forward local #{name} requests" do
|
28
|
+
Puppet::SSL::Key.indirection.terminus(:file).expects(name)
|
29
|
+
subject.send(name, request(name, false))
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -17,6 +17,13 @@ describe "Puppet::Node::ActiveRecord", :if => Puppet.features.rails? && Puppet.f
|
|
17
17
|
require 'puppet/indirector/node/active_record'
|
18
18
|
end
|
19
19
|
|
20
|
+
it "should issue a deprecation warning" do
|
21
|
+
Puppet.expects(:deprecation_warning).with() { |msg| msg =~ /ActiveRecord-based storeconfigs and inventory are deprecated/ }
|
22
|
+
Puppet[:statedir] = tmpdir('active_record_tmp')
|
23
|
+
Puppet[:railslog] = '$statedir/rails.log'
|
24
|
+
node_indirection
|
25
|
+
end
|
26
|
+
|
20
27
|
it "should be a subclass of the ActiveRecord terminus class" do
|
21
28
|
Puppet::Node::ActiveRecord.ancestors.should be_include(Puppet::Indirector::ActiveRecord)
|
22
29
|
end
|
@@ -510,4 +510,26 @@ describe Puppet::Indirector::Request do
|
|
510
510
|
end
|
511
511
|
end
|
512
512
|
end
|
513
|
+
|
514
|
+
describe "#remote?" do
|
515
|
+
def request(options = {})
|
516
|
+
Puppet::Indirector::Request.new('node', 'find', 'localhost', nil, options)
|
517
|
+
end
|
518
|
+
|
519
|
+
it "should not be unless node or ip is set" do
|
520
|
+
request.should_not be_remote
|
521
|
+
end
|
522
|
+
|
523
|
+
it "should be remote if node is set" do
|
524
|
+
request(:node => 'example.com').should be_remote
|
525
|
+
end
|
526
|
+
|
527
|
+
it "should be remote if ip is set" do
|
528
|
+
request(:ip => '127.0.0.1').should be_remote
|
529
|
+
end
|
530
|
+
|
531
|
+
it "should be remote if node and ip are set" do
|
532
|
+
request(:node => 'example.com', :ip => '127.0.0.1').should be_remote
|
533
|
+
end
|
534
|
+
end
|
513
535
|
end
|
@@ -27,6 +27,11 @@ describe "Puppet::Resource::ActiveRecord", :if => can_use_scratch_database? do
|
|
27
27
|
ActiveRecord::Base.should be_connected
|
28
28
|
end
|
29
29
|
|
30
|
+
it "should issue a deprecation warning" do
|
31
|
+
Puppet.expects(:deprecation_warning).with() { |msg| msg =~ /ActiveRecord-based storeconfigs and inventory are deprecated/ }
|
32
|
+
Puppet::Resource::ActiveRecord.new
|
33
|
+
end
|
34
|
+
|
30
35
|
describe "#search" do
|
31
36
|
before :each do Puppet::Rails.init end
|
32
37
|
|
@@ -20,7 +20,7 @@ describe Puppet::ModuleTool::Applications::Application do
|
|
20
20
|
|
21
21
|
bad_versions.each do |ver|
|
22
22
|
it "should not accept version string #{ver}" do
|
23
|
-
expect { app.parse_filename("puppetlabs-ntp-#{ver}") }.
|
23
|
+
expect { app.parse_filename("puppetlabs-ntp-#{ver}") }.to raise_error
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
@@ -0,0 +1,86 @@
|
|
1
|
+
#! /usr/bin/env ruby -S rspec
|
2
|
+
require 'spec_helper'
|
3
|
+
load 'puppet/network/authentication.rb'
|
4
|
+
|
5
|
+
class AuthenticationTest
|
6
|
+
include Puppet::Network::Authentication
|
7
|
+
end
|
8
|
+
|
9
|
+
describe Puppet::Network::Authentication do
|
10
|
+
subject { AuthenticationTest.new }
|
11
|
+
let(:now) { Time.now }
|
12
|
+
let(:cert) { Puppet::SSL::Certificate.new('cert') }
|
13
|
+
let(:host) { stub 'host', :certificate => cert }
|
14
|
+
|
15
|
+
# this is necessary since the logger is a class variable, and it needs to be stubbed
|
16
|
+
def reload_module
|
17
|
+
load 'puppet/network/authentication.rb'
|
18
|
+
end
|
19
|
+
|
20
|
+
describe "when warning about upcoming expirations" do
|
21
|
+
before do
|
22
|
+
Puppet::SSL::CertificateAuthority.stubs(:ca?).returns(false)
|
23
|
+
FileTest.stubs(:exist?).returns(false)
|
24
|
+
end
|
25
|
+
|
26
|
+
it "should check the expiration of the CA certificate" do
|
27
|
+
ca = stub 'ca', :host => host
|
28
|
+
Puppet::SSL::CertificateAuthority.stubs(:ca?).returns(true)
|
29
|
+
Puppet::SSL::CertificateAuthority.stubs(:instance).returns(ca)
|
30
|
+
cert.expects(:near_expiration?).returns(false)
|
31
|
+
subject.warn_if_near_expiration
|
32
|
+
end
|
33
|
+
|
34
|
+
it "should check the expiration of the localhost certificate" do
|
35
|
+
Puppet::SSL::Host.stubs(:localhost).returns(host)
|
36
|
+
cert.expects(:near_expiration?).returns(false)
|
37
|
+
FileTest.stubs(:exist?).with(Puppet[:hostcert]).returns(true)
|
38
|
+
subject.warn_if_near_expiration
|
39
|
+
end
|
40
|
+
|
41
|
+
it "should check the expiration of any certificates passed in as arguments" do
|
42
|
+
cert.expects(:near_expiration?).twice.returns(false)
|
43
|
+
subject.warn_if_near_expiration(cert, cert)
|
44
|
+
end
|
45
|
+
|
46
|
+
it "should accept instances of OpenSSL::X509::Certificate" do
|
47
|
+
raw_cert = stub 'cert'
|
48
|
+
raw_cert.stubs(:is_a?).with(OpenSSL::X509::Certificate).returns(true)
|
49
|
+
Puppet::SSL::Certificate.stubs(:from_instance).with(raw_cert).returns(cert)
|
50
|
+
cert.expects(:near_expiration?).returns(false)
|
51
|
+
subject.warn_if_near_expiration(raw_cert)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "should use a rate-limited logger for expiration warnings that uses `runinterval` as its interval" do
|
55
|
+
Puppet::Util::Log::RateLimitedLogger.expects(:new).with(Puppet[:runinterval])
|
56
|
+
reload_module
|
57
|
+
end
|
58
|
+
|
59
|
+
context "in the logs" do
|
60
|
+
let(:logger) { stub 'logger' }
|
61
|
+
|
62
|
+
before do
|
63
|
+
Puppet::Util::Log::RateLimitedLogger.stubs(:new).returns(logger)
|
64
|
+
reload_module
|
65
|
+
cert.stubs(:near_expiration?).returns(true)
|
66
|
+
cert.stubs(:expiration).returns(now)
|
67
|
+
cert.stubs(:unmunged_name).returns('foo')
|
68
|
+
end
|
69
|
+
|
70
|
+
it "should log a warning if a certificate's expiration is near" do
|
71
|
+
logger.expects(:warning)
|
72
|
+
subject.warn_if_near_expiration(cert)
|
73
|
+
end
|
74
|
+
|
75
|
+
it "should use the certificate's unmunged name in the message" do
|
76
|
+
logger.expects(:warning).with { |message| message.include? 'foo' }
|
77
|
+
subject.warn_if_near_expiration(cert)
|
78
|
+
end
|
79
|
+
|
80
|
+
it "should show certificate's expiration date in the message using ISO 8601 format" do
|
81
|
+
logger.expects(:warning).with { |message| message.include? now.strftime('%Y-%m-%dT%H:%M:%S%Z') }
|
82
|
+
subject.warn_if_near_expiration(cert)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#! /usr/bin/env ruby -S rspec
|
2
2
|
require 'spec_helper'
|
3
3
|
require 'puppet/network/http/connection'
|
4
|
+
require 'puppet/network/authentication'
|
4
5
|
|
5
6
|
describe Puppet::Network::HTTP::Connection do
|
6
7
|
|
@@ -189,6 +190,7 @@ describe Puppet::Network::HTTP::Connection do
|
|
189
190
|
|
190
191
|
def a_connection_that_verifies(args)
|
191
192
|
connection = Net::HTTP.new(host, port)
|
193
|
+
connection.stubs(:warn_if_near_expiration)
|
192
194
|
connection.stubs(:get).with do
|
193
195
|
connection.verify_callback.call(args[:has_passed_pre_checks], args[:in_context])
|
194
196
|
true
|
@@ -240,5 +242,24 @@ describe Puppet::Network::HTTP::Connection do
|
|
240
242
|
subject.request(:get, stub('request'))
|
241
243
|
end.to raise_error(/some other message/)
|
242
244
|
end
|
245
|
+
|
246
|
+
it "should check all peer certificates for upcoming expiration", :unless => Puppet.features.microsoft_windows? do
|
247
|
+
connection = Net::HTTP.new('my_server', 8140)
|
248
|
+
subject.stubs(:create_connection).returns(connection)
|
249
|
+
|
250
|
+
cert = stubs 'cert'
|
251
|
+
Puppet::SSL::Certificate.expects(:from_instance).twice.returns(cert)
|
252
|
+
|
253
|
+
connection.stubs(:get).with do
|
254
|
+
context = a_store_context(:for_server => 'a_server', :with_error_string => false)
|
255
|
+
connection.verify_callback.call(true, context)
|
256
|
+
connection.verify_callback.call(true, context)
|
257
|
+
true
|
258
|
+
end
|
259
|
+
|
260
|
+
subject.expects(:warn_if_near_expiration).with(cert, cert)
|
261
|
+
|
262
|
+
subject.request(:get, stubs('request'))
|
263
|
+
end
|
243
264
|
end
|
244
265
|
end
|
@@ -2,6 +2,7 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
require 'puppet/network/http/handler'
|
4
4
|
require 'puppet/network/authorization'
|
5
|
+
require 'puppet/network/authentication'
|
5
6
|
|
6
7
|
class HttpHandled
|
7
8
|
include Puppet::Network::HTTP::Handler
|
@@ -51,6 +52,7 @@ describe Puppet::Network::HTTP::Handler do
|
|
51
52
|
@result = stub 'result', :render => "mytext"
|
52
53
|
|
53
54
|
@handler.stubs(:check_authorization)
|
55
|
+
@handler.stubs(:warn_if_near_expiration)
|
54
56
|
|
55
57
|
stub_server_interface
|
56
58
|
end
|
@@ -66,6 +68,16 @@ describe Puppet::Network::HTTP::Handler do
|
|
66
68
|
@handler.stubs(:http_method ).returns("GET")
|
67
69
|
@handler.stubs(:params ).returns({})
|
68
70
|
@handler.stubs(:content_type ).returns("text/plain")
|
71
|
+
@handler.stubs(:client_cert ).returns(nil)
|
72
|
+
end
|
73
|
+
|
74
|
+
it "should check the client certificate for upcoming expiration" do
|
75
|
+
cert = mock 'cert'
|
76
|
+
@handler.stubs(:uri2indirection).returns(["facts", :mymethod, "key", {:node => "name"}])
|
77
|
+
@handler.expects(:client_cert).returns(cert).with(@request)
|
78
|
+
@handler.expects(:warn_if_near_expiration).with(cert)
|
79
|
+
|
80
|
+
@handler.process(@request, @response)
|
69
81
|
end
|
70
82
|
|
71
83
|
it "should create an indirection request from the path, parameters, and http method" do
|
@@ -57,6 +57,13 @@ describe "Puppet::Network::HTTP::RackREST", :if => Puppet.features.rack? do
|
|
57
57
|
@handler.body(req).should == "mybody"
|
58
58
|
end
|
59
59
|
|
60
|
+
it "should return the an OpenSSL::X509::Certificate instance as the client_cert" do
|
61
|
+
cert = stub 'cert'
|
62
|
+
req = mk_req('/foo/bar', 'SSL_CLIENT_CERT' => 'certificate in pem format')
|
63
|
+
OpenSSL::X509::Certificate.expects(:new).with('certificate in pem format').returns(cert)
|
64
|
+
@handler.client_cert(req).should == cert
|
65
|
+
end
|
66
|
+
|
60
67
|
it "should set the response's content-type header when setting the content type" do
|
61
68
|
@header = mock 'header'
|
62
69
|
@response.expects(:header).returns @header
|