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/lib/hiera_puppet.rb
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
require 'hiera'
|
2
|
+
require 'hiera/scope'
|
3
|
+
require 'puppet'
|
4
|
+
|
5
|
+
module HieraPuppet
|
6
|
+
module_function
|
7
|
+
|
8
|
+
def lookup(key, default, scope, override, resolution_type)
|
9
|
+
unless scope.respond_to?("[]")
|
10
|
+
scope = Hiera::Scope.new(scope)
|
11
|
+
end
|
12
|
+
|
13
|
+
answer = hiera.lookup(key, default, scope, override, resolution_type)
|
14
|
+
|
15
|
+
if answer.nil?
|
16
|
+
raise(Puppet::ParseError, "Could not find data item #{key} in any Hiera data file and no default supplied")
|
17
|
+
end
|
18
|
+
|
19
|
+
answer
|
20
|
+
end
|
21
|
+
|
22
|
+
def parse_args(args)
|
23
|
+
# Functions called from Puppet manifests like this:
|
24
|
+
#
|
25
|
+
# hiera("foo", "bar")
|
26
|
+
#
|
27
|
+
# Are invoked internally after combining the positional arguments into a
|
28
|
+
# single array:
|
29
|
+
#
|
30
|
+
# func = function_hiera
|
31
|
+
# func(["foo", "bar"])
|
32
|
+
#
|
33
|
+
# Functions called from templates preserve the positional arguments:
|
34
|
+
#
|
35
|
+
# scope.function_hiera("foo", "bar")
|
36
|
+
#
|
37
|
+
# Deal with Puppet's special calling mechanism here.
|
38
|
+
if args[0].is_a?(Array)
|
39
|
+
args = args[0]
|
40
|
+
end
|
41
|
+
|
42
|
+
if args.empty?
|
43
|
+
raise(Puppet::ParseError, "Please supply a parameter to perform a Hiera lookup")
|
44
|
+
end
|
45
|
+
|
46
|
+
key = args[0]
|
47
|
+
default = args[1]
|
48
|
+
override = args[2]
|
49
|
+
|
50
|
+
return [key, default, override]
|
51
|
+
end
|
52
|
+
|
53
|
+
private
|
54
|
+
module_function
|
55
|
+
|
56
|
+
def hiera
|
57
|
+
@hiera ||= Hiera.new(:config => hiera_config)
|
58
|
+
end
|
59
|
+
|
60
|
+
def hiera_config
|
61
|
+
config = {}
|
62
|
+
|
63
|
+
if config_file = hiera_config_file
|
64
|
+
config = Hiera::Config.load(config_file)
|
65
|
+
end
|
66
|
+
|
67
|
+
config[:logger] = 'puppet'
|
68
|
+
config
|
69
|
+
end
|
70
|
+
|
71
|
+
def hiera_config_file
|
72
|
+
config_file = nil
|
73
|
+
|
74
|
+
if Puppet.settings[:hiera_config].is_a?(String)
|
75
|
+
expanded_config_file = File.expand_path(Puppet.settings[:hiera_config])
|
76
|
+
if File.exist?(expanded_config_file)
|
77
|
+
config_file = expanded_config_file
|
78
|
+
end
|
79
|
+
elsif Puppet.settings[:confdir].is_a?(String)
|
80
|
+
expanded_config_file = File.expand_path(File.join(Puppet.settings[:confdir], '/hiera.yaml'))
|
81
|
+
if File.exist?(expanded_config_file)
|
82
|
+
config_file = expanded_config_file
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
config_file
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
data/lib/puppet.rb
CHANGED
@@ -94,7 +94,7 @@ module Puppet
|
|
94
94
|
# (rather than using a global variable, as we did previously...). Would be good to revisit this at some point.
|
95
95
|
#
|
96
96
|
# --cprice 2012-03-16
|
97
|
-
Puppet::Util::RunMode[@@settings.
|
97
|
+
Puppet::Util::RunMode[@@settings.preferred_run_mode]
|
98
98
|
end
|
99
99
|
|
100
100
|
# Load all of the configuration parameters.
|
data/lib/puppet/agent.rb
CHANGED
@@ -27,7 +27,7 @@ class Puppet::Agent
|
|
27
27
|
# Perform a run with our client.
|
28
28
|
def run(client_options = {})
|
29
29
|
if running?
|
30
|
-
Puppet.notice "Run of #{client_class} already in progress; skipping"
|
30
|
+
Puppet.notice "Run of #{client_class} already in progress; skipping (#{lockfile_path} exists)"
|
31
31
|
return
|
32
32
|
end
|
33
33
|
if disabled?
|
@@ -70,7 +70,7 @@ class Puppet::Agent
|
|
70
70
|
return unless Puppet[:splay]
|
71
71
|
return if splayed?
|
72
72
|
|
73
|
-
time = rand(
|
73
|
+
time = rand(Puppet[:splaylimit] + 1)
|
74
74
|
Puppet.info "Sleeping for #{time} seconds (splay is enabled)"
|
75
75
|
sleep(time)
|
76
76
|
@splayed = true
|
data/lib/puppet/agent/locker.rb
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
require 'puppet/util/pidlock'
|
2
2
|
|
3
|
-
# This module is responsible for encapsulating the logic for
|
4
|
-
#
|
5
|
-
#
|
6
|
-
#
|
3
|
+
# This module is responsible for encapsulating the logic for "locking" the
|
4
|
+
# puppet agent during a catalog run; in other words, keeping track of enough
|
5
|
+
# state to answer the question "is there a puppet agent currently applying a
|
6
|
+
# catalog?"
|
7
7
|
#
|
8
|
-
# The implementation involves writing a lockfile whose contents
|
9
|
-
#
|
10
|
-
#
|
11
|
-
# by external tools such as mcollective.
|
8
|
+
# The implementation involves writing a lockfile whose contents are simply the
|
9
|
+
# PID of the running agent process. This is considered part of the public
|
10
|
+
# Puppet API because it used by external tools such as mcollective.
|
12
11
|
#
|
13
12
|
# For more information, please see docs on the website.
|
14
13
|
# http://links.puppetlabs.com/agent_lockfiles
|
@@ -29,8 +28,12 @@ module Puppet::Agent::Locker
|
|
29
28
|
lockfile.locked?
|
30
29
|
end
|
31
30
|
|
31
|
+
def lockfile_path
|
32
|
+
@lockfile_path ||= Puppet[:agent_catalog_run_lockfile]
|
33
|
+
end
|
34
|
+
|
32
35
|
def lockfile
|
33
|
-
@lockfile ||= Puppet::Util::Pidlock.new(
|
36
|
+
@lockfile ||= Puppet::Util::Pidlock.new(lockfile_path)
|
34
37
|
|
35
38
|
@lockfile
|
36
39
|
end
|
data/lib/puppet/application.rb
CHANGED
@@ -265,19 +265,23 @@ class Application
|
|
265
265
|
find(name).new
|
266
266
|
end
|
267
267
|
|
268
|
-
#
|
269
|
-
# I think that it would be nice to look into changing this into two methods (getter/setter); however,
|
270
|
-
# it sounds like this is a desirable feature of our ruby DSL. --cprice 2012-03-06
|
271
|
-
#
|
272
|
-
|
273
268
|
# Sets or gets the run_mode name. Sets the run_mode name if a mode_name is
|
274
269
|
# passed. Otherwise, gets the run_mode or a default run_mode
|
275
270
|
#
|
276
271
|
def run_mode( mode_name = nil)
|
272
|
+
if mode_name
|
273
|
+
Puppet.settings.preferred_run_mode = mode_name
|
274
|
+
end
|
275
|
+
|
277
276
|
return @run_mode if @run_mode and not mode_name
|
278
277
|
|
279
278
|
require 'puppet/util/run_mode'
|
280
|
-
@run_mode = Puppet::Util::RunMode[ mode_name ||
|
279
|
+
@run_mode = Puppet::Util::RunMode[ mode_name || Puppet.settings.preferred_run_mode ]
|
280
|
+
end
|
281
|
+
|
282
|
+
# This is for testing only
|
283
|
+
def clear_everything_for_tests
|
284
|
+
@run_mode = @banner = @run_status = @option_parser_commands = nil
|
281
285
|
end
|
282
286
|
end
|
283
287
|
|
@@ -409,8 +413,6 @@ class Application
|
|
409
413
|
option_parser.parse!(self.command_line.args)
|
410
414
|
end
|
411
415
|
|
412
|
-
|
413
|
-
|
414
416
|
def handlearg(opt, val)
|
415
417
|
opt, val = Puppet::Settings.clean_opt(opt, val)
|
416
418
|
send(:handle_unknown, opt, val) if respond_to?(:handle_unknown)
|
@@ -9,6 +9,7 @@ class Puppet::Application::Agent < Puppet::Application
|
|
9
9
|
def app_defaults
|
10
10
|
super.merge({
|
11
11
|
:catalog_terminus => :rest,
|
12
|
+
:catalog_cache_terminus => :json,
|
12
13
|
:node_terminus => :rest,
|
13
14
|
:facts_terminus => :facter,
|
14
15
|
})
|
@@ -33,7 +34,7 @@ class Puppet::Application::Agent < Puppet::Application
|
|
33
34
|
:client => true,
|
34
35
|
:fqdn => nil,
|
35
36
|
:serve => [],
|
36
|
-
:digest =>
|
37
|
+
:digest => 'SHA256',
|
37
38
|
:graph => true,
|
38
39
|
:fingerprint => false,
|
39
40
|
}.each do |opt,val|
|
@@ -88,7 +89,7 @@ class Puppet::Application::Agent < Puppet::Application
|
|
88
89
|
end
|
89
90
|
|
90
91
|
def help
|
91
|
-
<<-HELP
|
92
|
+
<<-'HELP'
|
92
93
|
|
93
94
|
puppet-agent(8) -- The puppet agent daemon
|
94
95
|
========
|
@@ -199,8 +200,8 @@ configuration options can also be generated by running puppet agent with
|
|
199
200
|
|
200
201
|
* --digest:
|
201
202
|
Change the certificate fingerprinting digest algorithm. The default is
|
202
|
-
|
203
|
-
|
203
|
+
SHA256. Valid values depends on the version of OpenSSL installed, but
|
204
|
+
will likely contain MD5, MD2, SHA1 and SHA256.
|
204
205
|
|
205
206
|
* --disable:
|
206
207
|
Disable working on the local system. This puts a lock file in place,
|
@@ -317,10 +318,10 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
|
|
317
318
|
exit(1)
|
318
319
|
return
|
319
320
|
end
|
320
|
-
unless
|
321
|
+
unless digest = cert.digest(options[:digest].to_s)
|
321
322
|
raise ArgumentError, "Could not get fingerprint for digest '#{options[:digest]}'"
|
322
323
|
end
|
323
|
-
puts
|
324
|
+
puts digest.to_s
|
324
325
|
end
|
325
326
|
|
326
327
|
def onetime
|
@@ -378,6 +379,7 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
|
|
378
379
|
end
|
379
380
|
|
380
381
|
def setup_listen
|
382
|
+
Puppet.warning "Puppet --listen / kick is deprecated. See http://links.puppetlabs.com/puppet-kick-deprecation"
|
381
383
|
unless FileTest.exists?(Puppet[:rest_authconfig])
|
382
384
|
Puppet.err "Will not start without authorization file #{Puppet[:rest_authconfig]}"
|
383
385
|
exit(14)
|
@@ -385,7 +387,7 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
|
|
385
387
|
|
386
388
|
require 'puppet/network/server'
|
387
389
|
# No REST handlers yet.
|
388
|
-
server = Puppet::Network::Server.new(:
|
390
|
+
server = Puppet::Network::Server.new(Puppet[:bindaddress], Puppet[:puppetport])
|
389
391
|
|
390
392
|
@daemon.server = server
|
391
393
|
end
|
@@ -460,7 +462,9 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
|
|
460
462
|
# we want the last report to be persisted locally
|
461
463
|
Puppet::Transaction::Report.indirection.cache_class = :yaml
|
462
464
|
|
463
|
-
Puppet
|
465
|
+
if Puppet[:catalog_cache_terminus]
|
466
|
+
Puppet::Resource::Catalog.indirection.cache_class = Puppet[:catalog_cache_terminus]
|
467
|
+
end
|
464
468
|
|
465
469
|
unless options[:fingerprint]
|
466
470
|
setup_agent
|
@@ -31,7 +31,7 @@ class Puppet::Application::Apply < Puppet::Application
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def help
|
34
|
-
<<-HELP
|
34
|
+
<<-'HELP'
|
35
35
|
|
36
36
|
puppet-apply(8) -- Apply Puppet manifests locally
|
37
37
|
========
|
@@ -135,7 +135,7 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
|
|
135
135
|
|
136
136
|
def app_defaults
|
137
137
|
super.merge({
|
138
|
-
:default_file_terminus =>
|
138
|
+
:default_file_terminus => :file_server,
|
139
139
|
})
|
140
140
|
end
|
141
141
|
|
@@ -52,7 +52,7 @@ class Puppet::Application::Cert < Puppet::Application
|
|
52
52
|
end
|
53
53
|
|
54
54
|
def help
|
55
|
-
<<-HELP
|
55
|
+
<<-'HELP'
|
56
56
|
|
57
57
|
puppet-cert(8) -- Manage certificates and requests
|
58
58
|
========
|
@@ -91,8 +91,8 @@ unless the '--all' option is set.
|
|
91
91
|
both signed and unsigned, will be removed.
|
92
92
|
|
93
93
|
* fingerprint:
|
94
|
-
Print the DIGEST (defaults to
|
95
|
-
certificate.
|
94
|
+
Print the DIGEST (defaults to the signing algorithm) fingerprint of a
|
95
|
+
host's certificate.
|
96
96
|
|
97
97
|
* generate:
|
98
98
|
Generate a certificate for a named client. A certificate/keypair will
|
@@ -140,9 +140,9 @@ configuration options can also be generated by running puppet cert with
|
|
140
140
|
'clean', 'list', and 'fingerprint' actions.
|
141
141
|
|
142
142
|
* --digest:
|
143
|
-
Set the digest for fingerprinting (defaults to
|
144
|
-
depends on your openssl and openssl ruby
|
145
|
-
|
143
|
+
Set the digest for fingerprinting (defaults to the the digest used when
|
144
|
+
signing the cert). Valid values depends on your openssl and openssl ruby
|
145
|
+
extension version.
|
146
146
|
|
147
147
|
* --debug:
|
148
148
|
Enable full debugging.
|
@@ -7,10 +7,7 @@ class Puppet::Application::Certificate < Puppet::Application::IndirectionBase
|
|
7
7
|
# I'd prefer if this could be dealt with differently; ideally, run_mode should be set as
|
8
8
|
# part of a class definition, and should not be modifiable beyond that. This is one of
|
9
9
|
# the cases where that isn't currently possible.
|
10
|
-
|
11
|
-
# normal 'setting' like the rest of the config stuff; I left some notes in settings.rb
|
12
|
-
# and defaults.rb discussing this. --cprice 2012-03-22
|
13
|
-
Puppet.settings.set_value(:run_mode, :master, :application_defaults)
|
10
|
+
Puppet.settings.preferred_run_mode = "master"
|
14
11
|
end
|
15
12
|
|
16
13
|
super
|
@@ -11,6 +11,7 @@ class Puppet::Application::Device < Puppet::Application
|
|
11
11
|
def app_defaults
|
12
12
|
super.merge({
|
13
13
|
:catalog_terminus => :rest,
|
14
|
+
:catalog_cache_terminus => :json,
|
14
15
|
:node_terminus => :rest,
|
15
16
|
:facts_terminus => :network_device,
|
16
17
|
})
|
@@ -63,7 +64,7 @@ class Puppet::Application::Device < Puppet::Application
|
|
63
64
|
end
|
64
65
|
|
65
66
|
def help
|
66
|
-
<<-HELP
|
67
|
+
<<-'HELP'
|
67
68
|
|
68
69
|
puppet-device(8) -- Manage remote network devices
|
69
70
|
========
|
@@ -236,6 +237,8 @@ Licensed under the Apache 2.0 License
|
|
236
237
|
|
237
238
|
Puppet::Transaction::Report.indirection.terminus_class = :rest
|
238
239
|
|
239
|
-
Puppet
|
240
|
+
if Puppet[:catalog_cache_terminus]
|
241
|
+
Puppet::Resource::Catalog.indirection.cache_class = Puppet[:catalog_cache_terminus].intern
|
242
|
+
end
|
240
243
|
end
|
241
244
|
end
|
@@ -4,8 +4,6 @@ require 'optparse'
|
|
4
4
|
require 'pp'
|
5
5
|
|
6
6
|
class Puppet::Application::FaceBase < Puppet::Application
|
7
|
-
run_mode :agent
|
8
|
-
|
9
7
|
option("--debug", "-d") do |arg|
|
10
8
|
Puppet::Util::Log.level = :debug
|
11
9
|
end
|
@@ -18,16 +16,6 @@ class Puppet::Application::FaceBase < Puppet::Application
|
|
18
16
|
self.render_as = format.to_sym
|
19
17
|
end
|
20
18
|
|
21
|
-
# This seems like a bad thing; it seems like--in an ideal world--a given app/face should have one constant run mode.
|
22
|
-
# This isn't currently possible because of issues relating to the certificate authority, but I've left some notes
|
23
|
-
# about "run_mode" in settings.rb and defaults.rb, and if we are able to tighten up the behavior / implementation
|
24
|
-
# of that setting, we might want to revisit this. --cprice 2012-03-16
|
25
|
-
option("--mode RUNMODE", "-r") do |arg|
|
26
|
-
raise "Invalid run mode #{arg}; supported modes are user, agent, master" unless %w{user agent master}.include?(arg)
|
27
|
-
self.class.run_mode(arg.to_sym)
|
28
|
-
end
|
29
|
-
|
30
|
-
|
31
19
|
attr_accessor :face, :action, :type, :arguments, :render_as
|
32
20
|
|
33
21
|
def render_as=(format)
|
@@ -97,7 +85,9 @@ class Puppet::Application::FaceBase < Puppet::Application
|
|
97
85
|
unless Puppet.settings.boolean? option.name then
|
98
86
|
# As far as I can tell, we treat non-bool options as always having
|
99
87
|
# a mandatory argument. --daniel 2011-04-05
|
100
|
-
|
88
|
+
# ... But, the mandatory argument will not be the next item if an = is
|
89
|
+
# employed in the long form of the option. --jeffmccune 2012-09-18
|
90
|
+
index += 1 unless item =~ /^--#{option.name}=/
|
101
91
|
end
|
102
92
|
elsif option = find_application_argument(item) then
|
103
93
|
index += 1 if (option[:argument] and not option[:optional])
|
@@ -36,7 +36,7 @@ class Puppet::Application::Kick < Puppet::Application
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def help
|
39
|
-
<<-HELP
|
39
|
+
<<-'HELP'
|
40
40
|
|
41
41
|
puppet-kick(8) -- Remotely control puppet agent
|
42
42
|
========
|
@@ -298,7 +298,9 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
|
|
298
298
|
end
|
299
299
|
|
300
300
|
def setup
|
301
|
+
super()
|
301
302
|
raise Puppet::Error.new("Puppet kick is not supported on Microsoft Windows") if Puppet.features.microsoft_windows?
|
303
|
+
Puppet.warning "Puppet kick is deprecated. See http://links.puppetlabs.com/puppet-kick-deprecation"
|
302
304
|
|
303
305
|
if options[:debug]
|
304
306
|
Puppet::Util::Log.level = :debug
|
@@ -306,7 +308,7 @@ Copyright (c) 2011 Puppet Labs, LLC Licensed under the Apache 2.0 License
|
|
306
308
|
Puppet::Util::Log.level = :info
|
307
309
|
end
|
308
310
|
|
309
|
-
if Puppet[:node_terminus] ==
|
311
|
+
if Puppet[:node_terminus] == :ldap and (options[:all] or @classes)
|
310
312
|
if options[:all]
|
311
313
|
@hosts = Puppet::Node.indirection.search("whatever", :fqdn => options[:fqdn]).collect { |node| node.name }
|
312
314
|
puts "all: #{@hosts.join(", ")}"
|