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
@@ -3,68 +3,6 @@ require 'puppet/external/pson/pure/parser'
|
|
3
3
|
require 'puppet/external/pson/pure/generator'
|
4
4
|
|
5
5
|
module PSON
|
6
|
-
begin
|
7
|
-
require 'iconv'
|
8
|
-
# An iconv instance to convert from UTF8 to UTF16 Big Endian.
|
9
|
-
UTF16toUTF8 = Iconv.new('utf-8', 'utf-16be') # :nodoc:
|
10
|
-
# An iconv instance to convert from UTF16 Big Endian to UTF8.
|
11
|
-
UTF8toUTF16 = Iconv.new('utf-16be', 'utf-8') # :nodoc:
|
12
|
-
UTF8toUTF16.iconv('no bom')
|
13
|
-
rescue LoadError
|
14
|
-
# We actually don't care
|
15
|
-
Puppet.warning "iconv couldn't be loaded, which is required for UTF-8/UTF-16 conversions"
|
16
|
-
rescue Errno::EINVAL, Iconv::InvalidEncoding
|
17
|
-
# Iconv doesn't support big endian utf-16. Let's try to hack this manually
|
18
|
-
# into the converters.
|
19
|
-
begin
|
20
|
-
old_verbose, $VERBSOSE = $VERBOSE, nil
|
21
|
-
# An iconv instance to convert from UTF8 to UTF16 Big Endian.
|
22
|
-
UTF16toUTF8 = Iconv.new('utf-8', 'utf-16') # :nodoc:
|
23
|
-
# An iconv instance to convert from UTF16 Big Endian to UTF8.
|
24
|
-
UTF8toUTF16 = Iconv.new('utf-16', 'utf-8') # :nodoc:
|
25
|
-
UTF8toUTF16.iconv('no bom')
|
26
|
-
if UTF8toUTF16.iconv("\xe2\x82\xac") == "\xac\x20"
|
27
|
-
swapper = Class.new do
|
28
|
-
def initialize(iconv) # :nodoc:
|
29
|
-
@iconv = iconv
|
30
|
-
end
|
31
|
-
|
32
|
-
def iconv(string) # :nodoc:
|
33
|
-
result = @iconv.iconv(string)
|
34
|
-
PSON.swap!(result)
|
35
|
-
end
|
36
|
-
end
|
37
|
-
UTF8toUTF16 = swapper.new(UTF8toUTF16) # :nodoc:
|
38
|
-
end
|
39
|
-
if UTF16toUTF8.iconv("\xac\x20") == "\xe2\x82\xac"
|
40
|
-
swapper = Class.new do
|
41
|
-
def initialize(iconv) # :nodoc:
|
42
|
-
@iconv = iconv
|
43
|
-
end
|
44
|
-
|
45
|
-
def iconv(string) # :nodoc:
|
46
|
-
string = PSON.swap!(string.dup)
|
47
|
-
@iconv.iconv(string)
|
48
|
-
end
|
49
|
-
end
|
50
|
-
UTF16toUTF8 = swapper.new(UTF16toUTF8) # :nodoc:
|
51
|
-
end
|
52
|
-
rescue Errno::EINVAL, Iconv::InvalidEncoding
|
53
|
-
Puppet.warning "iconv doesn't seem to support UTF-8/UTF-16 conversions"
|
54
|
-
ensure
|
55
|
-
$VERBOSE = old_verbose
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
# Swap consecutive bytes of _string_ in place.
|
60
|
-
def self.swap!(string) # :nodoc:
|
61
|
-
0.upto(string.size / 2) do |i|
|
62
|
-
break unless string[2 * i + 1]
|
63
|
-
string[2 * i], string[2 * i + 1] = string[2 * i + 1], string[2 * i]
|
64
|
-
end
|
65
|
-
string
|
66
|
-
end
|
67
|
-
|
68
6
|
# This module holds all the modules/classes that implement PSON's
|
69
7
|
# functionality in pure ruby.
|
70
8
|
module Pure
|
@@ -141,7 +141,7 @@ module PSON
|
|
141
141
|
bytes << c[6 * i + 2, 2].to_i(16) << c[6 * i + 4, 2].to_i(16)
|
142
142
|
i += 1
|
143
143
|
end
|
144
|
-
PSON
|
144
|
+
PSON.encode('utf-8', 'utf-16be', bytes)
|
145
145
|
end
|
146
146
|
end
|
147
147
|
string.force_encoding(Encoding::UTF_8) if string.respond_to?(:force_encoding)
|
@@ -149,7 +149,7 @@ module PSON
|
|
149
149
|
else
|
150
150
|
UNPARSED
|
151
151
|
end
|
152
|
-
rescue
|
152
|
+
rescue => e
|
153
153
|
raise GeneratorError, "Caught #{e.class}: #{e}"
|
154
154
|
end
|
155
155
|
|
data/lib/puppet/face/ca.rb
CHANGED
@@ -34,6 +34,10 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
34
34
|
summary "Include signed certificates."
|
35
35
|
end
|
36
36
|
|
37
|
+
option "--digest ALGORITHM" do
|
38
|
+
summary "The hash algorithm to use when displaying the fingerprint"
|
39
|
+
end
|
40
|
+
|
37
41
|
option "--subject PATTERN" do
|
38
42
|
summary "Only list if the subject matches PATTERN."
|
39
43
|
|
@@ -50,6 +54,7 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
50
54
|
unless ca = Puppet::SSL::CertificateAuthority.instance
|
51
55
|
raise "Unable to fetch the CA"
|
52
56
|
end
|
57
|
+
Puppet::SSL::Host.ca_location = :only
|
53
58
|
|
54
59
|
pattern = options[:subject].nil? ? nil :
|
55
60
|
Regexp.new(options[:subject], Regexp::IGNORECASE)
|
@@ -70,7 +75,7 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
70
75
|
hosts.sort.map {|host| Puppet::SSL::Host.new(host) }
|
71
76
|
end
|
72
77
|
|
73
|
-
when_rendering :console do |hosts|
|
78
|
+
when_rendering :console do |hosts, options|
|
74
79
|
unless ca = Puppet::SSL::CertificateAuthority.instance
|
75
80
|
raise "Unable to fetch the CA"
|
76
81
|
end
|
@@ -80,13 +85,13 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
80
85
|
hosts.map do |host|
|
81
86
|
name = host.name.ljust(length)
|
82
87
|
if host.certificate_request then
|
83
|
-
" #{name}
|
88
|
+
" #{name} #{host.certificate_request.digest(options[:digest])}"
|
84
89
|
else
|
85
90
|
begin
|
86
91
|
ca.verify(host.name)
|
87
|
-
"+ #{name}
|
92
|
+
"+ #{name} #{host.certificate.digest(options[:digest])}"
|
88
93
|
rescue Puppet::SSL::CertificateAuthority::CertificateVerificationError => e
|
89
|
-
"- #{name}
|
94
|
+
"- #{name} #{host.certificate.digest(options[:digest])} (#{e.to_s})"
|
90
95
|
end
|
91
96
|
end
|
92
97
|
end.join("\n")
|
@@ -99,6 +104,7 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
99
104
|
unless ca = Puppet::SSL::CertificateAuthority.instance
|
100
105
|
raise "Unable to fetch the CA"
|
101
106
|
end
|
107
|
+
Puppet::SSL::Host.ca_location = :local
|
102
108
|
|
103
109
|
ca.destroy host
|
104
110
|
end
|
@@ -110,6 +116,7 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
110
116
|
unless ca = Puppet::SSL::CertificateAuthority.instance
|
111
117
|
raise "Unable to fetch the CA"
|
112
118
|
end
|
119
|
+
Puppet::SSL::Host.ca_location = :only
|
113
120
|
|
114
121
|
begin
|
115
122
|
ca.revoke host
|
@@ -134,6 +141,7 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
134
141
|
unless ca = Puppet::SSL::CertificateAuthority.instance
|
135
142
|
raise "Unable to fetch the CA"
|
136
143
|
end
|
144
|
+
Puppet::SSL::Host.ca_location = :local
|
137
145
|
|
138
146
|
begin
|
139
147
|
ca.generate(host, :dns_alt_names => options[:dns_alt_names])
|
@@ -163,6 +171,7 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
163
171
|
unless ca = Puppet::SSL::CertificateAuthority.instance
|
164
172
|
raise "Unable to fetch the CA"
|
165
173
|
end
|
174
|
+
Puppet::SSL::Host.ca_location = :only
|
166
175
|
|
167
176
|
begin
|
168
177
|
ca.sign(host, options[:allow_dns_alt_names])
|
@@ -182,6 +191,7 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
182
191
|
unless ca = Puppet::SSL::CertificateAuthority.instance
|
183
192
|
raise "Unable to fetch the CA"
|
184
193
|
end
|
194
|
+
Puppet::SSL::Host.ca_location = :only
|
185
195
|
|
186
196
|
ca.print host
|
187
197
|
end
|
@@ -197,17 +207,11 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
197
207
|
unless ca = Puppet::SSL::CertificateAuthority.instance
|
198
208
|
raise "Unable to fetch the CA"
|
199
209
|
end
|
210
|
+
Puppet::SSL::Host.ca_location = :only
|
200
211
|
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
if options.has_key? :digest
|
205
|
-
ca.fingerprint host, options[:digest]
|
206
|
-
else
|
207
|
-
ca.fingerprint host
|
208
|
-
end
|
209
|
-
rescue ArgumentError => e
|
210
|
-
raise unless e.to_s =~ /Could not find a certificate or csr for/
|
212
|
+
if cert = (Puppet::SSL::Certificate.indirection.find(host) || Puppet::SSL::CertificateRequest.indirection.find(host))
|
213
|
+
cert.digest(options[:digest]).to_s
|
214
|
+
else
|
211
215
|
nil
|
212
216
|
end
|
213
217
|
end
|
@@ -219,6 +223,7 @@ Puppet::Face.define(:ca, '0.1.0') do
|
|
219
223
|
unless ca = Puppet::SSL::CertificateAuthority.instance
|
220
224
|
raise "Unable to fetch the CA"
|
221
225
|
end
|
226
|
+
Puppet::SSL::Host.ca_location = :only
|
222
227
|
|
223
228
|
begin
|
224
229
|
ca.verify host
|
data/lib/puppet/face/config.rb
CHANGED
@@ -22,7 +22,7 @@ Puppet::Face.define(:config, '0.0.1') do
|
|
22
22
|
EOT
|
23
23
|
notes <<-'EOT'
|
24
24
|
By default, this action reads the configuration in agent mode.
|
25
|
-
Use the '--
|
25
|
+
Use the '--run_mode' and '--environment' flags to examine other
|
26
26
|
configuration domains.
|
27
27
|
EOT
|
28
28
|
examples <<-'EOT'
|
@@ -32,7 +32,7 @@ Puppet::Face.define(:config, '0.0.1') do
|
|
32
32
|
|
33
33
|
Get a list of important directories from the master's config:
|
34
34
|
|
35
|
-
$ puppet config print all --
|
35
|
+
$ puppet config print all --run_mode master | grep -E "(path|dir)"
|
36
36
|
EOT
|
37
37
|
|
38
38
|
when_invoked do |*args|
|
data/lib/puppet/face/facts.rb
CHANGED
@@ -42,7 +42,7 @@ Puppet::Indirector::Face.define(:facts, '0.0.1') do
|
|
42
42
|
|
43
43
|
Query a DB-backed inventory directly (bypassing the REST API):
|
44
44
|
|
45
|
-
$ puppet facts find somenode.puppetlabs.lan --terminus inventory_active_record --
|
45
|
+
$ puppet facts find somenode.puppetlabs.lan --terminus inventory_active_record --run_mode master
|
46
46
|
EOT
|
47
47
|
|
48
48
|
get_action(:destroy).summary "Invalid for this subcommand."
|
@@ -10,7 +10,6 @@ RETURNS: <%= action.returns.strip %>
|
|
10
10
|
<% end -%>
|
11
11
|
OPTIONS:
|
12
12
|
<%# Remove these options once we can introspect them normally. -%>
|
13
|
-
--mode MODE - The run mode to use (user, agent, or master).
|
14
13
|
--render-as FORMAT - The rendering format to use.
|
15
14
|
--verbose - Whether to log verbosely.
|
16
15
|
--debug - Whether to log debug information.
|
@@ -6,7 +6,6 @@ USAGE: <%= face.synopsis %>
|
|
6
6
|
|
7
7
|
OPTIONS:
|
8
8
|
<%# Remove these options once we can introspect them normally. -%>
|
9
|
-
--mode MODE - The run mode to use (user, agent, or master).
|
10
9
|
--render-as FORMAT - The rendering format to use.
|
11
10
|
--verbose - Whether to log verbosely.
|
12
11
|
--debug - Whether to log debug information.
|
@@ -17,9 +17,9 @@ OPTIONS
|
|
17
17
|
-------
|
18
18
|
Note that any configuration parameter that's valid in the configuration
|
19
19
|
file is also a valid long argument, although it may or may not be
|
20
|
-
relevant to the present action. For example, `server`
|
21
|
-
configuration
|
22
|
-
an argument.
|
20
|
+
relevant to the present action. For example, `server` and `run_mode` are valid
|
21
|
+
configuration parameters, so you can specify `--server <servername>`, or
|
22
|
+
`--run_mode <runmode>` as an argument.
|
23
23
|
|
24
24
|
See the configuration file documentation at
|
25
25
|
<http://docs.puppetlabs.com/references/stable/configuration.html> for the
|
@@ -27,9 +27,6 @@ full list of acceptable parameters. A commented list of all
|
|
27
27
|
configuration options can also be generated by running puppet with
|
28
28
|
`--genconfig`.
|
29
29
|
|
30
|
-
* --mode MODE:
|
31
|
-
The run mode to use for the current action. Valid modes are `user`, `agent`,
|
32
|
-
and `master`.
|
33
30
|
* --render-as FORMAT:
|
34
31
|
The format in which to render output. The most common formats are `json`,
|
35
32
|
`s` (string), `yaml`, and `console`, but other options such as `dot` are
|
data/lib/puppet/face/node.rb
CHANGED
@@ -34,7 +34,7 @@ Puppet::Indirector::Face.define(:node, '0.0.1') do
|
|
34
34
|
|
35
35
|
Retrieve a node using the puppet master's configured ENC:
|
36
36
|
|
37
|
-
$ puppet node find somenode.puppetlabs.lan --terminus exec --
|
37
|
+
$ puppet node find somenode.puppetlabs.lan --terminus exec --run_mode master --render-as yaml
|
38
38
|
|
39
39
|
Retrieve the same node from the puppet master:
|
40
40
|
|
@@ -1,27 +1,32 @@
|
|
1
1
|
Puppet::Face.define(:node, '0.0.1') do
|
2
2
|
action(:clean) do
|
3
3
|
option "--[no-]unexport" do
|
4
|
-
summary "
|
4
|
+
summary "Whether to remove this node's exported resources from other nodes"
|
5
5
|
end
|
6
6
|
|
7
|
-
summary "Clean up everything a puppetmaster knows about a node"
|
7
|
+
summary "Clean up everything a puppetmaster knows about a node."
|
8
8
|
arguments "<host1> [<host2> ...]"
|
9
|
-
description <<-EOT
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
9
|
+
description <<-'EOT'
|
10
|
+
Clean up everything a puppet master knows about a node, including certificates
|
11
|
+
and storeconfigs data.
|
12
|
+
|
13
|
+
The full list of info cleaned by this action is:
|
14
|
+
|
15
|
+
<Signed certificates> - ($vardir/ssl/ca/signed/node.domain.pem)
|
16
|
+
|
17
|
+
<Cached facts> - ($vardir/yaml/facts/node.domain.yaml)
|
18
|
+
|
19
|
+
<Cached node objects> - ($vardir/yaml/node/node.domain.yaml)
|
20
|
+
|
21
|
+
<Reports> - ($vardir/reports/node.domain)
|
22
|
+
|
23
|
+
<Stored configs> - (in database) The clean action can either remove all
|
24
|
+
data from a host in your storeconfigs database, or, with the
|
25
|
+
<--unexport> option, turn every exported resource supporting ensure to
|
26
|
+
absent so that any other host that collected those resources can remove
|
27
|
+
them. Without unexporting, a removed node's exported resources become
|
28
|
+
unmanaged by Puppet, and may linger as cruft unless you are purging
|
29
|
+
that resource type.
|
25
30
|
EOT
|
26
31
|
|
27
32
|
when_invoked do |*args|
|
@@ -29,13 +34,13 @@ Puppet::Face.define(:node, '0.0.1') do
|
|
29
34
|
options = args.last
|
30
35
|
raise "At least one node should be passed" if nodes.empty? || nodes == options
|
31
36
|
|
32
|
-
|
33
|
-
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
Puppet.settings.
|
37
|
+
# This seems really bad; run_mode should be set as part of a class
|
38
|
+
# definition, and should not be modifiable beyond that. This is one of
|
39
|
+
# the only places left in the code that tries to manipulate it. Other
|
40
|
+
# parts of code that handle certificates behave differently if the the
|
41
|
+
# run_mode is master. Those other behaviors are needed for cleaning the
|
42
|
+
# certificates correctly.
|
43
|
+
Puppet.settings.preferred_run_mode = "master"
|
39
44
|
|
40
45
|
if Puppet::SSL::CertificateAuthority.ca?
|
41
46
|
Puppet::SSL::Host.ca_location = :local
|
data/lib/puppet/feature/base.rb
CHANGED
@@ -47,9 +47,6 @@ Puppet.features.add(:libshadow, :libs => ["shadow"])
|
|
47
47
|
# We're running as root.
|
48
48
|
Puppet.features.add(:root) { require 'puppet/util/suidmanager'; Puppet::Util::SUIDManager.root? }
|
49
49
|
|
50
|
-
# We've got mongrel available
|
51
|
-
Puppet.features.add(:mongrel, :libs => %w{rubygems mongrel puppet/network/http/mongrel})
|
52
|
-
|
53
50
|
# We have lcs diff
|
54
51
|
Puppet.features.add :diff, :libs => %w{diff/lcs diff/lcs/hunk}
|
55
52
|
|
data/lib/puppet/feature/rails.rb
CHANGED
@@ -13,9 +13,10 @@ Puppet.features.add(:rails) do
|
|
13
13
|
# that it offers. --daniel 2012-07-16
|
14
14
|
require 'active_support'
|
15
15
|
begin
|
16
|
+
require 'active_support/dependencies'
|
16
17
|
ActiveSupport::Dependencies.unhook!
|
17
18
|
ActiveSupport::Dependencies.mechanism = :require
|
18
|
-
rescue ScriptError, StandardError => e
|
19
|
+
rescue LoadError, ScriptError, StandardError => e
|
19
20
|
# ignore any failure - worst case we run without disabling the CPU
|
20
21
|
# sucking features, so are slower but ... not actually failed, just
|
21
22
|
# because some random future version of ActiveRecord changes.
|
@@ -5,6 +5,11 @@ require 'puppet/resource/catalog'
|
|
5
5
|
class Puppet::Resource::Catalog::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
|
# We don't retrieve catalogs from storeconfigs
|
9
14
|
def find(request)
|
10
15
|
nil
|
@@ -113,9 +113,7 @@ class Puppet::Resource::Catalog::StaticCompiler < Puppet::Indirector::Code
|
|
113
113
|
|
114
114
|
def remove_existing_resources(children, catalog)
|
115
115
|
existing_names = catalog.resources.collect { |r| r.to_s }
|
116
|
-
|
117
116
|
both = (existing_names & children.keys).inject({}) { |hash, name| hash[name] = true; hash }
|
118
|
-
|
119
117
|
both.each { |name| children.delete(name) }
|
120
118
|
end
|
121
119
|
|
@@ -131,7 +129,8 @@ class Puppet::Resource::Catalog::StaticCompiler < Puppet::Indirector::Code
|
|
131
129
|
else
|
132
130
|
Puppet.info "Storing content for source '#{resource[:source]}'"
|
133
131
|
content = Puppet::FileServing::Content.indirection.find(resource[:source])
|
134
|
-
Puppet::FileBucket::File.
|
132
|
+
file = Puppet::FileBucket::File.new(content.content)
|
133
|
+
Puppet::FileBucket::File.indirection.save(file)
|
135
134
|
end
|
136
135
|
end
|
137
136
|
end
|