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
@@ -160,10 +160,11 @@ describe Puppet::Type.type(:zpool).provider(:zpool) do
|
|
160
160
|
end
|
161
161
|
|
162
162
|
describe "when setting the #{field}" do
|
163
|
-
it "should
|
164
|
-
Puppet.expects(:warning).with("NO CHANGES BEING MADE: zpool #{field} does not match, should be 'shouldvalue' currently is 'currentvalue'")
|
163
|
+
it "should fail if readonly #{field} values change" do
|
165
164
|
provider.stubs(:current_pool).returns(Hash.new("currentvalue"))
|
166
|
-
|
165
|
+
expect {
|
166
|
+
provider.send((field.to_s + "=").intern, "shouldvalue")
|
167
|
+
}.to raise_error(Puppet::Error, /can\'t be changed/)
|
167
168
|
end
|
168
169
|
end
|
169
170
|
end
|
data/spec/unit/puppet_spec.rb
CHANGED
@@ -2,10 +2,17 @@
|
|
2
2
|
require 'spec_helper'
|
3
3
|
require 'puppet'
|
4
4
|
require 'puppet_spec/files'
|
5
|
+
require 'semver'
|
5
6
|
|
6
7
|
describe Puppet do
|
7
8
|
include PuppetSpec::Files
|
8
9
|
|
10
|
+
context "#version" do
|
11
|
+
it "should be valid semver" do
|
12
|
+
SemVer.should be_valid Puppet.version
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
9
16
|
Puppet::Util::Log.eachlevel do |level|
|
10
17
|
it "should have a method for sending '#{level}' logs" do
|
11
18
|
Puppet.should respond_to(level)
|
@@ -0,0 +1,45 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
require 'puppet/settings'
|
5
|
+
require 'puppet/settings/duration_setting'
|
6
|
+
|
7
|
+
describe Puppet::Settings::DurationSetting do
|
8
|
+
subject { described_class.new(:settings => mock('settings'), :desc => "test") }
|
9
|
+
|
10
|
+
describe "when munging the setting" do
|
11
|
+
it "should return the same value if given an integer" do
|
12
|
+
subject.munge(5).should == 5
|
13
|
+
end
|
14
|
+
|
15
|
+
it "should return an integer if given a decimal string" do
|
16
|
+
subject.munge("12").should == 12
|
17
|
+
end
|
18
|
+
|
19
|
+
it "should fail if given anything but a well-formed string or integer" do
|
20
|
+
[ '', 'foo', '2 d', '2d ', true, Time.now, 8.3, [] ].each do |value|
|
21
|
+
expect { subject.munge(value) }.to raise_error(Puppet::Settings::ValidationError)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should parse strings with units of 'y', 'd', 'h', 'm', or 's'" do
|
26
|
+
# Note: the year value won't jive with most methods of calculating
|
27
|
+
# year due to the Julian calandar having 365.25 days in a year
|
28
|
+
{
|
29
|
+
'3y' => 94608000,
|
30
|
+
'3d' => 259200,
|
31
|
+
'3h' => 10800,
|
32
|
+
'3m' => 180,
|
33
|
+
'3s' => 3
|
34
|
+
}.each do |value, converted_value|
|
35
|
+
# subject.munge(value).should == converted_value
|
36
|
+
subject.munge(value).should == converted_value
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
# This is to support the `filetimeout` setting
|
41
|
+
it "should allow negative values" do
|
42
|
+
subject.munge(-1).should == -1
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#! /usr/bin/env ruby -S rspec
|
2
|
+
require 'spec_helper'
|
3
|
+
|
4
|
+
describe Puppet::Settings::TerminusSetting do
|
5
|
+
let(:setting) { described_class.new(:settings => mock('settings'), :desc => "test") }
|
6
|
+
|
7
|
+
describe "#munge" do
|
8
|
+
it "converts strings to symbols" do
|
9
|
+
setting.munge("string").should == :string
|
10
|
+
end
|
11
|
+
|
12
|
+
it "converts '' to nil" do
|
13
|
+
setting.munge('').should be_nil
|
14
|
+
end
|
15
|
+
|
16
|
+
it "preserves symbols" do
|
17
|
+
setting.munge(:symbol).should == :symbol
|
18
|
+
end
|
19
|
+
|
20
|
+
it "preserves nil" do
|
21
|
+
setting.munge(nil).should be_nil
|
22
|
+
end
|
23
|
+
|
24
|
+
it "does not allow unknown types through" do
|
25
|
+
expect { setting.munge(["not a terminus type"]) }.to raise_error Puppet::Settings::ValidationError
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
data/spec/unit/settings_spec.rb
CHANGED
@@ -72,35 +72,41 @@ describe Puppet::Settings do
|
|
72
72
|
|
73
73
|
|
74
74
|
describe "when initializing application defaults do" do
|
75
|
+
let(:default_values) do
|
76
|
+
values = {}
|
77
|
+
PuppetSpec::Settings::TEST_APP_DEFAULT_DEFINITIONS.keys.each do |key|
|
78
|
+
values[key] = 'default value'
|
79
|
+
end
|
80
|
+
values
|
81
|
+
end
|
82
|
+
|
75
83
|
before do
|
76
84
|
@settings = Puppet::Settings.new
|
85
|
+
@settings.define_settings(:main, PuppetSpec::Settings::TEST_APP_DEFAULT_DEFINITIONS)
|
77
86
|
end
|
78
87
|
|
79
88
|
it "should fail if someone attempts to initialize app defaults more than once" do
|
80
|
-
@settings.
|
89
|
+
@settings.initialize_app_defaults(default_values)
|
90
|
+
|
81
91
|
expect {
|
82
|
-
@settings.initialize_app_defaults(
|
92
|
+
@settings.initialize_app_defaults(default_values)
|
83
93
|
}.to raise_error(Puppet::DevError)
|
84
94
|
end
|
85
95
|
|
86
96
|
it "should fail if the app defaults hash is missing any required values" do
|
97
|
+
incomplete_default_values = default_values.reject { |key, _| key == :confdir }
|
87
98
|
expect {
|
88
|
-
@settings.initialize_app_defaults({})
|
99
|
+
@settings.initialize_app_defaults(default_values.reject { |key, _| key == :confdir })
|
89
100
|
}.to raise_error(Puppet::Settings::SettingsError)
|
90
101
|
end
|
91
102
|
|
92
103
|
# ultimately I'd like to stop treating "run_mode" as a normal setting, because it has so many special
|
93
104
|
# case behaviors / uses. However, until that time... we need to make sure that our private run_mode=
|
94
105
|
# setter method gets properly called during app initialization.
|
95
|
-
it "
|
96
|
-
|
97
|
-
Puppet::Settings::REQUIRED_APP_SETTINGS.each do |key|
|
98
|
-
app_defaults[key] = "foo"
|
99
|
-
end
|
106
|
+
it "sets the preferred run mode when initializing the app defaults" do
|
107
|
+
@settings.initialize_app_defaults(default_values.merge(:run_mode => :master))
|
100
108
|
|
101
|
-
@settings.
|
102
|
-
@settings.expects(:run_mode=).with("foo")
|
103
|
-
@settings.initialize_app_defaults(app_defaults)
|
109
|
+
@settings.preferred_run_mode.should == :master
|
104
110
|
end
|
105
111
|
end
|
106
112
|
|
@@ -469,15 +475,6 @@ describe Puppet::Settings do
|
|
469
475
|
@settings[:why_so_serious] = "foo"
|
470
476
|
}.should raise_error(ArgumentError, /unknown configuration parameter/)
|
471
477
|
end
|
472
|
-
|
473
|
-
it "should raise an error if we try to set a setting that is read-only (which, really, all of our settings probably should be)" do
|
474
|
-
@settings.define_settings(:section, :one => { :default => "test", :desc => "a" })
|
475
|
-
@settings.expects(:read_only_settings).returns([:one])
|
476
|
-
|
477
|
-
lambda{
|
478
|
-
@settings[:one] = "foo"
|
479
|
-
}.should raise_error(ArgumentError, /read-only/)
|
480
|
-
end
|
481
478
|
end
|
482
479
|
|
483
480
|
describe "when returning values" do
|
@@ -556,8 +553,9 @@ describe Puppet::Settings do
|
|
556
553
|
end
|
557
554
|
|
558
555
|
it "should have a run_mode that defaults to user" do
|
559
|
-
@settings.
|
556
|
+
@settings.preferred_run_mode.should == :user
|
560
557
|
end
|
558
|
+
|
561
559
|
describe "setbycli" do
|
562
560
|
it "should generate a deprecation warning" do
|
563
561
|
@settings.handlearg("--one", "blah")
|
@@ -579,7 +577,7 @@ describe Puppet::Settings do
|
|
579
577
|
:one => { :default => "ONE", :desc => "a" },
|
580
578
|
:two => { :default => "TWO", :desc => "b" }
|
581
579
|
FileTest.stubs(:exist?).returns true
|
582
|
-
@settings.
|
580
|
+
@settings.preferred_run_mode = :agent
|
583
581
|
end
|
584
582
|
|
585
583
|
it "should return default values if no values have been set" do
|
@@ -602,7 +600,7 @@ describe Puppet::Settings do
|
|
602
600
|
end
|
603
601
|
|
604
602
|
it "should return values set in the mode-specific section before values set in the main section" do
|
605
|
-
text = "[main]\none = mainval\n[
|
603
|
+
text = "[main]\none = mainval\n[agent]\none = modeval\n"
|
606
604
|
@settings.stubs(:read_file).returns(text)
|
607
605
|
@settings.send(:parse_config_files)
|
608
606
|
|
data/spec/unit/ssl/base_spec.rb
CHANGED
@@ -3,40 +3,89 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
require 'puppet/ssl/certificate'
|
5
5
|
|
6
|
-
class TestCertificate < Puppet::SSL::Base
|
6
|
+
class TestCertificate < Puppet::SSL::Base
|
7
|
+
wraps(Puppet::SSL::Certificate)
|
8
|
+
end
|
7
9
|
|
8
10
|
describe Puppet::SSL::Certificate do
|
9
11
|
before :each do
|
10
12
|
@base = TestCertificate.new("name")
|
13
|
+
@class = TestCertificate
|
11
14
|
end
|
12
15
|
|
13
|
-
describe "when
|
14
|
-
|
15
|
-
|
16
|
-
@
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
describe "when creating new instances" do
|
17
|
+
it "should fail if given an object that is not an instance of the wrapped class" do
|
18
|
+
obj = stub 'obj', :is_a? => false
|
19
|
+
lambda { @class.from_instance(obj) }.should raise_error(ArgumentError)
|
20
|
+
end
|
21
|
+
|
22
|
+
it "should fail if a name is not supplied and can't be determined from the object" do
|
23
|
+
obj = stub 'obj', :is_a? => true
|
24
|
+
lambda { @class.from_instance(obj) }.should raise_error(ArgumentError)
|
20
25
|
end
|
21
26
|
|
22
|
-
it "should
|
23
|
-
|
24
|
-
@digest.expects(:hexdigest).with("DER").returns "digest"
|
27
|
+
it "should determine the name from the object if it has a subject" do
|
28
|
+
obj = stub 'obj', :is_a? => true, :subject => '/CN=foo'
|
25
29
|
|
26
|
-
|
30
|
+
inst = stub 'base'
|
31
|
+
inst.expects(:content=).with(obj)
|
32
|
+
|
33
|
+
@class.expects(:new).with('foo').returns inst
|
34
|
+
@class.expects(:name_from_subject).with('/CN=foo').returns('foo')
|
35
|
+
|
36
|
+
@class.from_instance(obj).should == inst
|
27
37
|
end
|
38
|
+
end
|
28
39
|
|
29
|
-
|
30
|
-
|
40
|
+
describe "when determining a name from a certificate subject" do
|
41
|
+
it "should convert it to a string" do
|
42
|
+
subject = stub 'sub'
|
43
|
+
subject.expects(:to_s).returns('foo')
|
31
44
|
|
32
|
-
|
45
|
+
@class.name_from_subject(subject).should == 'foo'
|
33
46
|
end
|
34
47
|
|
35
|
-
it "should
|
36
|
-
|
37
|
-
@
|
48
|
+
it "should strip the prefix" do
|
49
|
+
subject = '/CN=foo'
|
50
|
+
@class.name_from_subject(subject).should == 'foo'
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe "#digest_algorithm" do
|
55
|
+
let(:content) { stub 'content' }
|
56
|
+
let(:base) {
|
57
|
+
b = Puppet::SSL::Base.new('base')
|
58
|
+
b.content = content
|
59
|
+
b
|
60
|
+
}
|
61
|
+
|
62
|
+
# Some known signature algorithms taken from RFC 3279, 5758, and browsing
|
63
|
+
# objs_dat.h in openssl
|
64
|
+
{
|
65
|
+
'md5WithRSAEncryption' => 'md5',
|
66
|
+
'sha1WithRSAEncryption' => 'sha1',
|
67
|
+
'md4WithRSAEncryption' => 'md4',
|
68
|
+
'sha256WithRSAEncryption' => 'sha256',
|
69
|
+
'ripemd160WithRSA' => 'ripemd160',
|
70
|
+
'ecdsa-with-SHA1' => 'sha1',
|
71
|
+
'ecdsa-with-SHA224' => 'sha224',
|
72
|
+
'ecdsa-with-SHA256' => 'sha256',
|
73
|
+
'ecdsa-with-SHA384' => 'sha384',
|
74
|
+
'ecdsa-with-SHA512' => 'sha512',
|
75
|
+
'dsa_with_SHA224' => 'sha224',
|
76
|
+
'dsaWithSHA1' => 'sha1',
|
77
|
+
}.each do |signature, digest|
|
78
|
+
it "returns '#{digest}' for signature algorithm '#{signature}'" do
|
79
|
+
content.stubs(:signature_algorithm).returns(signature)
|
80
|
+
base.digest_algorithm.should == digest
|
81
|
+
end
|
82
|
+
end
|
38
83
|
|
39
|
-
|
84
|
+
it "raises an error on an unknown signature algorithm" do
|
85
|
+
content.stubs(:signature_algorithm).returns("nonsense")
|
86
|
+
expect {
|
87
|
+
base.digest_algorithm
|
88
|
+
}.to raise_error(Puppet::Error, "Unknown signature algorithm 'nonsense'")
|
40
89
|
end
|
41
90
|
end
|
42
91
|
end
|
@@ -44,11 +44,6 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
44
44
|
interface = @class.new(:generate, :to => :all, :digest => :digest)
|
45
45
|
interface.digest.should == :digest
|
46
46
|
end
|
47
|
-
|
48
|
-
it "should set the digest to SHA256 if none given" do
|
49
|
-
interface = @class.new(:generate, :to => :all)
|
50
|
-
interface.digest.should == :SHA256
|
51
|
-
end
|
52
47
|
end
|
53
48
|
|
54
49
|
describe "when setting the method" do
|
@@ -87,24 +82,6 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
87
82
|
@ca = Object.new
|
88
83
|
end
|
89
84
|
|
90
|
-
it "should raise InterfaceErrors" do
|
91
|
-
@applier = @class.new(:revoke, :to => :all)
|
92
|
-
|
93
|
-
@ca.expects(:list).raises Puppet::SSL::CertificateAuthority::Interface::InterfaceError
|
94
|
-
|
95
|
-
lambda { @applier.apply(@ca) }.should raise_error(Puppet::SSL::CertificateAuthority::Interface::InterfaceError)
|
96
|
-
end
|
97
|
-
|
98
|
-
it "should log non-Interface failures" do
|
99
|
-
@applier = @class.new(:revoke, :to => :all)
|
100
|
-
|
101
|
-
@ca.expects(:list).raises ArgumentError
|
102
|
-
|
103
|
-
Puppet.expects(:err)
|
104
|
-
|
105
|
-
lambda { @applier.apply(@ca) }.should raise_error
|
106
|
-
end
|
107
|
-
|
108
85
|
describe "with an empty array specified and the method is not list" do
|
109
86
|
it "should fail" do
|
110
87
|
@applier = @class.new(:sign, :to => [])
|
@@ -205,9 +182,12 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
205
182
|
Puppet::SSL::Certificate.indirection.stubs(:find).returns @cert
|
206
183
|
Puppet::SSL::CertificateRequest.indirection.stubs(:find).returns @csr
|
207
184
|
|
185
|
+
@digest = mock("digest")
|
186
|
+
@digest.stubs(:to_s).returns("(fingerprint)")
|
208
187
|
@ca.expects(:waiting?).returns %w{host1 host2 host3}
|
209
188
|
@ca.expects(:list).returns %w{host4 host5 host6}
|
210
|
-
@
|
189
|
+
@csr.stubs(:digest).returns @digest
|
190
|
+
@cert.stubs(:digest).returns @digest
|
211
191
|
@ca.stubs(:verify)
|
212
192
|
end
|
213
193
|
|
@@ -331,10 +311,19 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
331
311
|
end
|
332
312
|
|
333
313
|
describe ":fingerprint" do
|
314
|
+
before(:each) do
|
315
|
+
@cert = Puppet::SSL::Certificate.new 'foo'
|
316
|
+
@csr = Puppet::SSL::CertificateRequest.new 'bar'
|
317
|
+
Puppet::SSL::Certificate.indirection.stubs(:find)
|
318
|
+
Puppet::SSL::CertificateRequest.indirection.stubs(:find)
|
319
|
+
Puppet::SSL::Certificate.indirection.stubs(:find).with('host1').returns(@cert)
|
320
|
+
Puppet::SSL::CertificateRequest.indirection.stubs(:find).with('host2').returns(@csr)
|
321
|
+
end
|
322
|
+
|
334
323
|
it "should fingerprint with the set digest algorithm" do
|
335
|
-
@applier = @class.new(:fingerprint, :to => %w{host1}, :digest => :
|
324
|
+
@applier = @class.new(:fingerprint, :to => %w{host1}, :digest => :shaonemillion)
|
325
|
+
@cert.expects(:digest).with(:shaonemillion).returns("fingerprint1")
|
336
326
|
|
337
|
-
@ca.expects(:fingerprint).with("host1", :digest).returns "fingerprint1"
|
338
327
|
@applier.expects(:puts).with "host1 fingerprint1"
|
339
328
|
|
340
329
|
@applier.apply(@ca)
|
@@ -347,10 +336,10 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
347
336
|
|
348
337
|
@applier = @class.new(:fingerprint, :to => :all)
|
349
338
|
|
350
|
-
@
|
339
|
+
@cert.expects(:digest).returns("fingerprint1")
|
351
340
|
@applier.expects(:puts).with "host1 fingerprint1"
|
352
341
|
|
353
|
-
@
|
342
|
+
@csr.expects(:digest).returns("fingerprint2")
|
354
343
|
@applier.expects(:puts).with "host2 fingerprint2"
|
355
344
|
|
356
345
|
@applier.apply(@ca)
|
@@ -361,10 +350,10 @@ describe Puppet::SSL::CertificateAuthority::Interface do
|
|
361
350
|
it "should print each named certificate if found" do
|
362
351
|
@applier = @class.new(:fingerprint, :to => %w{host1 host2})
|
363
352
|
|
364
|
-
@
|
353
|
+
@cert.expects(:digest).returns("fingerprint1")
|
365
354
|
@applier.expects(:puts).with "host1 fingerprint1"
|
366
355
|
|
367
|
-
@
|
356
|
+
@csr.expects(:digest).returns("fingerprint2")
|
368
357
|
@applier.expects(:puts).with "host2 fingerprint2"
|
369
358
|
|
370
359
|
@applier.apply(@ca)
|
@@ -243,8 +243,9 @@ describe Puppet::SSL::CertificateAuthority do
|
|
243
243
|
# Stub out the factory
|
244
244
|
Puppet::SSL::CertificateFactory.stubs(:build).returns "my real cert"
|
245
245
|
|
246
|
-
@request_content = stub "request content stub", :subject => OpenSSL::X509::Name.new([['CN', @name]])
|
246
|
+
@request_content = stub "request content stub", :subject => OpenSSL::X509::Name.new([['CN', @name]]), :public_key => stub('public_key')
|
247
247
|
@request = stub 'request', :name => @name, :request_extensions => [], :subject_alt_names => [], :content => @request_content
|
248
|
+
@request_content.stubs(:verify).returns(true)
|
248
249
|
|
249
250
|
# And the inventory
|
250
251
|
@inventory = stub 'inventory', :add => nil
|
@@ -331,7 +332,7 @@ describe Puppet::SSL::CertificateAuthority do
|
|
331
332
|
|
332
333
|
expect do
|
333
334
|
@ca.sign(@name, false, @request)
|
334
|
-
end.
|
335
|
+
end.not_to raise_error(Puppet::SSL::CertificateAuthority::CertificateSigningError)
|
335
336
|
end
|
336
337
|
|
337
338
|
it "should save the resulting certificate" do
|
@@ -55,16 +55,25 @@ describe Puppet::SSL::CertificateFactory do
|
|
55
55
|
cert.not_before.should be_within(30).of(Time.now - 24*60*60)
|
56
56
|
end
|
57
57
|
|
58
|
-
it "should set the default TTL of the certificate" do
|
59
|
-
|
58
|
+
it "should set the default TTL of the certificate to the `ca_ttl` setting" do
|
59
|
+
Puppet[:ca_ttl] = 12
|
60
|
+
now = Time.now.utc
|
61
|
+
Time.expects(:now).at_least_once.returns(now)
|
60
62
|
cert = subject.build(:server, csr, issuer, serial)
|
61
|
-
cert.not_after.should
|
63
|
+
cert.not_after.to_i.should == now.to_i + 12
|
64
|
+
end
|
65
|
+
|
66
|
+
it "should not allow a non-integer TTL" do
|
67
|
+
[ 'foo', 1.2, Time.now, true ].each do |ttl|
|
68
|
+
expect { subject.build(:server, csr, issuer, serial, ttl) }.to raise_error(ArgumentError)
|
69
|
+
end
|
62
70
|
end
|
63
71
|
|
64
72
|
it "should respect a custom TTL for the CA" do
|
65
|
-
|
66
|
-
|
67
|
-
cert
|
73
|
+
now = Time.now.utc
|
74
|
+
Time.expects(:now).at_least_once.returns(now)
|
75
|
+
cert = subject.build(:server, csr, issuer, serial, 12)
|
76
|
+
cert.not_after.to_i.should == now.to_i + 12
|
68
77
|
end
|
69
78
|
|
70
79
|
it "should build extensions for the certificate" do
|