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
data/LICENSE
CHANGED
data/README_DEVELOPER.md
CHANGED
@@ -25,7 +25,133 @@ When we setup CI nodes, but this is not standard or expected behavior.
|
|
25
25
|
Please consider rbenv instead of rvm. The default behavior of rvm is difficult
|
26
26
|
to maintain with `set -e` shell environments.
|
27
27
|
|
28
|
-
#
|
28
|
+
# Two Types of Catalog
|
29
|
+
|
30
|
+
When working on subsystems of Puppet that deal with the catalog it is important
|
31
|
+
to be aware of the two different types of Catalog. I often ran into this when
|
32
|
+
working in Professional Services when I built a small tool to diff two catalogs
|
33
|
+
to determine if an upgrade in Puppet produces the same configuration catalogs.
|
34
|
+
As a developer I've run into this difference while working on spec tests for
|
35
|
+
the static compiler and working on spec tests for types and providers.
|
36
|
+
|
37
|
+
The two different types of catalog becomes relevant when writing spec tests
|
38
|
+
because we frequently need to wire up a fake catalog so that we can exercise
|
39
|
+
types, providers, or terminii that filter the catalog.
|
40
|
+
|
41
|
+
The two different types of catalogs are so-called "resource" catalogs and "RAL"
|
42
|
+
(resource abstraction layer) catalogs. At a high level, the resource catalog
|
43
|
+
is the in-memory object we serialize and transfer around the network. The
|
44
|
+
compiler terminus is expected to produce a resource catalog. The agent takes a
|
45
|
+
resource catalog and converts it into a RAL catalog. The RAL catalog is what
|
46
|
+
is used to apply the configuration model to the system.
|
47
|
+
|
48
|
+
Resource dependency information is most easily obtained from a RAL catalog by
|
49
|
+
walking the graph instance produced by the `relationship_graph` method.
|
50
|
+
|
51
|
+
## Resource Catalog
|
52
|
+
|
53
|
+
If you're writing spec tests for something that deals with a catalog "server
|
54
|
+
side," a new catalog terminus for example, then you'll be dealing with a
|
55
|
+
resource catalog. You can produce a resource catalog suitable for spec tests
|
56
|
+
using something like this:
|
57
|
+
|
58
|
+
let(:catalog) do
|
59
|
+
catalog = Puppet::Resource::Catalog.new("node-name-val") # NOT certname!
|
60
|
+
rsrc = Puppet::Resource.new("file", "sshd_config",
|
61
|
+
:parameters => {
|
62
|
+
:ensure => 'file',
|
63
|
+
:source => 'puppet:///modules/filetest/sshd_config',
|
64
|
+
}
|
65
|
+
)
|
66
|
+
rsrc.file = 'site.pp'
|
67
|
+
rsrc.line = 21
|
68
|
+
catalog.add_resource(rsrc)
|
69
|
+
end
|
70
|
+
|
71
|
+
The resources in this catalog may be accessed using `catalog.resources`.
|
72
|
+
Resource dependencies are not easily walked using a resource catalog however.
|
73
|
+
To walk the dependency tree convert the catalog to a RAL catalog as described
|
74
|
+
in
|
75
|
+
|
76
|
+
## RAL Catalog
|
77
|
+
|
78
|
+
The resource catalog may be converted to a RAL catalog using `catalog.to_ral`.
|
79
|
+
The RAL catalog contains `Puppet::Type` instances instead of `Puppet::Resource`
|
80
|
+
instances as is the case with the resource catalog.
|
81
|
+
|
82
|
+
One very useful feature of the RAL catalog are the methods to work with
|
83
|
+
resource relationships. For example:
|
84
|
+
|
85
|
+
irb> catalog = catalog.to_ral
|
86
|
+
irb> graph = catalog.relationship_graph
|
87
|
+
irb> pp graph.edges
|
88
|
+
[{ Notify[alpha] => File[/tmp/file_20.txt] },
|
89
|
+
{ Notify[alpha] => File[/tmp/file_21.txt] },
|
90
|
+
{ Notify[alpha] => File[/tmp/file_22.txt] },
|
91
|
+
{ Notify[alpha] => File[/tmp/file_23.txt] },
|
92
|
+
{ Notify[alpha] => File[/tmp/file_24.txt] },
|
93
|
+
{ Notify[alpha] => File[/tmp/file_25.txt] },
|
94
|
+
{ Notify[alpha] => File[/tmp/file_26.txt] },
|
95
|
+
{ Notify[alpha] => File[/tmp/file_27.txt] },
|
96
|
+
{ Notify[alpha] => File[/tmp/file_28.txt] },
|
97
|
+
{ Notify[alpha] => File[/tmp/file_29.txt] },
|
98
|
+
{ File[/tmp/file_20.txt] => Notify[omega] },
|
99
|
+
{ File[/tmp/file_21.txt] => Notify[omega] },
|
100
|
+
{ File[/tmp/file_22.txt] => Notify[omega] },
|
101
|
+
{ File[/tmp/file_23.txt] => Notify[omega] },
|
102
|
+
{ File[/tmp/file_24.txt] => Notify[omega] },
|
103
|
+
{ File[/tmp/file_25.txt] => Notify[omega] },
|
104
|
+
{ File[/tmp/file_26.txt] => Notify[omega] },
|
105
|
+
{ File[/tmp/file_27.txt] => Notify[omega] },
|
106
|
+
{ File[/tmp/file_28.txt] => Notify[omega] },
|
107
|
+
{ File[/tmp/file_29.txt] => Notify[omega] }]
|
108
|
+
|
109
|
+
If the `relationship_graph` method is throwing exceptions at you, there's a
|
110
|
+
good chance the catalog is not a RAL catalog.
|
111
|
+
|
112
|
+
## Settings Catalog ##
|
113
|
+
|
114
|
+
Be aware that Puppet creates a mini catalog and applies this catalog locally to
|
115
|
+
manage file resource from the settings. This behavior made it difficult and
|
116
|
+
time consuming to track down a race condition in
|
117
|
+
[2888](http://projects.puppetlabs.com/issues/2888).
|
118
|
+
|
119
|
+
Even more surprising, the `File[puppetdlockfile]` resource is only added to the
|
120
|
+
settings catalog if the file exists on disk. This caused the race condition as
|
121
|
+
it will exist when a separate process holds the lock while applying the
|
122
|
+
catalog.
|
123
|
+
|
124
|
+
It may be sufficient to simply be aware of the settings catalog and the
|
125
|
+
potential for race conditions it presents. An effective way to be reasonably
|
126
|
+
sure and track down the problem is to wrap the File.open method like so:
|
127
|
+
|
128
|
+
# We're wrapping ourselves around the File.open method.
|
129
|
+
# As described at: http://goo.gl/lDsv6
|
130
|
+
class File
|
131
|
+
WHITELIST = [ /pidlock.rb:39/ ]
|
132
|
+
|
133
|
+
class << self
|
134
|
+
alias xxx_orig_open open
|
135
|
+
end
|
136
|
+
|
137
|
+
def self.open(name, *rest, &block)
|
138
|
+
# Check the whitelist for any "good" File.open calls against the #
|
139
|
+
puppetdlock file
|
140
|
+
white_listed = caller(0).find do |line|
|
141
|
+
JJM_WHITELIST.find { |re| re.match(line) }
|
142
|
+
end
|
143
|
+
|
144
|
+
# If you drop into IRB here, take a look at your caller, it might be
|
145
|
+
# the ghost in the machine you're looking for.
|
146
|
+
binding.pry if name =~ /puppetdlock/ and not white_listed
|
147
|
+
xxx_orig_open(name, *rest, &block)
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
The settings catalog is populated by the `Puppet::Util::Settings#to\_catalog`
|
152
|
+
method.
|
153
|
+
|
154
|
+
# Ruby Dependencies #
|
29
155
|
|
30
156
|
Puppet is considered an Application as it relates to the recommendation of
|
31
157
|
adding a Gemfile.lock file to the repository and the information published at
|
@@ -226,4 +352,86 @@ Please do not monkey patch the constant `Puppet::PUPPETVERSION` or obtain the
|
|
226
352
|
version using the constant. The only supported way to set and get the Puppet
|
227
353
|
version is through the accessor methods.
|
228
354
|
|
355
|
+
# Static Compiler
|
356
|
+
|
357
|
+
The static compiler was added to Puppet in the 2.7.0 release.
|
358
|
+
[1](http://links.puppetlabs.com/static-compiler-announce)
|
359
|
+
|
360
|
+
The static compiler is intended to provide a configuration catalog that
|
361
|
+
requires a minimal amount of network communication in order to apply the
|
362
|
+
catalog to the system. As implemented in Puppet 2.7.x and Puppet 3.0.x this
|
363
|
+
intention takes the form of replacing all of the source parameters of File
|
364
|
+
resources with a content parameter containing an address in the form of a
|
365
|
+
checksum. The expected behavior is that the process applying the catalog to
|
366
|
+
the node will retrieve the file content from the FileBucket instead of the
|
367
|
+
FileServer.
|
368
|
+
|
369
|
+
The high level approach can be described as follows. The `StaticCompiler` is a
|
370
|
+
terminus that inserts itself between the "normal" compiler terminus and the
|
371
|
+
request. The static compiler takes the resource catalog produced by the
|
372
|
+
compiler and filters all File resources. Any file resource that contains a
|
373
|
+
source parameter with a value starting with 'puppet://' is filtered in the
|
374
|
+
following way in a "standard" single master / networked agents deployment
|
375
|
+
scenario:
|
376
|
+
|
377
|
+
1. The content, owner, group, and mode values are retrieved from th
|
378
|
+
FileServer by the master.
|
379
|
+
2. The file content is stored in the file bucket on the master.
|
380
|
+
3. The source parameter value is stripped from the File resource.
|
381
|
+
4. The content parameter value is set in the File resource using the form
|
382
|
+
'{XXX}1234567890' which can be thought of as a content address indexed by
|
383
|
+
checksum.
|
384
|
+
5. The owner, group and mode values are set in the File resource if they are
|
385
|
+
not already set.
|
386
|
+
6. The filtered catalog is returned in the response.
|
387
|
+
|
388
|
+
In addition to the catalog terminus, the process requesting the catalog needs
|
389
|
+
to obtain the file content. The default behavior of `puppet agent` is to
|
390
|
+
obtain file contents from the local client bucket. The method we expect users
|
391
|
+
to employ to reconfigure the agent to use the server bucket is to declare the
|
392
|
+
`Filebucket[puppet]` resource with the address of the master. For example:
|
393
|
+
|
394
|
+
node default {
|
395
|
+
filebucket { puppet:
|
396
|
+
server => $server,
|
397
|
+
path => false,
|
398
|
+
}
|
399
|
+
class { filetest: }
|
400
|
+
}
|
401
|
+
|
402
|
+
This special filebucket resource named "puppet" will cause the agent to fetch
|
403
|
+
file contents specified by checksum from the remote filebucket instead of the
|
404
|
+
default clientbucket.
|
405
|
+
|
406
|
+
## Quick start
|
407
|
+
|
408
|
+
Create a module that recursively downloads something. The jeffmccune-filetest
|
409
|
+
module will recursively copy the rubygems source tree.
|
410
|
+
|
411
|
+
$ puppet module install jeffmccune-filetest
|
412
|
+
|
413
|
+
Start the master with the StaticCompiler turned on:
|
414
|
+
|
415
|
+
$ puppet master \
|
416
|
+
--catalog_terminus=static_compiler \
|
417
|
+
--verbose \
|
418
|
+
--no-daemonize
|
419
|
+
|
420
|
+
Add the special Filebucket[puppet] resource:
|
421
|
+
|
422
|
+
# site.pp
|
423
|
+
node default {
|
424
|
+
filebucket { puppet: server => $server, path => false }
|
425
|
+
class { filetest: }
|
426
|
+
}
|
427
|
+
|
428
|
+
Get the static catalog:
|
429
|
+
|
430
|
+
$ puppet agent --test
|
431
|
+
|
432
|
+
You should expect all file metadata to be contained in the catalog, including a
|
433
|
+
checksum representing the content. When managing an out of sync file resource,
|
434
|
+
the real contents should be fetched from the server instead of the
|
435
|
+
clientbucket.
|
436
|
+
|
229
437
|
EOF
|
data/README_HIERA.md
ADDED
@@ -0,0 +1,148 @@
|
|
1
|
+
What?
|
2
|
+
=====
|
3
|
+
|
4
|
+
A data backend for Hiera that can query the internal Puppet
|
5
|
+
scope for data. The data structure and approach is heavily
|
6
|
+
based on work by Nigel Kersten but made more configurable and
|
7
|
+
with full hierarchy.
|
8
|
+
|
9
|
+
It also includes a Puppet function that works like extlookup()
|
10
|
+
but uses the Hiera backends.
|
11
|
+
|
12
|
+
Usage?
|
13
|
+
======
|
14
|
+
|
15
|
+
Hiera supports the concept of chaining backends together in order,
|
16
|
+
using this we can create a very solid module author/module user
|
17
|
+
experience.
|
18
|
+
|
19
|
+
Module Author
|
20
|
+
-------------
|
21
|
+
|
22
|
+
A module author wants to create a configurable module that has sane
|
23
|
+
defaults but want to retain the ability for users to configure it.
|
24
|
+
|
25
|
+
We'll use a simple NTP config class as an example.
|
26
|
+
|
27
|
+
<pre>
|
28
|
+
class ntp::config($ntpservers = hiera("ntpservers")) {
|
29
|
+
file{"/etc/ntp.conf":
|
30
|
+
content => template("ntp.conf.erb")
|
31
|
+
}
|
32
|
+
}
|
33
|
+
</pre>
|
34
|
+
|
35
|
+
We create a class that takes as parameters a list of NTP servers.
|
36
|
+
|
37
|
+
The module author wants to create a works-out-of-the-box experience
|
38
|
+
so creates a data class for the NTP module:
|
39
|
+
|
40
|
+
<pre>
|
41
|
+
class ntp::data {
|
42
|
+
$ntpservers = ["1.pool.ntp.org", "2.pool.ntp.org"]
|
43
|
+
}
|
44
|
+
</pre>
|
45
|
+
|
46
|
+
Together this creates a default sane setup.
|
47
|
+
|
48
|
+
Module User
|
49
|
+
-----------
|
50
|
+
|
51
|
+
The module user has a complex multi data center setup, he wants to use
|
52
|
+
the NTP module from the forge and configure it for his needs.
|
53
|
+
|
54
|
+
The user creates a set of default data for his organization, he can do
|
55
|
+
this in data files or in Puppet. We'll show a Puppet example.
|
56
|
+
|
57
|
+
<pre>
|
58
|
+
class data::common {
|
59
|
+
$ntpservers = ["ntp1.example.com", "ntp2.example.com"]
|
60
|
+
}
|
61
|
+
</pre>
|
62
|
+
|
63
|
+
Being part of the actual code this data is subject to strict change
|
64
|
+
control. This is needed as its data that can potentially affect all
|
65
|
+
machines in all locations.
|
66
|
+
|
67
|
+
The user has a fact called _location_ that contains, for example, a name
|
68
|
+
of the data center.
|
69
|
+
|
70
|
+
He decides to create JSON based data for the data centers, being just data
|
71
|
+
that applies to one data center this data is not subject to as strict
|
72
|
+
change controls and so does not live with the code:
|
73
|
+
|
74
|
+
He creates _/var/lib/hiera/dc1.json_ with the following:
|
75
|
+
|
76
|
+
<pre>
|
77
|
+
{"ntpservers" : ["ntp1.dc1.example.com", "ntp2.dc1.example.com"]}
|
78
|
+
</pre>
|
79
|
+
|
80
|
+
Machines in dc1 will now use specific NTP servers while all the rest will
|
81
|
+
use the data in _data::common_
|
82
|
+
|
83
|
+
The module user can now just declare the class on his nodes:
|
84
|
+
|
85
|
+
<pre>
|
86
|
+
node "web1" {
|
87
|
+
include ntp::config
|
88
|
+
}
|
89
|
+
</pre>
|
90
|
+
|
91
|
+
For true one-off changes, the user can use the full paramterized class approach
|
92
|
+
that will completely disable the Hiera handling of this data item. He could
|
93
|
+
also use an ENC to supply this data.
|
94
|
+
|
95
|
+
<pre>
|
96
|
+
node "web2" {
|
97
|
+
class{"ntp::config": ntpservers => ["another.example.com"]}
|
98
|
+
}
|
99
|
+
</pre>
|
100
|
+
|
101
|
+
This behavior is thanks to Hiera's ability to search through multiple backends
|
102
|
+
for data picking the first match. We can have the JSON searched before the internal
|
103
|
+
Puppet data.
|
104
|
+
|
105
|
+
To achieve this setup the module user needs to configure Hiera in _/etc/puppet/hiera.yaml_:
|
106
|
+
|
107
|
+
<pre>
|
108
|
+
---
|
109
|
+
:backends:
|
110
|
+
- json
|
111
|
+
- puppet
|
112
|
+
|
113
|
+
:hierarchy:
|
114
|
+
- "%{location}"
|
115
|
+
- common
|
116
|
+
|
117
|
+
:json:
|
118
|
+
:datadir: /var/lib/hiera
|
119
|
+
|
120
|
+
:puppet:
|
121
|
+
:datasource: data
|
122
|
+
</pre>
|
123
|
+
|
124
|
+
Converting from extlookup?
|
125
|
+
==========================
|
126
|
+
|
127
|
+
A simple converter is included called _extlookup2hiera_ and it can convert from CSV to JSON or YAML:
|
128
|
+
|
129
|
+
<pre>
|
130
|
+
$ extlookup2hiera --in common.csv --out common.json --json
|
131
|
+
</pre>
|
132
|
+
|
133
|
+
Installation?
|
134
|
+
=============
|
135
|
+
|
136
|
+
It's not 100% ready for prime time, shortly a simple _gem install hiera-puppet_ on your master will do it.
|
137
|
+
|
138
|
+
For the moment the Gem install will place the Puppet Parser Function where Puppet cannot find it, you should
|
139
|
+
copy it out and distribute it to your master using Pluginsync or something similar
|
140
|
+
|
141
|
+
License
|
142
|
+
=======
|
143
|
+
|
144
|
+
See LICENSE file.
|
145
|
+
|
146
|
+
Support
|
147
|
+
=======
|
148
|
+
Please log tickets and issues at our [Projects site](http://projects.puppetlabs.com)
|
data/Rakefile
CHANGED
@@ -20,43 +20,41 @@ end
|
|
20
20
|
require 'rake'
|
21
21
|
require 'rspec'
|
22
22
|
require "rspec/core/rake_task"
|
23
|
+
require 'yaml'
|
23
24
|
|
25
|
+
Dir['tasks/**/*.rake'].each { |t| load t }
|
26
|
+
Dir['ext/packaging/tasks/**/*'].sort.each { |t| load t }
|
24
27
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
28
|
+
begin
|
29
|
+
@build_defaults ||= YAML.load_file('ext/build_defaults.yaml')
|
30
|
+
@packaging_url = @build_defaults['packaging_url']
|
31
|
+
@packaging_repo = @build_defaults['packaging_repo']
|
32
|
+
rescue
|
33
|
+
STDERR.puts 'Unable to read the packaging repo info from ext/build_defaults.yaml'
|
29
34
|
end
|
30
35
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
Rake::PackageTask.new("puppet", Puppet.version) do |pkg|
|
48
|
-
pkg.package_dir = 'pkg'
|
49
|
-
pkg.need_tar_gz = true
|
50
|
-
pkg.package_files = FILES.to_a
|
36
|
+
namespace :package do
|
37
|
+
desc "Bootstrap packaging automation, e.g. clone into packaging repo"
|
38
|
+
task :bootstrap do
|
39
|
+
if File.exist?("ext/#{@packaging_repo}")
|
40
|
+
puts "It looks like you already have ext/#{@packaging_repo}. If you don't like it, blow it away with package:implode."
|
41
|
+
else
|
42
|
+
cd 'ext' do
|
43
|
+
%x{git clone #{@packaging_url}}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
desc "Remove all cloned packaging automation"
|
48
|
+
task :implode do
|
49
|
+
rm_rf "ext/#{@packaging_repo}"
|
50
|
+
end
|
51
51
|
end
|
52
52
|
|
53
|
+
|
53
54
|
task :default do
|
54
55
|
sh %{rake -T}
|
55
56
|
end
|
56
57
|
|
57
|
-
desc "Create the tarball and the gem - use when releasing"
|
58
|
-
task :puppetpackages => [:gem, :package]
|
59
|
-
|
60
58
|
RSpec::Core::RakeTask.new do |t|
|
61
59
|
t.pattern ='spec/{unit,integration}/**/*.rb'
|
62
60
|
t.fail_on_error = true
|
data/bin/extlookup2hiera
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'optparse'
|
4
|
+
require 'csv'
|
5
|
+
|
6
|
+
options = {:in => nil, :out => nil, :format => :yaml}
|
7
|
+
|
8
|
+
OptionParser.new do |opts|
|
9
|
+
opts.banner = "Converter for extlookup CSV files into Hiera JSON and YAML files"
|
10
|
+
|
11
|
+
opts.on("--in FILE", "-i", "Input CSV file") do |v|
|
12
|
+
options[:in] = v
|
13
|
+
end
|
14
|
+
|
15
|
+
opts.on("--out FILE", "-o", "Output Hiera file") do |v|
|
16
|
+
options[:out] = v
|
17
|
+
end
|
18
|
+
|
19
|
+
opts.on("--json", "-j", "Create JSON format file") do |v|
|
20
|
+
options[:format] = :json
|
21
|
+
end
|
22
|
+
end.parse!
|
23
|
+
|
24
|
+
if options[:in].nil? || options[:out].nil?
|
25
|
+
STDERR.puts "Please specify an input and output file with --in and --out"
|
26
|
+
exit 1
|
27
|
+
end
|
28
|
+
|
29
|
+
unless File.exist?(options[:in])
|
30
|
+
STDERR.puts "Cannot find input file #{options[:in]}"
|
31
|
+
exit 1
|
32
|
+
end
|
33
|
+
|
34
|
+
csvdata = CSV.read(options[:in])
|
35
|
+
hieradata = {}
|
36
|
+
|
37
|
+
csvdata.each do |d|
|
38
|
+
d = d.map{|item| item.to_s}
|
39
|
+
|
40
|
+
if d.size > 2
|
41
|
+
hieradata[d[0]] = d[1, d.size].flatten
|
42
|
+
else
|
43
|
+
hieradata[d[0]] = d[1]
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
case options[:format]
|
48
|
+
when :yaml
|
49
|
+
require 'yaml'
|
50
|
+
File.open(options[:out], "w") {|f| f.write hieradata.to_yaml}
|
51
|
+
when :json
|
52
|
+
require 'rubygems'
|
53
|
+
require 'json'
|
54
|
+
File.open(options[:out], "w") {|f| f.write JSON.pretty_generate hieradata}
|
55
|
+
end
|
56
|
+
|