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
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/{conf → ext}/suse/logrotate
RENAMED
File without changes
|
File without changes
|
@@ -86,7 +86,7 @@ find %{buildroot}%{ruby_sitelibdir} -type f -perm +ugo+x -exec chmod a-x '{}' \;
|
|
86
86
|
%{_initrddir}/puppet
|
87
87
|
/var/adm/fillup-templates/sysconfig.puppet
|
88
88
|
%config(noreplace) %{_sysconfdir}/puppet/puppet.conf
|
89
|
-
%doc
|
89
|
+
%doc COPYING LICENSE README examples
|
90
90
|
%config(noreplace) %{_sysconfdir}/logrotate.d/puppet
|
91
91
|
%dir %{_sysconfdir}/puppet
|
92
92
|
# These need to be owned by puppet so the server can
|
File without changes
|
@@ -0,0 +1,13 @@
|
|
1
|
+
[Unit]
|
2
|
+
Description=Puppet agent
|
3
|
+
Wants=basic.target
|
4
|
+
After=basic.target network.target
|
5
|
+
|
6
|
+
[Service]
|
7
|
+
Type=forking
|
8
|
+
PIDFile=/run/puppet/agent.pid
|
9
|
+
ExecStartPre=/usr/bin/install -d -o puppet -m 755 /run/puppet
|
10
|
+
ExecStart=/usr/bin/puppet agent
|
11
|
+
|
12
|
+
[Install]
|
13
|
+
WantedBy=multi-user.target
|
@@ -0,0 +1,13 @@
|
|
1
|
+
[Unit]
|
2
|
+
Description=Puppet master
|
3
|
+
Wants=basic.target
|
4
|
+
After=basic.target network.target
|
5
|
+
|
6
|
+
[Service]
|
7
|
+
Type=forking
|
8
|
+
PIDFile=/run/puppet/master.pid
|
9
|
+
ExecStartPre=/usr/bin/install -d -o puppet -m 755 /run/puppet
|
10
|
+
ExecStart=/usr/bin/puppet master
|
11
|
+
|
12
|
+
[Install]
|
13
|
+
WantedBy=multi-user.target
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,90 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'rubygems'
|
3
|
+
require 'fileutils'
|
4
|
+
require 'win32/daemon'
|
5
|
+
require 'win32/dir'
|
6
|
+
require 'win32/process'
|
7
|
+
|
8
|
+
require 'windows/synchronize'
|
9
|
+
require 'windows/handle'
|
10
|
+
|
11
|
+
class WindowsDaemon < Win32::Daemon
|
12
|
+
include Windows::Synchronize
|
13
|
+
include Windows::Handle
|
14
|
+
include Windows::Process
|
15
|
+
|
16
|
+
LOG_FILE = File.expand_path(File.join(Dir::COMMON_APPDATA, 'PuppetLabs', 'puppet', 'var', 'log', 'windows.log'))
|
17
|
+
LEVELS = [:debug, :info, :notice, :err]
|
18
|
+
LEVELS.each do |level|
|
19
|
+
define_method("log_#{level}") do |msg|
|
20
|
+
log(msg, level)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def service_init
|
25
|
+
FileUtils.mkdir_p(File.dirname(LOG_FILE))
|
26
|
+
end
|
27
|
+
|
28
|
+
def service_main(*argv)
|
29
|
+
args = argv.join(' ')
|
30
|
+
@loglevel = LEVELS.index(argv.index('--debug') ? :debug : :notice)
|
31
|
+
|
32
|
+
log_notice("Starting service: #{args}")
|
33
|
+
|
34
|
+
while running? do
|
35
|
+
return if state != RUNNING
|
36
|
+
|
37
|
+
log_notice('Service running')
|
38
|
+
|
39
|
+
basedir = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
40
|
+
puppet = File.join(basedir, 'bin', 'puppet.bat')
|
41
|
+
unless File.exists?(puppet)
|
42
|
+
log_err("File not found: '#{puppet}'")
|
43
|
+
return
|
44
|
+
end
|
45
|
+
|
46
|
+
log_debug("Using '#{puppet}'")
|
47
|
+
begin
|
48
|
+
runinterval = %x{ "#{puppet}" config print runinterval }.to_i
|
49
|
+
if runinterval == 0
|
50
|
+
runinterval = 1800
|
51
|
+
log_err("Failed to determine runinterval, defaulting to #{runinterval} seconds")
|
52
|
+
end
|
53
|
+
rescue Exception => e
|
54
|
+
log_exception(e)
|
55
|
+
runinterval = 1800
|
56
|
+
end
|
57
|
+
|
58
|
+
pid = Process.create(:command_line => "\"#{puppet}\" agent --onetime #{args}").process_id
|
59
|
+
log_debug("Process created: #{pid}")
|
60
|
+
|
61
|
+
log_debug("Service waiting for #{runinterval} seconds")
|
62
|
+
sleep(runinterval)
|
63
|
+
log_debug('Service resuming')
|
64
|
+
end
|
65
|
+
|
66
|
+
log_notice('Service stopped')
|
67
|
+
rescue Exception => e
|
68
|
+
log_exception(e)
|
69
|
+
end
|
70
|
+
|
71
|
+
def service_stop
|
72
|
+
log_notice('Service stopping')
|
73
|
+
Thread.main.wakeup
|
74
|
+
end
|
75
|
+
|
76
|
+
def log_exception(e)
|
77
|
+
log_err(e.message)
|
78
|
+
log_err(e.backtrace.join("\n"))
|
79
|
+
end
|
80
|
+
|
81
|
+
def log(msg, level)
|
82
|
+
if LEVELS.index(level) >= @loglevel
|
83
|
+
File.open(LOG_FILE, 'a') { |f| f.puts("#{Time.now} Puppet (#{level}): #{msg}") }
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
if __FILE__ == $0
|
89
|
+
WindowsDaemon.mainloop
|
90
|
+
end
|
data/install.rb
CHANGED
@@ -63,16 +63,14 @@ def glob(list)
|
|
63
63
|
g = list.map { |i| Dir.glob(i) }
|
64
64
|
g.flatten!
|
65
65
|
g.compact!
|
66
|
-
g.reject! { |e| e =~ /\.svn/ }
|
67
66
|
g
|
68
67
|
end
|
69
68
|
|
70
69
|
# Set these values to what you want installed.
|
71
70
|
configs = glob(%w{conf/auth.conf})
|
72
|
-
sbins = glob(%w{sbin/*})
|
73
71
|
bins = glob(%w{bin/*})
|
74
|
-
rdoc = glob(%w{bin/*
|
75
|
-
ri = glob(%w{bin/*.rb
|
72
|
+
rdoc = glob(%w{bin/* lib/**/*.rb README README-library CHANGELOG TODO Install}).reject { |e| e=~ /\.(bat|cmd)$/ }
|
73
|
+
ri = glob(%w{bin/*.rb lib/**/*.rb}).reject { |e| e=~ /\.(bat|cmd)$/ }
|
76
74
|
man = glob(%w{man/man[0-9]/*})
|
77
75
|
libs = glob(%w{lib/**/*.rb lib/**/*.erb lib/**/*.py lib/puppet/util/command_line/*})
|
78
76
|
tests = glob(%w{test/**/*.rb})
|
@@ -89,7 +87,7 @@ def do_configs(configs, target, strip = 'conf/')
|
|
89
87
|
end
|
90
88
|
|
91
89
|
if $operatingsystem == 'windows'
|
92
|
-
src_dll = '
|
90
|
+
src_dll = 'ext/windows/eventlog/puppetres.dll'
|
93
91
|
dst_dll = File.join(InstallOptions.bin_dir, 'puppetres.dll')
|
94
92
|
if $haveftools
|
95
93
|
File.install(src_dll, dst_dll, 0644, true)
|
@@ -216,16 +214,16 @@ def prepare_installation
|
|
216
214
|
opts.on('--configdir[=OPTIONAL]', 'Installation directory for config files', 'Default /etc/puppet') do |configdir|
|
217
215
|
InstallOptions.configdir = configdir
|
218
216
|
end
|
219
|
-
opts.on('--bindir[=OPTIONAL]', 'Installation directory for binaries', 'overrides
|
217
|
+
opts.on('--bindir[=OPTIONAL]', 'Installation directory for binaries', 'overrides RbConfig::CONFIG["bindir"]') do |bindir|
|
220
218
|
InstallOptions.bindir = bindir
|
221
219
|
end
|
222
|
-
opts.on('--
|
223
|
-
InstallOptions.
|
220
|
+
opts.on('--ruby[=OPTIONAL]', 'Ruby interpreter to use with installation', 'overrides ruby used to call install.rb') do |ruby|
|
221
|
+
InstallOptions.ruby = ruby
|
224
222
|
end
|
225
|
-
opts.on('--sitelibdir[=OPTIONAL]', 'Installation directory for libraries', 'overrides
|
223
|
+
opts.on('--sitelibdir[=OPTIONAL]', 'Installation directory for libraries', 'overrides RbConfig::CONFIG["sitelibdir"]') do |sitelibdir|
|
226
224
|
InstallOptions.sitelibdir = sitelibdir
|
227
225
|
end
|
228
|
-
opts.on('--mandir[=OPTIONAL]', 'Installation directory for man pages', 'overrides
|
226
|
+
opts.on('--mandir[=OPTIONAL]', 'Installation directory for man pages', 'overrides RbConfig::CONFIG["mandir"]') do |mandir|
|
229
227
|
InstallOptions.mandir = mandir
|
230
228
|
end
|
231
229
|
opts.on('--quick', 'Performs a quick installation. Only the', 'installation is done.') do |quick|
|
@@ -249,17 +247,15 @@ def prepare_installation
|
|
249
247
|
opts.parse!
|
250
248
|
end
|
251
249
|
|
252
|
-
version = [
|
253
|
-
libdir = File.join(
|
250
|
+
version = [RbConfig::CONFIG["MAJOR"], RbConfig::CONFIG["MINOR"]].join(".")
|
251
|
+
libdir = File.join(RbConfig::CONFIG["libdir"], "ruby", version)
|
254
252
|
|
255
|
-
# Mac OS X 10.5 and higher declare bindir
|
253
|
+
# Mac OS X 10.5 and higher declare bindir
|
256
254
|
# /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin
|
257
|
-
# /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/sbin
|
258
255
|
# which is not generally where people expect executables to be installed
|
259
256
|
# These settings are appropriate defaults for all OS X versions.
|
260
257
|
if RUBY_PLATFORM =~ /^universal-darwin[\d\.]+$/
|
261
|
-
|
262
|
-
Config::CONFIG['sbindir'] = "/usr/sbin"
|
258
|
+
RbConfig::CONFIG['bindir'] = "/usr/bin"
|
263
259
|
end
|
264
260
|
|
265
261
|
if not InstallOptions.configdir.nil?
|
@@ -279,19 +275,13 @@ def prepare_installation
|
|
279
275
|
if not InstallOptions.bindir.nil?
|
280
276
|
bindir = InstallOptions.bindir
|
281
277
|
else
|
282
|
-
bindir =
|
283
|
-
end
|
284
|
-
|
285
|
-
if not InstallOptions.sbindir.nil?
|
286
|
-
sbindir = InstallOptions.sbindir
|
287
|
-
else
|
288
|
-
sbindir = Config::CONFIG['sbindir']
|
278
|
+
bindir = RbConfig::CONFIG['bindir']
|
289
279
|
end
|
290
280
|
|
291
281
|
if not InstallOptions.sitelibdir.nil?
|
292
282
|
sitelibdir = InstallOptions.sitelibdir
|
293
283
|
else
|
294
|
-
sitelibdir =
|
284
|
+
sitelibdir = RbConfig::CONFIG["sitelibdir"]
|
295
285
|
if sitelibdir.nil?
|
296
286
|
sitelibdir = $LOAD_PATH.find { |x| x =~ /site_ruby/ }
|
297
287
|
if sitelibdir.nil?
|
@@ -305,7 +295,7 @@ def prepare_installation
|
|
305
295
|
if not InstallOptions.mandir.nil?
|
306
296
|
mandir = InstallOptions.mandir
|
307
297
|
else
|
308
|
-
mandir =
|
298
|
+
mandir = RbConfig::CONFIG['mandir']
|
309
299
|
end
|
310
300
|
|
311
301
|
# This is the new way forward
|
@@ -321,20 +311,17 @@ def prepare_installation
|
|
321
311
|
|
322
312
|
configdir = join(destdir, configdir)
|
323
313
|
bindir = join(destdir, bindir)
|
324
|
-
sbindir = join(destdir, sbindir)
|
325
314
|
mandir = join(destdir, mandir)
|
326
315
|
sitelibdir = join(destdir, sitelibdir)
|
327
316
|
|
328
317
|
FileUtils.makedirs(configdir) if InstallOptions.configs
|
329
318
|
FileUtils.makedirs(bindir)
|
330
|
-
FileUtils.makedirs(sbindir)
|
331
319
|
FileUtils.makedirs(mandir)
|
332
320
|
FileUtils.makedirs(sitelibdir)
|
333
321
|
|
334
322
|
InstallOptions.site_dir = sitelibdir
|
335
323
|
InstallOptions.config_dir = configdir
|
336
324
|
InstallOptions.bin_dir = bindir
|
337
|
-
InstallOptions.sbin_dir = sbindir
|
338
325
|
InstallOptions.lib_dir = libdir
|
339
326
|
InstallOptions.man_dir = mandir
|
340
327
|
end
|
@@ -398,17 +385,21 @@ rescue LoadError
|
|
398
385
|
end
|
399
386
|
|
400
387
|
##
|
401
|
-
# Install file(s) from ./bin to
|
388
|
+
# Install file(s) from ./bin to RbConfig::CONFIG['bindir']. Patch it on the way
|
402
389
|
# to insert a #! line; on a Unix install, the command is named as expected
|
403
390
|
# (e.g., bin/rdoc becomes rdoc); the shebang line handles running it. Under
|
404
391
|
# windows, we add an '.rb' extension and let file associations do their stuff.
|
405
392
|
def install_binfile(from, op_file, target)
|
406
393
|
tmp_file = Tempfile.new('puppet-binfile')
|
407
|
-
|
394
|
+
|
395
|
+
if not InstallOptions.ruby.nil?
|
396
|
+
ruby = InstallOptions.ruby
|
397
|
+
else
|
398
|
+
ruby = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
|
399
|
+
end
|
408
400
|
|
409
401
|
File.open(from) do |ip|
|
410
402
|
File.open(tmp_file.path, "w") do |op|
|
411
|
-
ruby = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name'])
|
412
403
|
op.puts "#!#{ruby}"
|
413
404
|
contents = ip.readlines
|
414
405
|
contents.shift if contents[0] =~ /^#!/
|
@@ -456,7 +447,6 @@ prepare_installation
|
|
456
447
|
#build_rdoc(rdoc) if InstallOptions.rdoc
|
457
448
|
#build_ri(ri) if InstallOptions.ri
|
458
449
|
do_configs(configs, InstallOptions.config_dir) if InstallOptions.configs
|
459
|
-
do_bins(sbins, InstallOptions.sbin_dir)
|
460
450
|
do_bins(bins, InstallOptions.bin_dir)
|
461
451
|
do_libs(libs)
|
462
452
|
do_man(man) unless $operatingsystem == "windows"
|
@@ -0,0 +1,102 @@
|
|
1
|
+
class Hiera
|
2
|
+
module Backend
|
3
|
+
class Puppet_backend
|
4
|
+
def initialize
|
5
|
+
Hiera.debug("Hiera Puppet backend starting")
|
6
|
+
end
|
7
|
+
|
8
|
+
def hierarchy(scope, override)
|
9
|
+
begin
|
10
|
+
data_class = Config[:puppet][:datasource] || "data"
|
11
|
+
rescue
|
12
|
+
data_class = "data"
|
13
|
+
end
|
14
|
+
|
15
|
+
calling_class = scope.resource.name.to_s.downcase
|
16
|
+
calling_module = calling_class.split("::").first
|
17
|
+
|
18
|
+
hierarchy = Config[:hierarchy] || [calling_class, calling_module]
|
19
|
+
|
20
|
+
hierarchy = [hierarchy].flatten.map do |klass|
|
21
|
+
klass = Backend.parse_string(klass, scope,
|
22
|
+
{
|
23
|
+
"calling_class" => calling_class,
|
24
|
+
"calling_module" => calling_module
|
25
|
+
}
|
26
|
+
)
|
27
|
+
|
28
|
+
next if klass == ""
|
29
|
+
|
30
|
+
[data_class, klass].join("::")
|
31
|
+
end.compact
|
32
|
+
|
33
|
+
hierarchy << [calling_class, data_class].join("::")
|
34
|
+
|
35
|
+
unless calling_module == calling_class
|
36
|
+
hierarchy << [calling_module, data_class].join("::")
|
37
|
+
end
|
38
|
+
|
39
|
+
hierarchy.insert(0, [data_class, override].join("::")) if override
|
40
|
+
|
41
|
+
hierarchy
|
42
|
+
end
|
43
|
+
|
44
|
+
def lookup(key, scope, order_override, resolution_type)
|
45
|
+
answer = nil
|
46
|
+
|
47
|
+
Hiera.debug("Looking up #{key} in Puppet backend")
|
48
|
+
|
49
|
+
include_class = Puppet::Parser::Functions.function(:include)
|
50
|
+
loaded_classes = scope.catalog.classes
|
51
|
+
|
52
|
+
hierarchy(scope, order_override).each do |klass|
|
53
|
+
Hiera.debug("Looking for data in #{klass}")
|
54
|
+
|
55
|
+
varname = [klass, key].join("::")
|
56
|
+
temp_answer = nil
|
57
|
+
|
58
|
+
unless loaded_classes.include?(klass)
|
59
|
+
begin
|
60
|
+
if scope.respond_to?(:function_include)
|
61
|
+
scope.function_include([klass])
|
62
|
+
else
|
63
|
+
scope.real.function_include([klass])
|
64
|
+
end
|
65
|
+
|
66
|
+
temp_answer = scope[varname]
|
67
|
+
Hiera.debug("Found data in class #{klass}")
|
68
|
+
rescue
|
69
|
+
end
|
70
|
+
else
|
71
|
+
temp_answer = scope[varname]
|
72
|
+
end
|
73
|
+
|
74
|
+
next if temp_answer == :undefined
|
75
|
+
|
76
|
+
if temp_answer
|
77
|
+
# For array resolution we just append to the array whatever we
|
78
|
+
# find, we then go onto the next file and keep adding to the array.
|
79
|
+
#
|
80
|
+
# For priority searches we break after the first found data item.
|
81
|
+
case resolution_type
|
82
|
+
when :array
|
83
|
+
answer ||= []
|
84
|
+
answer << Backend.parse_answer(temp_answer, scope)
|
85
|
+
when :hash
|
86
|
+
answer ||= {}
|
87
|
+
answer = Backend.parse_answer(temp_answer, scope).merge answer
|
88
|
+
else
|
89
|
+
answer = Backend.parse_answer(temp_answer, scope)
|
90
|
+
break
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
|
95
|
+
answer = nil if answer == :undefined
|
96
|
+
|
97
|
+
answer
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
data/lib/hiera/scope.rb
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
class Hiera
|
2
|
+
class Scope
|
3
|
+
attr_reader :real
|
4
|
+
|
5
|
+
def initialize(real)
|
6
|
+
@real = real
|
7
|
+
end
|
8
|
+
|
9
|
+
def [](key)
|
10
|
+
if key == "calling_class"
|
11
|
+
ans = @real.resource.name.to_s.downcase
|
12
|
+
elsif key == "calling_module"
|
13
|
+
ans = @real.resource.name.to_s.downcase.split("::").first
|
14
|
+
else
|
15
|
+
ans = @real.lookupvar(key)
|
16
|
+
end
|
17
|
+
|
18
|
+
# damn you puppet visual basic style variables.
|
19
|
+
return nil if ans == ""
|
20
|
+
return ans
|
21
|
+
end
|
22
|
+
|
23
|
+
def include?(key)
|
24
|
+
return true if ["calling_class", "calling_module"].include?(key)
|
25
|
+
|
26
|
+
return @real.lookupvar(key) != ""
|
27
|
+
end
|
28
|
+
|
29
|
+
def catalog
|
30
|
+
@real.catalog
|
31
|
+
end
|
32
|
+
|
33
|
+
def resource
|
34
|
+
@real.resource
|
35
|
+
end
|
36
|
+
|
37
|
+
def compiler
|
38
|
+
@real.compiler
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|