puppet 0.24.9 → 0.25.0
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/CHANGELOG +18680 -1241
- data/CHANGELOG.old +1705 -0
- data/LICENSE +2 -2
- data/README +1 -1
- data/README.queueing +126 -0
- data/README.rst +4 -4
- data/Rakefile +62 -216
- data/bin/filebucket +6 -117
- data/bin/pi +50 -0
- data/bin/puppet +7 -188
- data/bin/puppetdoc +7 -198
- data/bin/ralsh +4 -191
- data/conf/auth.conf +94 -0
- data/conf/gentoo/init.d/puppetmaster +30 -30
- data/conf/osx/PackageInfo.plist +30 -30
- data/conf/osx/createpackage.sh +23 -18
- data/conf/osx/preflight +8 -0
- data/conf/puppet-queue.conf +10 -0
- data/conf/redhat/client.init +52 -41
- data/conf/redhat/logrotate +1 -0
- data/conf/redhat/puppet.spec +74 -36
- data/conf/redhat/rundir-perms.patch +28 -0
- data/conf/redhat/server.init +48 -43
- data/conf/redhat/server.sysconfig +4 -4
- data/conf/solaris/smf/puppetd.xml +53 -53
- data/conf/solaris/smf/puppetmasterd.xml +53 -53
- data/conf/solaris/smf/svc-puppetd +4 -4
- data/conf/solaris/smf/svc-puppetmasterd +3 -3
- data/conf/suse/client.init +4 -4
- data/conf/suse/puppet.spec +14 -14
- data/conf/suse/server.init +17 -17
- data/examples/etc/init.d/sleeper +8 -8
- data/examples/mac_dscl.pp +2 -2
- data/examples/mac_dscl_revert.pp +1 -1
- data/examples/mcx_dock_default.pp +108 -108
- data/examples/mcx_dock_full.pp +108 -108
- data/examples/mcx_nogroup.pp +108 -108
- data/examples/modules/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb +5 -5
- data/examples/modules/sample-module/manifests/init.pp +2 -2
- data/examples/relationships +1 -1
- data/ext/autotest/config +6 -6
- data/ext/bin/sleeper +12 -12
- data/ext/dbfix.sql +21 -21
- data/ext/emacs/puppet-mode.el +42 -41
- data/ext/extlookup.rb +183 -0
- data/ext/ldap/puppet.schema +2 -1
- data/ext/logcheck/puppet +1 -1
- data/ext/module_puppet +7 -7
- data/ext/nagios/check_puppet.rb +83 -83
- data/ext/nagios/naggen +302 -0
- data/ext/puppet-test +61 -18
- data/ext/puppetlisten/puppetlisten.rb +76 -0
- data/ext/puppetlisten/puppetrun.rb +39 -0
- data/ext/puppetstoredconfigclean.rb +29 -29
- data/ext/rack/README +73 -0
- data/ext/rack/files/apache2.conf +38 -0
- data/ext/rack/files/config.ru +18 -0
- data/ext/rack/manifest.pp +59 -0
- data/ext/vim/syntax/puppet.vim +54 -35
- data/install.rb +37 -26
- data/lib/puppet.rb +15 -227
- data/lib/puppet/agent.rb +134 -0
- data/lib/puppet/agent/locker.rb +42 -0
- data/lib/puppet/agent/runner.rb +65 -0
- data/lib/puppet/application.rb +313 -0
- data/lib/puppet/application/filebucket.rb +87 -0
- data/lib/puppet/application/pi.rb +214 -0
- data/lib/puppet/application/puppet.rb +177 -0
- data/lib/puppet/application/puppetca.rb +71 -0
- data/lib/puppet/application/puppetd.rb +256 -0
- data/lib/puppet/application/puppetdoc.rb +222 -0
- data/lib/puppet/application/puppetmasterd.rb +168 -0
- data/lib/puppet/application/puppetqd.rb +96 -0
- data/lib/puppet/application/puppetrun.rb +219 -0
- data/lib/puppet/application/ralsh.rb +168 -0
- data/lib/puppet/configurer.rb +177 -0
- data/lib/puppet/configurer/downloader.rb +79 -0
- data/lib/puppet/configurer/fact_handler.rb +68 -0
- data/lib/puppet/configurer/plugin_handler.rb +26 -0
- data/lib/puppet/daemon.rb +78 -28
- data/lib/puppet/defaults.rb +239 -166
- data/lib/puppet/dsl.rb +7 -7
- data/lib/puppet/external/dot.rb +271 -271
- data/lib/puppet/external/event-loop/better-definers.rb +298 -298
- data/lib/puppet/external/event-loop/event-loop.rb +274 -274
- data/lib/puppet/external/event-loop/signal-system.rb +163 -163
- data/lib/puppet/external/lock.rb +1 -1
- data/lib/puppet/external/nagios.rb +20 -20
- data/lib/puppet/external/nagios/base.rb +3 -3
- data/lib/puppet/external/nagios/grammar.ry +185 -0
- data/lib/puppet/external/nagios/makefile +9 -0
- data/lib/puppet/external/nagios/parser.rb +1 -1
- data/lib/puppet/feature/json.rb +2 -0
- data/lib/puppet/feature/rack.rb +24 -0
- data/lib/puppet/feature/rails.rb +23 -33
- data/lib/puppet/feature/rubygems.rb +6 -0
- data/lib/puppet/feature/stomp.rb +6 -0
- data/lib/puppet/file_serving/{file_base.rb → base.rb} +10 -9
- data/lib/puppet/file_serving/configuration.rb +61 -61
- data/lib/puppet/file_serving/configuration/parser.rb +24 -29
- data/lib/puppet/file_serving/content.rb +26 -11
- data/lib/puppet/file_serving/fileset.rb +54 -19
- data/lib/puppet/file_serving/indirection_hooks.rb +12 -24
- data/lib/puppet/file_serving/metadata.rb +8 -8
- data/lib/puppet/file_serving/mount.rb +9 -151
- data/lib/puppet/file_serving/mount/file.rb +126 -0
- data/lib/puppet/file_serving/mount/modules.rb +25 -0
- data/lib/puppet/file_serving/mount/plugins.rb +27 -0
- data/lib/puppet/file_serving/terminus_helper.rb +9 -4
- data/lib/puppet/indirector.rb +6 -4
- data/lib/puppet/indirector/active_record.rb +28 -0
- data/lib/puppet/indirector/catalog/active_record.rb +36 -0
- data/lib/puppet/indirector/catalog/compiler.rb +50 -24
- data/lib/puppet/indirector/catalog/queue.rb +5 -0
- data/lib/puppet/indirector/catalog/rest.rb +6 -0
- data/lib/puppet/indirector/catalog/yaml.rb +2 -4
- data/lib/puppet/indirector/certificate/ca.rb +9 -0
- data/lib/puppet/indirector/certificate/file.rb +9 -0
- data/lib/puppet/indirector/certificate/rest.rb +9 -0
- data/lib/puppet/indirector/certificate_request/ca.rb +14 -0
- data/lib/puppet/indirector/certificate_request/file.rb +8 -0
- data/lib/puppet/indirector/certificate_request/rest.rb +9 -0
- data/lib/puppet/indirector/certificate_revocation_list/ca.rb +8 -0
- data/lib/puppet/indirector/certificate_revocation_list/file.rb +8 -0
- data/lib/puppet/indirector/certificate_revocation_list/rest.rb +9 -0
- data/lib/puppet/indirector/direct_file_server.rb +4 -8
- data/lib/puppet/indirector/exec.rb +2 -6
- data/lib/puppet/indirector/facts/active_record.rb +36 -0
- data/lib/puppet/indirector/facts/facter.rb +30 -22
- data/lib/puppet/indirector/facts/rest.rb +6 -0
- data/lib/puppet/indirector/file.rb +1 -0
- data/lib/puppet/indirector/file_content/rest.rb +0 -1
- data/lib/puppet/indirector/file_metadata/file.rb +2 -2
- data/lib/puppet/indirector/file_metadata/rest.rb +0 -1
- data/lib/puppet/indirector/file_server.rb +31 -18
- data/lib/puppet/indirector/indirection.rb +46 -33
- data/lib/puppet/indirector/key/ca.rb +12 -0
- data/lib/puppet/indirector/key/file.rb +42 -0
- data/lib/puppet/indirector/node/active_record.rb +13 -0
- data/lib/puppet/indirector/node/ldap.rb +1 -1
- data/lib/puppet/indirector/queue.rb +83 -0
- data/lib/puppet/indirector/report/processor.rb +1 -1
- data/lib/puppet/indirector/report/rest.rb +7 -0
- data/lib/puppet/indirector/request.rb +158 -15
- data/lib/puppet/indirector/rest.rb +74 -36
- data/lib/puppet/indirector/runner/rest.rb +7 -0
- data/lib/puppet/indirector/ssl_file.rb +174 -0
- data/lib/puppet/indirector/terminus.rb +4 -4
- data/lib/puppet/indirector/yaml.rb +1 -1
- data/lib/puppet/metatype/manager.rb +3 -3
- data/lib/puppet/module.rb +99 -124
- data/lib/puppet/network/authconfig.rb +57 -42
- data/lib/puppet/network/authstore.rb +58 -10
- data/lib/puppet/network/client.rb +0 -2
- data/lib/puppet/network/client/ca.rb +1 -1
- data/lib/puppet/network/client/dipper.rb +7 -2
- data/lib/puppet/network/format.rb +123 -0
- data/lib/puppet/network/format_handler.rb +156 -0
- data/lib/puppet/network/formats.rb +123 -0
- data/lib/puppet/network/handler/filebucket.rb +1 -1
- data/lib/puppet/network/handler/fileserver.rb +43 -35
- data/lib/puppet/network/handler/master.rb +4 -4
- data/lib/puppet/network/handler/report.rb +1 -1
- data/lib/puppet/network/handler/resource.rb +16 -20
- data/lib/puppet/network/handler/runner.rb +9 -42
- data/lib/puppet/network/http.rb +4 -4
- data/lib/puppet/network/http/api.rb +4 -0
- data/lib/puppet/network/http/api/v1.rb +65 -0
- data/lib/puppet/network/http/handler.rb +163 -56
- data/lib/puppet/network/http/mongrel.rb +19 -15
- data/lib/puppet/network/http/mongrel/rest.rb +35 -17
- data/lib/puppet/network/http/rack.rb +62 -0
- data/lib/puppet/network/http/rack/httphandler.rb +34 -0
- data/lib/puppet/network/http/rack/rest.rb +79 -0
- data/lib/puppet/network/http/rack/xmlrpc.rb +65 -0
- data/lib/puppet/network/http/webrick.rb +89 -16
- data/lib/puppet/network/http/webrick/rest.rb +24 -11
- data/lib/puppet/network/http_pool.rb +28 -29
- data/lib/puppet/network/http_server/mongrel.rb +8 -10
- data/lib/puppet/network/http_server/webrick.rb +1 -3
- data/lib/puppet/network/rest_authconfig.rb +89 -0
- data/lib/puppet/network/rest_authorization.rb +25 -0
- data/lib/puppet/network/rights.rb +230 -27
- data/lib/puppet/network/server.rb +133 -31
- data/lib/puppet/network/xmlrpc/client.rb +5 -5
- data/lib/puppet/network/xmlrpc/webrick_servlet.rb +6 -6
- data/lib/puppet/node.rb +28 -21
- data/lib/puppet/node/environment.rb +48 -0
- data/lib/puppet/node/facts.rb +21 -0
- data/lib/puppet/parameter.rb +291 -219
- data/lib/puppet/parser/ast.rb +1 -0
- data/lib/puppet/parser/ast/astarray.rb +5 -1
- data/lib/puppet/parser/ast/boolean_operator.rb +3 -3
- data/lib/puppet/parser/ast/caseopt.rb +10 -0
- data/lib/puppet/parser/ast/casestatement.rb +12 -27
- data/lib/puppet/parser/ast/collection.rb +31 -0
- data/lib/puppet/parser/ast/collexpr.rb +18 -11
- data/lib/puppet/parser/ast/comparison_operator.rb +1 -1
- data/lib/puppet/parser/ast/definition.rb +6 -2
- data/lib/puppet/parser/ast/function.rb +7 -2
- data/lib/puppet/parser/ast/ifstatement.rb +11 -6
- data/lib/puppet/parser/ast/leaf.rb +106 -3
- data/lib/puppet/parser/ast/match_operator.rb +31 -0
- data/lib/puppet/parser/ast/node.rb +10 -6
- data/lib/puppet/parser/ast/resource_defaults.rb +2 -2
- data/lib/puppet/parser/ast/resource_override.rb +1 -1
- data/lib/puppet/parser/ast/resource_reference.rb +11 -3
- data/lib/puppet/parser/ast/selector.rb +14 -32
- data/lib/puppet/parser/ast/vardef.rb +1 -1
- data/lib/puppet/parser/collector.rb +67 -15
- data/lib/puppet/parser/compiler.rb +21 -53
- data/lib/puppet/parser/files.rb +92 -0
- data/lib/puppet/parser/functions.rb +3 -3
- data/lib/puppet/parser/functions/defined.rb +3 -3
- data/lib/puppet/parser/functions/fqdn_rand.rb +3 -3
- data/lib/puppet/parser/functions/inline_template.rb +4 -4
- data/lib/puppet/parser/functions/regsubst.rb +37 -35
- data/lib/puppet/parser/functions/require.rb +34 -0
- data/lib/puppet/parser/functions/shellquote.rb +41 -0
- data/lib/puppet/parser/functions/split.rb +29 -0
- data/lib/puppet/parser/functions/sprintf.rb +6 -6
- data/lib/puppet/parser/functions/template.rb +4 -4
- data/lib/puppet/parser/functions/versioncmp.rb +22 -1
- data/lib/puppet/parser/grammar.ra +812 -0
- data/lib/puppet/parser/interpreter.rb +4 -4
- data/lib/puppet/parser/lexer.rb +44 -15
- data/lib/puppet/parser/loaded_code.rb +115 -0
- data/lib/puppet/parser/makefile +8 -0
- data/lib/puppet/parser/parser.rb +1080 -928
- data/lib/puppet/parser/parser_support.rb +118 -96
- data/lib/puppet/parser/resource.rb +56 -126
- data/lib/puppet/parser/resource/param.rb +2 -76
- data/lib/puppet/parser/resource/reference.rb +15 -8
- data/lib/puppet/parser/scope.rb +68 -35
- data/lib/puppet/parser/templatewrapper.rb +8 -8
- data/lib/puppet/parser/yaml_trimmer.rb +11 -0
- data/lib/puppet/property.rb +69 -124
- data/lib/puppet/property/list.rb +3 -3
- data/lib/puppet/provider.rb +5 -5
- data/lib/puppet/provider/augeas/augeas.rb +119 -118
- data/lib/puppet/provider/computer/computer.rb +3 -3
- data/lib/puppet/provider/confine/variable.rb +1 -1
- data/lib/puppet/provider/cron/crontab.rb +8 -7
- data/lib/puppet/provider/group/directoryservice.rb +2 -2
- data/lib/puppet/provider/group/groupadd.rb +1 -1
- data/lib/puppet/provider/group/ldap.rb +3 -3
- data/lib/puppet/provider/group/pw.rb +1 -1
- data/lib/puppet/provider/host/parsed.rb +3 -3
- data/lib/puppet/provider/ldap.rb +1 -3
- data/lib/puppet/provider/macauthorization/macauthorization.rb +62 -55
- data/lib/puppet/provider/mailalias/aliases.rb +9 -1
- data/lib/puppet/provider/maillist/mailman.rb +8 -4
- data/lib/puppet/provider/mcx/mcxcontent.rb +11 -11
- data/lib/puppet/provider/mount/parsed.rb +2 -2
- data/lib/puppet/provider/nameservice.rb +6 -6
- data/lib/puppet/provider/nameservice/directoryservice.rb +83 -87
- data/lib/puppet/provider/package/appdmg.rb +10 -9
- data/lib/puppet/provider/package/apple.rb +1 -3
- data/lib/puppet/provider/package/apt.rb +5 -5
- data/lib/puppet/provider/package/aptitude.rb +1 -1
- data/lib/puppet/provider/package/aptrpm.rb +1 -1
- data/lib/puppet/provider/package/darwinport.rb +1 -1
- data/lib/puppet/provider/package/dpkg.rb +2 -2
- data/lib/puppet/provider/package/fink.rb +6 -6
- data/lib/puppet/provider/package/freebsd.rb +1 -1
- data/lib/puppet/provider/package/gem.rb +2 -2
- data/lib/puppet/provider/package/hpux.rb +5 -5
- data/lib/puppet/provider/package/pkgdmg.rb +30 -22
- data/lib/puppet/provider/package/portage.rb +1 -1
- data/lib/puppet/provider/package/ports.rb +1 -1
- data/lib/puppet/provider/package/rpm.rb +5 -5
- data/lib/puppet/provider/package/rug.rb +1 -1
- data/lib/puppet/provider/package/sun.rb +7 -7
- data/lib/puppet/provider/package/up2date.rb +1 -1
- data/lib/puppet/provider/package/yum.rb +2 -2
- data/lib/puppet/provider/package/yumhelper.py +2 -2
- data/lib/puppet/provider/port/parsed.rb +1 -1
- data/lib/puppet/provider/selmodule/semodule.rb +3 -3
- data/lib/puppet/provider/service/base.rb +21 -12
- data/lib/puppet/provider/service/daemontools.rb +86 -49
- data/lib/puppet/provider/service/debian.rb +20 -12
- data/lib/puppet/provider/service/freebsd.rb +5 -5
- data/lib/puppet/provider/service/gentoo.rb +2 -2
- data/lib/puppet/provider/service/init.rb +21 -33
- data/lib/puppet/provider/service/launchd.rb +120 -48
- data/lib/puppet/provider/service/redhat.rb +12 -21
- data/lib/puppet/provider/service/runit.rb +19 -9
- data/lib/puppet/provider/service/smf.rb +49 -34
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +34 -0
- data/lib/puppet/provider/sshkey/parsed.rb +2 -2
- data/lib/puppet/provider/user/directoryservice.rb +12 -29
- data/lib/puppet/provider/user/hpux.rb +3 -3
- data/lib/puppet/provider/user/ldap.rb +2 -2
- data/lib/puppet/provider/zfs/solaris.rb +1 -1
- data/lib/puppet/provider/zone/solaris.rb +4 -4
- data/lib/puppet/provider/zpool/solaris.rb +3 -3
- data/lib/puppet/rails.rb +9 -9
- data/lib/puppet/rails/benchmark.rb +69 -0
- data/lib/puppet/rails/database/001_add_created_at_to_all_tables.rb +5 -5
- data/lib/puppet/rails/database/002_remove_duplicated_index_on_all_tables.rb +2 -2
- data/lib/puppet/rails/database/003_add_environment_to_host.rb +1 -1
- data/lib/puppet/rails/database/schema.rb +8 -8
- data/lib/puppet/rails/fact_value.rb +1 -1
- data/lib/puppet/rails/host.rb +211 -93
- data/lib/puppet/rails/param_name.rb +5 -1
- data/lib/puppet/rails/param_value.rb +29 -2
- data/lib/puppet/rails/puppet_tag.rb +5 -0
- data/lib/puppet/rails/resource.rb +120 -20
- data/lib/puppet/rails/resource_tag.rb +1 -1
- data/lib/puppet/rails/source_file.rb +1 -1
- data/lib/puppet/reference/configuration.rb +14 -14
- data/lib/puppet/reference/function.rb +1 -1
- data/lib/puppet/reference/metaparameter.rb +48 -0
- data/lib/puppet/reference/providers.rb +6 -6
- data/lib/puppet/reference/type.rb +1 -37
- data/lib/puppet/relationship.rb +57 -30
- data/lib/puppet/reports/rrdgraph.rb +4 -4
- data/lib/puppet/reports/store.rb +3 -3
- data/lib/puppet/reports/tagmail.rb +15 -15
- data/lib/puppet/resource.rb +265 -0
- data/lib/puppet/{node → resource}/catalog.rb +188 -112
- data/lib/puppet/{resource_reference.rb → resource/reference.rb} +46 -24
- data/lib/puppet/simple_graph.rb +165 -27
- data/lib/puppet/ssl.rb +7 -0
- data/lib/puppet/ssl/base.rb +62 -0
- data/lib/puppet/ssl/certificate.rb +34 -0
- data/lib/puppet/ssl/certificate_authority.rb +298 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +118 -0
- data/lib/puppet/ssl/certificate_factory.rb +145 -0
- data/lib/puppet/ssl/certificate_request.rb +51 -0
- data/lib/puppet/ssl/certificate_revocation_list.rb +86 -0
- data/lib/puppet/ssl/host.rb +271 -0
- data/lib/puppet/ssl/inventory.rb +52 -0
- data/lib/puppet/ssl/key.rb +56 -0
- data/lib/puppet/sslcertificates.rb +6 -6
- data/lib/puppet/sslcertificates/ca.rb +15 -15
- data/lib/puppet/sslcertificates/certificate.rb +4 -4
- data/lib/puppet/sslcertificates/inventory.rb +3 -3
- data/lib/puppet/transaction.rb +113 -139
- data/lib/puppet/transaction/change.rb +6 -6
- data/lib/puppet/transaction/event.rb +1 -1
- data/lib/puppet/transaction/report.rb +7 -1
- data/lib/puppet/transportable.rb +28 -28
- data/lib/puppet/type.rb +263 -688
- data/lib/puppet/type/augeas.rb +3 -2
- data/lib/puppet/type/component.rb +28 -95
- data/lib/puppet/type/computer.rb +10 -10
- data/lib/puppet/type/cron.rb +19 -14
- data/lib/puppet/type/exec.rb +21 -20
- data/lib/puppet/type/file.rb +306 -633
- data/lib/puppet/type/file/checksum.rb +10 -11
- data/lib/puppet/type/file/content.rb +83 -22
- data/lib/puppet/type/file/ensure.rb +15 -9
- data/lib/puppet/type/file/group.rb +7 -1
- data/lib/puppet/type/file/mode.rb +1 -1
- data/lib/puppet/type/file/owner.rb +9 -3
- data/lib/puppet/type/file/selcontext.rb +4 -4
- data/lib/puppet/type/file/source.rb +78 -179
- data/lib/puppet/type/file/target.rb +3 -3
- data/lib/puppet/type/file/type.rb +2 -2
- data/lib/puppet/type/filebucket.rb +33 -54
- data/lib/puppet/type/group.rb +8 -8
- data/lib/puppet/type/host.rb +7 -7
- data/lib/puppet/type/k5login.rb +2 -2
- data/lib/puppet/type/macauthorization.rb +77 -52
- data/lib/puppet/type/mailalias.rb +2 -2
- data/lib/puppet/type/maillist.rb +2 -2
- data/lib/puppet/type/mcx.rb +3 -3
- data/lib/puppet/type/mount.rb +16 -11
- data/lib/puppet/type/notify.rb +4 -4
- data/lib/puppet/type/package.rb +6 -28
- data/lib/puppet/type/port.rb +1 -1
- data/lib/puppet/type/resources.rb +19 -19
- data/lib/puppet/type/schedule.rb +18 -20
- data/lib/puppet/type/selmodule.rb +1 -1
- data/lib/puppet/type/service.rb +11 -7
- data/lib/puppet/type/ssh_authorized_key.rb +26 -9
- data/lib/puppet/type/sshkey.rb +2 -2
- data/lib/puppet/type/tidy.rb +285 -289
- data/lib/puppet/type/user.rb +9 -7
- data/lib/puppet/type/yumrepo.rb +17 -16
- data/lib/puppet/type/zone.rb +8 -7
- data/lib/puppet/util.rb +11 -36
- data/lib/puppet/util/autoload.rb +31 -19
- data/lib/puppet/util/autoload/file_cache.rb +115 -0
- data/lib/puppet/util/backups.rb +86 -0
- data/lib/puppet/util/cacher.rb +135 -0
- data/lib/puppet/util/checksums.rb +11 -1
- data/lib/puppet/util/classgen.rb +1 -1
- data/lib/puppet/util/config_store.rb +2 -2
- data/lib/puppet/util/constant_inflector.rb +1 -1
- data/lib/puppet/util/diff.rb +2 -2
- data/lib/puppet/util/docs.rb +9 -3
- data/lib/puppet/util/execution.rb +1 -1
- data/lib/puppet/util/feature.rb +27 -20
- data/lib/puppet/util/fileparsing.rb +3 -3
- data/lib/puppet/util/filetype.rb +8 -6
- data/lib/puppet/util/graph.rb +5 -5
- data/lib/puppet/util/inifile.rb +5 -5
- data/lib/puppet/util/json.rb +13 -0
- data/lib/puppet/util/ldap/connection.rb +2 -2
- data/lib/puppet/util/log.rb +48 -31
- data/lib/puppet/util/metric.rb +4 -4
- data/lib/puppet/util/monkey_patches.rb +43 -0
- data/lib/puppet/util/nagios_maker.rb +1 -1
- data/lib/puppet/util/package.rb +4 -4
- data/lib/puppet/util/pidlock.rb +59 -59
- data/lib/puppet/util/posix.rb +13 -52
- data/lib/puppet/util/provider_features.rb +3 -3
- data/lib/puppet/util/queue.rb +96 -0
- data/lib/puppet/util/queue/stomp.rb +47 -0
- data/lib/puppet/util/rails/cache_accumulator.rb +65 -0
- data/lib/puppet/util/rails/collection_merger.rb +0 -39
- data/lib/puppet/util/rails/reference_serializer.rb +17 -3
- data/lib/puppet/util/rdoc.rb +1 -0
- data/lib/puppet/util/rdoc/code_objects.rb +5 -1
- data/lib/puppet/util/rdoc/generators/puppet_generator.rb +5 -5
- data/lib/puppet/util/rdoc/generators/template/puppet/puppet.rb +13 -13
- data/lib/puppet/util/rdoc/parser.rb +28 -32
- data/lib/puppet/util/reference.rb +29 -8
- data/lib/puppet/util/resource_template.rb +1 -1
- data/lib/puppet/util/selinux.rb +12 -6
- data/lib/puppet/util/settings.rb +203 -578
- data/lib/puppet/util/settings/boolean_setting.rb +33 -0
- data/lib/puppet/util/settings/file_setting.rb +119 -0
- data/lib/puppet/util/settings/setting.rb +110 -0
- data/lib/puppet/util/subclass_loader.rb +1 -1
- data/lib/puppet/util/suidmanager.rb +2 -2
- data/lib/puppet/util/tagging.rb +1 -1
- data/lib/puppet/util/warnings.rb +17 -9
- data/man/man8/filebucket.8 +2 -2
- data/man/man8/pi.8 +2 -2
- data/man/man8/puppet.8 +3 -4
- data/man/man8/puppet.conf.8 +63 -63
- data/man/man8/puppetca.8 +2 -2
- data/man/man8/puppetd.8 +2 -2
- data/man/man8/puppetdoc.8 +2 -2
- data/man/man8/puppetmasterd.8 +2 -2
- data/man/man8/puppetrun.8 +2 -2
- data/man/man8/ralsh.8 +3 -3
- data/sbin/puppetca +102 -0
- data/sbin/puppetd +159 -0
- data/sbin/puppetmasterd +66 -0
- data/sbin/puppetqd +53 -0
- data/sbin/puppetrun +130 -0
- data/spec/Rakefile +2 -2
- data/spec/integration/application/puppet.rb +33 -0
- data/spec/integration/bin/puppetmasterd.rb +110 -0
- data/spec/integration/configurer.rb +18 -0
- data/spec/integration/defaults.rb +158 -7
- data/spec/integration/file_serving/content.rb +2 -0
- data/spec/integration/file_serving/fileset.rb +14 -0
- data/spec/integration/file_serving/metadata.rb +2 -0
- data/spec/integration/file_serving/terminus_helper.rb +22 -0
- data/spec/integration/indirector/catalog/compiler.rb +67 -0
- data/spec/integration/indirector/catalog/queue.rb +61 -0
- data/spec/integration/indirector/certificate/rest.rb +69 -0
- data/spec/integration/indirector/certificate_request/rest.rb +89 -0
- data/spec/integration/indirector/certificate_revocation_list/rest.rb +77 -0
- data/spec/integration/indirector/direct_file_server.rb +16 -23
- data/spec/integration/indirector/file_content/file_server.rb +75 -0
- data/spec/integration/indirector/report/rest.rb +95 -0
- data/spec/integration/indirector/rest.rb +207 -147
- data/spec/integration/network/client.rb +19 -0
- data/spec/integration/network/formats.rb +110 -0
- data/spec/integration/network/handler.rb +25 -0
- data/spec/integration/network/server/mongrel.rb +26 -8
- data/spec/integration/network/server/webrick.rb +49 -11
- data/spec/integration/node/environment.rb +58 -0
- data/spec/integration/node/facts.rb +4 -2
- data/spec/integration/parser/compiler.rb +29 -0
- data/spec/integration/parser/functions/require.rb +67 -0
- data/spec/integration/provider/mailalias/aliases.rb +25 -0
- data/spec/integration/{node → resource}/catalog.rb +17 -10
- data/spec/integration/ssl/certificate_authority.rb +135 -0
- data/spec/integration/ssl/certificate_request.rb +59 -0
- data/spec/integration/ssl/certificate_revocation_list.rb +42 -0
- data/spec/integration/ssl/host.rb +90 -0
- data/spec/integration/transaction.rb +66 -0
- data/spec/integration/transaction/report.rb +2 -5
- data/spec/integration/type.rb +22 -0
- data/spec/integration/type/file.rb +458 -0
- data/spec/integration/type/package.rb +1 -1
- data/spec/integration/type/tidy.rb +27 -0
- data/spec/integration/util/autoload.rb +114 -0
- data/spec/integration/util/feature.rb +54 -0
- data/spec/integration/util/file_locking.rb +2 -1
- data/spec/integration/util/settings.rb +27 -0
- data/spec/lib/puppet_spec/files.rb +9 -0
- data/spec/monkey_patches/add_confine_and_runnable_to_rspec_dsl.rb +1 -0
- data/spec/monkey_patches/alias_should_to_must.rb +1 -0
- data/spec/shared_behaviours/file_server_terminus.rb +14 -11
- data/spec/shared_behaviours/file_serving.rb +13 -17
- data/spec/spec_helper.rb +22 -5
- data/spec/unit/agent.rb +259 -0
- data/spec/unit/agent/locker.rb +100 -0
- data/spec/unit/agent/runner.rb +118 -0
- data/spec/unit/application.rb +420 -0
- data/spec/unit/application/filebucket.rb +220 -0
- data/spec/unit/application/pi.rb +84 -0
- data/spec/unit/application/puppet.rb +404 -0
- data/spec/unit/application/puppetca.rb +142 -0
- data/spec/unit/application/puppetd.rb +502 -0
- data/spec/unit/application/puppetdoc.rb +345 -0
- data/spec/unit/application/puppetmasterd.rb +456 -0
- data/spec/unit/application/puppetqd.rb +186 -0
- data/spec/unit/application/puppetrun.rb +279 -0
- data/spec/unit/application/ralsh.rb +237 -0
- data/spec/unit/configurer.rb +232 -0
- data/spec/unit/configurer/downloader.rb +188 -0
- data/spec/unit/configurer/fact_handler.rb +150 -0
- data/spec/unit/configurer/plugin_handler.rb +112 -0
- data/spec/unit/daemon.rb +287 -0
- data/spec/unit/file_serving/{file_base.rb → base.rb} +39 -31
- data/spec/unit/file_serving/configuration.rb +104 -93
- data/spec/unit/file_serving/configuration/parser.rb +64 -18
- data/spec/unit/file_serving/content.rb +65 -26
- data/spec/unit/file_serving/fileset.rb +116 -14
- data/spec/unit/file_serving/indirection_hooks.rb +34 -95
- data/spec/unit/file_serving/metadata.rb +27 -40
- data/spec/unit/file_serving/mount.rb +7 -118
- data/spec/unit/file_serving/mount/file.rb +188 -0
- data/spec/unit/file_serving/mount/modules.rb +63 -0
- data/spec/unit/file_serving/mount/plugins.rb +61 -0
- data/spec/unit/file_serving/terminus_helper.rb +39 -27
- data/spec/unit/indirector.rb +6 -1
- data/spec/unit/indirector/active_record.rb +76 -0
- data/spec/unit/indirector/catalog/active_record.rb +122 -0
- data/spec/unit/indirector/catalog/compiler.rb +222 -118
- data/spec/unit/indirector/catalog/queue.rb +20 -0
- data/spec/unit/indirector/catalog/rest.rb +11 -0
- data/spec/unit/indirector/catalog/yaml.rb +6 -6
- data/spec/unit/indirector/certificate/ca.rb +28 -0
- data/spec/unit/indirector/certificate/file.rb +28 -0
- data/spec/unit/indirector/certificate/rest.rb +23 -0
- data/spec/unit/indirector/certificate_request/ca.rb +19 -0
- data/spec/unit/indirector/certificate_request/file.rb +19 -0
- data/spec/unit/indirector/certificate_request/rest.rb +23 -0
- data/spec/unit/indirector/certificate_revocation_list/ca.rb +21 -0
- data/spec/unit/indirector/certificate_revocation_list/file.rb +20 -0
- data/spec/unit/indirector/certificate_revocation_list/rest.rb +23 -0
- data/spec/unit/indirector/direct_file_server.rb +3 -8
- data/spec/unit/indirector/exec.rb +6 -1
- data/spec/unit/indirector/facts/active_record.rb +104 -0
- data/spec/unit/indirector/facts/facter.rb +53 -12
- data/spec/unit/indirector/facts/rest.rb +11 -0
- data/spec/unit/indirector/file.rb +8 -1
- data/spec/unit/indirector/file_metadata/file.rb +5 -5
- data/spec/unit/indirector/file_server.rb +181 -98
- data/spec/unit/indirector/indirection.rb +102 -38
- data/spec/unit/indirector/key/ca.rb +28 -0
- data/spec/unit/indirector/key/file.rb +104 -0
- data/spec/unit/indirector/node/active_record.rb +34 -0
- data/spec/unit/indirector/node/ldap.rb +1 -1
- data/spec/unit/indirector/node/rest.rb +2 -2
- data/spec/unit/indirector/queue.rb +123 -0
- data/spec/unit/indirector/report/rest.rb +28 -0
- data/spec/unit/indirector/request.rb +221 -0
- data/spec/unit/indirector/rest.rb +343 -334
- data/spec/unit/indirector/runner/rest.rb +11 -0
- data/spec/unit/indirector/ssl_file.rb +280 -0
- data/spec/unit/module.rb +180 -180
- data/spec/unit/network/authconfig.rb +292 -0
- data/spec/unit/network/authstore.rb +94 -0
- data/spec/unit/network/client.rb +2 -2
- data/spec/unit/network/client/dipper.rb +16 -0
- data/spec/unit/network/format.rb +191 -0
- data/spec/unit/network/format_handler.rb +306 -0
- data/spec/unit/network/formats.rb +249 -0
- data/spec/unit/network/handler/fileserver.rb +2 -5
- data/spec/unit/network/http.rb +3 -3
- data/spec/unit/network/http/api/v1.rb +122 -0
- data/spec/unit/network/http/handler.rb +448 -0
- data/spec/unit/network/http/mongrel.rb +46 -32
- data/spec/unit/network/http/mongrel/rest.rb +174 -319
- data/spec/unit/network/http/rack.rb +102 -0
- data/spec/unit/network/http/rack/rest.rb +199 -0
- data/spec/unit/network/http/rack/xmlrpc.rb +157 -0
- data/spec/unit/network/http/webrick.rb +249 -37
- data/spec/unit/network/http/webrick/rest.rb +113 -279
- data/spec/unit/network/http_pool.rb +86 -110
- data/spec/unit/network/rest_authconfig.rb +146 -0
- data/spec/unit/network/rest_authorization.rb +43 -0
- data/spec/unit/network/rights.rb +519 -0
- data/spec/unit/network/server.rb +475 -257
- data/spec/unit/node.rb +43 -10
- data/spec/unit/node/environment.rb +143 -9
- data/spec/unit/node/facts.rb +77 -24
- data/spec/unit/other/selinux.rb +85 -0
- data/spec/unit/other/transbucket.rb +29 -13
- data/spec/unit/other/transobject.rb +35 -15
- data/spec/unit/parameter.rb +378 -5
- data/spec/unit/parser/ast.rb +1 -1
- data/spec/unit/parser/ast/arithmetic_operator.rb +17 -17
- data/spec/unit/parser/ast/astarray.rb +16 -10
- data/spec/unit/parser/ast/boolean_operator.rb +2 -2
- data/spec/unit/parser/ast/casestatement.rb +143 -0
- data/spec/unit/parser/ast/collection.rb +63 -0
- data/spec/unit/parser/ast/collexpr.rb +31 -8
- data/spec/unit/parser/ast/comparison_operator.rb +9 -9
- data/spec/unit/parser/ast/definition.rb +18 -0
- data/spec/unit/parser/ast/function.rb +6 -0
- data/spec/unit/parser/ast/ifstatement.rb +75 -0
- data/spec/unit/parser/ast/leaf.rb +261 -0
- data/spec/unit/parser/ast/match_operator.rb +50 -0
- data/spec/unit/parser/ast/minus.rb +1 -1
- data/spec/unit/parser/ast/node.rb +20 -0
- data/spec/unit/parser/ast/not.rb +1 -1
- data/spec/unit/parser/ast/resource_override.rb +5 -5
- data/spec/unit/parser/ast/resource_reference.rb +11 -5
- data/spec/unit/parser/ast/selector.rb +156 -0
- data/spec/unit/parser/ast/vardef.rb +11 -11
- data/spec/unit/parser/collector.rb +167 -48
- data/spec/unit/parser/compiler.rb +128 -104
- data/spec/unit/parser/files.rb +190 -0
- data/spec/unit/parser/functions/inline_template.rb +0 -0
- data/spec/unit/parser/functions/regsubst.rb +42 -42
- data/spec/unit/parser/functions/require.rb +36 -0
- data/spec/unit/parser/functions/shellquote.rb +92 -0
- data/spec/unit/parser/functions/split.rb +51 -0
- data/spec/unit/parser/functions/sprintf.rb +11 -11
- data/spec/unit/parser/functions/template.rb +0 -0
- data/spec/unit/parser/functions/versioncmp.rb +2 -2
- data/spec/unit/parser/interpreter.rb +16 -7
- data/spec/unit/parser/lexer.rb +72 -12
- data/spec/unit/parser/loaded_code.rb +198 -0
- data/spec/unit/parser/parser.rb +215 -28
- data/spec/unit/parser/resource.rb +131 -22
- data/spec/unit/parser/scope.rb +207 -12
- data/spec/unit/parser/templatewrapper.rb +8 -3
- data/spec/unit/property.rb +270 -16
- data/spec/unit/property/list.rb +12 -6
- data/spec/unit/provider.rb +31 -0
- data/spec/unit/provider/augeas/augeas.rb +61 -33
- data/spec/unit/provider/macauthorization.rb +29 -29
- data/spec/unit/provider/mcx/mcxcontent.rb +4 -4
- data/spec/unit/provider/mount/parsed.rb +5 -8
- data/spec/unit/provider/naginator.rb +0 -0
- data/spec/unit/provider/package/apt.rb +6 -6
- data/spec/unit/provider/package/pkgdmg.rb +73 -0
- data/spec/unit/provider/selboolean.rb +1 -1
- data/spec/unit/provider/selmodule.rb +2 -2
- data/spec/unit/provider/service/daemontools.rb +40 -15
- data/spec/unit/provider/service/debian.rb +89 -0
- data/spec/unit/provider/service/init.rb +106 -0
- data/spec/unit/provider/service/launchd.rb +71 -13
- data/spec/unit/provider/service/redhat.rb +94 -0
- data/spec/unit/provider/service/runit.rb +14 -2
- data/spec/unit/provider/ssh_authorized_key/parsed.rb +66 -2
- data/spec/unit/provider/user/ldap.rb +1 -1
- data/spec/unit/provider/user/user_role_add.rb +1 -1
- data/spec/unit/provider/zfs/solaris.rb +18 -6
- data/spec/unit/provider/zone/solaris.rb +1 -1
- data/spec/unit/rails.rb +16 -22
- data/spec/unit/rails/host.rb +163 -0
- data/spec/unit/rails/param_value.rb +49 -0
- data/spec/unit/rails/resource.rb +87 -0
- data/spec/unit/relationship.rb +141 -29
- data/spec/unit/resource.rb +504 -0
- data/spec/unit/resource/catalog.rb +1061 -0
- data/spec/unit/resource/reference.rb +111 -0
- data/spec/unit/simple_graph.rb +448 -191
- data/spec/unit/ssl/certificate.rb +124 -0
- data/spec/unit/ssl/certificate_authority.rb +741 -0
- data/spec/unit/ssl/certificate_authority/interface.rb +269 -0
- data/spec/unit/ssl/certificate_factory.rb +107 -0
- data/spec/unit/ssl/certificate_request.rb +193 -0
- data/spec/unit/ssl/certificate_revocation_list.rb +180 -0
- data/spec/unit/ssl/host.rb +704 -0
- data/spec/unit/ssl/inventory.rb +180 -0
- data/spec/unit/ssl/key.rb +198 -0
- data/spec/unit/transaction.rb +65 -2
- data/spec/unit/transaction/change.rb +1 -1
- data/spec/unit/transaction/report.rb +1 -1
- data/spec/unit/type.rb +361 -8
- data/spec/unit/type/augeas.rb +30 -37
- data/spec/unit/type/component.rb +63 -0
- data/spec/unit/type/computer.rb +17 -21
- data/spec/unit/type/exec.rb +27 -2
- data/spec/unit/type/file.rb +704 -83
- data/spec/unit/type/file/content.rb +253 -15
- data/spec/unit/type/file/ensure.rb +65 -2
- data/spec/unit/type/file/group.rb +5 -0
- data/spec/unit/type/file/owner.rb +5 -0
- data/spec/unit/type/file/selinux.rb +12 -16
- data/spec/unit/type/file/source.rb +264 -0
- data/spec/unit/type/filebucket.rb +74 -0
- data/spec/unit/type/group.rb +1 -5
- data/spec/unit/type/macauthorization.rb +59 -26
- data/spec/unit/type/mcx.rb +8 -16
- data/spec/unit/type/mount.rb +8 -16
- data/spec/unit/type/noop_metaparam.rb +0 -2
- data/spec/unit/type/package.rb +13 -23
- data/spec/unit/type/resources.rb +4 -7
- data/spec/unit/type/schedule.rb +1 -7
- data/spec/unit/type/selboolean.rb +4 -6
- data/spec/unit/type/service.rb +23 -33
- data/spec/unit/type/ssh_authorized_key.rb +25 -14
- data/spec/unit/type/tidy.rb +329 -21
- data/spec/unit/type/user.rb +18 -10
- data/spec/unit/type/zfs.rb +6 -6
- data/spec/unit/util/autoload.rb +94 -3
- data/spec/unit/util/autoload/file_cache.rb +183 -0
- data/spec/unit/util/backups.rb +159 -0
- data/spec/unit/util/cache_accumulator.rb +69 -0
- data/spec/unit/util/cacher.rb +185 -0
- data/spec/unit/util/checksums.rb +9 -1
- data/spec/unit/util/feature.rb +72 -0
- data/spec/unit/util/filetype.rb +1 -11
- data/spec/unit/util/json.rb +21 -0
- data/spec/unit/util/log.rb +45 -0
- data/spec/unit/util/package.rb +2 -2
- data/spec/unit/util/queue.rb +88 -0
- data/spec/unit/util/queue/stomp.rb +140 -0
- data/spec/unit/util/reference_serializer.rb +52 -0
- data/spec/unit/util/selinux.rb +5 -3
- data/spec/unit/util/settings.rb +413 -264
- data/spec/unit/util/settings/file_setting.rb +223 -0
- data/spec/unit/util/storage.rb +11 -11
- data/spec/unit/util/warnings.rb +21 -17
- data/test/Rakefile +6 -5
- data/test/certmgr/ca.rb +5 -5
- data/test/certmgr/certmgr.rb +4 -4
- data/test/data/providers/cron/crontab.allthree +2 -2
- data/test/data/providers/cron/crontab.envNcomment +1 -1
- data/test/data/providers/cron/crontab.envNname +1 -1
- data/test/data/providers/cron/crontab.multirecords +1 -1
- data/test/data/providers/cron/crontab_collections.yaml +14 -14
- data/test/data/providers/cron/crontab_multiple_with_env.yaml +6 -6
- data/test/data/providers/cron/crontab_sample_records.yaml +102 -102
- data/test/data/providers/mailalias/aliases/test1 +28 -0
- data/test/data/providers/package/testpackages.yaml +6 -6
- data/test/data/reports/1.yaml +17 -17
- data/test/data/reports/tagmail_passers.conf +2 -2
- data/test/data/snippets/append.pp +5 -5
- data/test/data/snippets/casestatement.pp +9 -2
- data/test/data/snippets/classincludes.pp +1 -1
- data/test/data/snippets/collection_override.pp +8 -0
- data/test/data/snippets/fqparents.pp +2 -2
- data/test/data/snippets/ifexpression.pp +12 -0
- data/test/data/snippets/multilinecomments.pp +5 -1
- data/test/data/snippets/selectorvalues.pp +7 -0
- data/test/data/types/hosts/1 +1 -1
- data/test/data/types/hosts/2 +3 -3
- data/test/data/types/hosts/solaris +2 -2
- data/test/data/types/mount/freebsd.fstab +7 -7
- data/test/data/types/mount/solaris.fstab +10 -10
- data/test/data/types/port/1 +472 -472
- data/test/data/types/port/darwin +4347 -4347
- data/test/language/ast.rb +3 -2
- data/test/language/ast/casestatement.rb +12 -12
- data/test/language/ast/resource.rb +4 -4
- data/test/language/ast/resource_reference.rb +5 -5
- data/test/language/ast/selector.rb +11 -11
- data/test/language/ast/variable.rb +4 -4
- data/test/language/functions.rb +16 -16
- data/test/language/parser.rb +89 -111
- data/test/language/resource.rb +3 -88
- data/test/language/scope.rb +14 -55
- data/test/language/snippets.rb +31 -31
- data/test/lib/puppettest.rb +12 -12
- data/test/lib/puppettest/certificates.rb +2 -2
- data/test/lib/puppettest/exetest.rb +0 -1
- data/test/lib/puppettest/fakes.rb +1 -1
- data/test/lib/puppettest/parsertesting.rb +9 -4
- data/test/lib/puppettest/railstesting.rb +3 -3
- data/test/lib/puppettest/servertest.rb +1 -1
- data/test/lib/puppettest/support/assertions.rb +2 -2
- data/test/lib/puppettest/support/collection.rb +1 -1
- data/test/lib/puppettest/support/resources.rb +7 -7
- data/test/lib/puppettest/support/utils.rb +10 -16
- data/test/lib/puppettest/testcase.rb +2 -1
- data/test/network/authconfig.rb +1 -1
- data/test/network/authorization.rb +1 -1
- data/test/network/authstore.rb +57 -14
- data/test/network/client/ca.rb +1 -0
- data/test/network/client/resource.rb +12 -50
- data/test/network/client_request.rb +1 -1
- data/test/network/handler/bucket.rb +2 -2
- data/test/network/handler/fileserver.rb +17 -21
- data/test/network/handler/master.rb +5 -5
- data/test/network/handler/report.rb +3 -3
- data/test/network/handler/resource.rb +29 -75
- data/test/network/handler/runner.rb +8 -58
- data/test/network/rights.rb +1 -1
- data/test/network/server/mongrel_test.rb +15 -1
- data/test/network/server/webrick.rb +0 -36
- data/test/network/xmlrpc/webrick_servlet.rb +5 -5
- data/test/other/dsl.rb +3 -3
- data/test/other/events.rb +15 -15
- data/test/other/puppet.rb +2 -32
- data/test/other/relationships.rb +21 -148
- data/test/other/report.rb +20 -23
- data/test/other/transactions.rb +110 -298
- data/test/puppet/defaults.rb +1 -1
- data/test/puppet/tc_suidmanager.rb +1 -1
- data/test/rails/railsparameter.rb +4 -4
- data/test/ral/manager/attributes.rb +12 -68
- data/test/ral/manager/instances.rb +3 -19
- data/test/ral/manager/manager.rb +7 -7
- data/test/ral/manager/provider.rb +7 -7
- data/test/ral/manager/type.rb +54 -349
- data/test/ral/providers/cron/crontab.rb +14 -14
- data/test/ral/providers/group.rb +5 -6
- data/test/ral/providers/host/parsed.rb +3 -3
- data/test/ral/providers/mailalias/aliases.rb +4 -4
- data/test/ral/providers/package.rb +3 -3
- data/test/ral/providers/package/aptitude.rb +55 -55
- data/test/ral/providers/package/aptrpm.rb +7 -7
- data/test/ral/providers/parsedfile.rb +10 -14
- data/test/ral/providers/port/parsed.rb +6 -6
- data/test/ral/providers/provider.rb +10 -10
- data/test/ral/providers/service/base.rb +32 -32
- data/test/ral/providers/sshkey/parsed.rb +14 -14
- data/test/ral/providers/user.rb +16 -17
- data/test/ral/providers/user/useradd.rb +19 -22
- data/test/ral/type/cron.rb +21 -28
- data/test/ral/type/exec.rb +57 -60
- data/test/ral/type/file.rb +88 -862
- data/test/ral/type/file/target.rb +21 -70
- data/test/ral/type/fileignoresource.rb +37 -44
- data/test/ral/type/filesources.rb +43 -473
- data/test/ral/type/group.rb +6 -7
- data/test/ral/type/host.rb +14 -30
- data/test/ral/type/mailalias.rb +3 -3
- data/test/ral/type/port.rb +5 -5
- data/test/ral/type/resources.rb +37 -37
- data/test/ral/type/service.rb +3 -3
- data/test/ral/type/sshkey.rb +34 -39
- data/test/ral/type/user.rb +15 -14
- data/test/ral/type/yumrepo.rb +18 -17
- data/test/ral/type/zone.rb +4 -6
- data/test/test +9 -9
- data/test/util/fileparsing.rb +10 -10
- data/test/util/inifile.rb +6 -6
- data/test/util/instance_loader.rb +1 -1
- data/test/util/log.rb +2 -2
- data/test/util/metrics.rb +1 -6
- data/test/util/package.rb +1 -1
- data/test/util/pidlock.rb +116 -116
- data/test/util/settings.rb +40 -429
- data/test/util/storage.rb +5 -5
- data/test/util/subclass_loader.rb +0 -7
- data/test/util/utiltest.rb +10 -29
- metadata +1369 -941
- data/bin/puppetca +0 -363
- data/bin/puppetd +0 -439
- data/bin/puppetmasterd +0 -289
- data/bin/puppetrun +0 -369
- data/conf/redhat/lsb-config.patch +0 -51
- data/conf/redhat/no-chuser-0.15.1.patch +0 -38
- data/conf/redhat/no-lockdir.patch +0 -13
- data/examples/mac_netinfo.pp +0 -5
- data/ext/passenger/README +0 -63
- data/ext/passenger/apache2.conf +0 -29
- data/ext/passenger/config.ru +0 -40
- data/lib/puppet/config_stores/rest.rb +0 -60
- data/lib/puppet/executables/client/certhandler.rb +0 -82
- data/lib/puppet/indirector/file_content/modules.rb +0 -11
- data/lib/puppet/indirector/file_metadata/modules.rb +0 -17
- data/lib/puppet/indirector/module_files.rb +0 -82
- data/lib/puppet/indirector/ssl_rsa.rb +0 -5
- data/lib/puppet/indirector/ssl_rsa/file.rb +0 -33
- data/lib/puppet/network/client/master.rb +0 -524
- data/lib/puppet/network/http_server/rack.rb +0 -148
- data/lib/puppet/pgraph.rb +0 -121
- data/lib/puppet/provider/group/netinfo.rb +0 -15
- data/lib/puppet/provider/host/netinfo.rb +0 -19
- data/lib/puppet/provider/mount/netinfo.rb +0 -37
- data/lib/puppet/provider/nameservice/netinfo.rb +0 -224
- data/lib/puppet/provider/user/netinfo.rb +0 -111
- data/lib/puppet/util/fact_store.rb +0 -59
- data/lib/puppet/util/uri_helper.rb +0 -22
- data/spec/integration/file_serving/configuration.rb +0 -43
- data/spec/integration/indirector/module_files.rb +0 -57
- data/spec/unit/executables/client/certhandler.rb +0 -135
- data/spec/unit/indirector/file_content/modules.rb +0 -18
- data/spec/unit/indirector/file_metadata/modules.rb +0 -42
- data/spec/unit/indirector/module_files.rb +0 -259
- data/spec/unit/indirector/ssl_rsa/file.rb +0 -121
- data/spec/unit/network/client/master.rb +0 -442
- data/spec/unit/node/catalog.rb +0 -865
- data/spec/unit/other/pgraph.rb +0 -210
- data/spec/unit/resource_reference.rb +0 -73
- data/spec/unit/util/uri_helper.rb +0 -41
- data/test/data/snippets/ifexpression.rb +0 -6
- data/test/executables/filebucket.rb +0 -51
- data/test/executables/puppetbin.rb +0 -104
- data/test/executables/puppetca.rb +0 -115
- data/test/executables/puppetd.rb +0 -55
- data/test/executables/puppetmasterd.rb +0 -147
- data/test/network/client/client.rb +0 -195
- data/test/network/client/master.rb +0 -490
- data/test/network/daemon.rb +0 -70
- data/test/network/handler/handler.rb +0 -63
- data/test/other/overrides.rb +0 -107
- data/test/puppet/conffiles.rb +0 -107
- data/test/rails/ast.rb +0 -73
- data/test/rails/configuration.rb +0 -71
- data/test/rails/host.rb +0 -154
- data/test/rails/railsresource.rb +0 -251
- data/test/ral/providers/host/netinfo.rb +0 -56
- data/test/ral/providers/mount/netinfo.rb +0 -79
- data/test/ral/type/basic.rb +0 -85
- data/test/ral/type/filebucket.rb +0 -157
- data/test/ral/type/parameter.rb +0 -174
- data/test/ral/type/property.rb +0 -388
- data/test/ral/type/tidy.rb +0 -291
- data/test/util/autoload.rb +0 -145
- data/test/util/features.rb +0 -95
data/bin/puppetca
DELETED
@@ -1,363 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
#
|
4
|
-
# = Synopsis
|
5
|
-
#
|
6
|
-
# Stand-alone certificate authority. Capable of generating certificates
|
7
|
-
# but mostly meant for signing certificate requests from puppet clients.
|
8
|
-
#
|
9
|
-
# = Usage
|
10
|
-
#
|
11
|
-
# puppetca [-h|--help] [-V|--version] [-d|--debug] [-v|--verbose]
|
12
|
-
# [-g|--generate] [-l|--list] [-s|--sign] [-r|--revoke]
|
13
|
-
# [-p|--print] [-c|--clean] [--verify] [host]
|
14
|
-
#
|
15
|
-
# = Description
|
16
|
-
#
|
17
|
-
# Because the puppetmasterd daemon defaults to not signing client certificate
|
18
|
-
# requests, this script is available for signing outstanding requests. It
|
19
|
-
# can be used to list outstanding requests and then either sign them individually
|
20
|
-
# or sign all of them.
|
21
|
-
#
|
22
|
-
# = Options
|
23
|
-
#
|
24
|
-
# Note that any configuration parameter that's valid in the configuration file
|
25
|
-
# is also a valid long argument. For example, 'ssldir' is a valid configuration
|
26
|
-
# parameter, so you can specify '--ssldir <directory>' as an argument.
|
27
|
-
#
|
28
|
-
# See the configuration file documentation at
|
29
|
-
# http://reductivelabs.com/projects/puppet/reference/configref.html for
|
30
|
-
# the full list of acceptable parameters. A commented list of all
|
31
|
-
# configuration options can also be generated by running puppetca with
|
32
|
-
# '--genconfig'.
|
33
|
-
#
|
34
|
-
# all::
|
35
|
-
# Operate on all items. Currently only makes sense with '--sign',
|
36
|
-
# '--clean', or '--list'.
|
37
|
-
#
|
38
|
-
# clean::
|
39
|
-
# Remove all files related to a host from puppetca's storage. This is
|
40
|
-
# useful when rebuilding hosts, since new certificate signing requests
|
41
|
-
# will only be honored if puppetca does not have a copy of a signed
|
42
|
-
# certificate for that host. The certificate of the host remains valid.
|
43
|
-
# If '--all' is specified then all host certificates, both signed and
|
44
|
-
# unsigned, will be removed.
|
45
|
-
#
|
46
|
-
# debug::
|
47
|
-
# Enable full debugging.
|
48
|
-
#
|
49
|
-
# generate::
|
50
|
-
# Generate a certificate for a named client. A certificate/keypair will be
|
51
|
-
# generated for each client named on the command line.
|
52
|
-
#
|
53
|
-
# help::
|
54
|
-
# Print this help message
|
55
|
-
#
|
56
|
-
# list::
|
57
|
-
# List outstanding certificate requests. If '--all' is specified,
|
58
|
-
# signed certificates are also listed, prefixed by '+'.
|
59
|
-
#
|
60
|
-
# print::
|
61
|
-
# Print the full-text version of a host's certificate.
|
62
|
-
#
|
63
|
-
# revoke::
|
64
|
-
# Revoke the certificate of a client. The certificate can be specified
|
65
|
-
# either by its serial number, given as a decimal number or a hexadecimal
|
66
|
-
# number prefixed by '0x', or by its hostname. The certificate is revoked
|
67
|
-
# by adding it to the Certificate Revocation List given by the 'cacrl'
|
68
|
-
# config parameter. Note that the puppetmasterd needs to be restarted
|
69
|
-
# after revoking certificates.
|
70
|
-
#
|
71
|
-
# sign::
|
72
|
-
# Sign an outstanding certificate request. Unless '--all' is specified,
|
73
|
-
# hosts must be listed after all flags.
|
74
|
-
#
|
75
|
-
# verbose::
|
76
|
-
# Enable verbosity.
|
77
|
-
#
|
78
|
-
# version::
|
79
|
-
# Print the puppet version number and exit.
|
80
|
-
#
|
81
|
-
# verify::
|
82
|
-
# Verify the named certificate against the local CA certificate.
|
83
|
-
#
|
84
|
-
# = Example
|
85
|
-
#
|
86
|
-
# $ puppetca -l
|
87
|
-
# culain.madstop.com
|
88
|
-
# $ puppetca -s culain.madstop.com
|
89
|
-
#
|
90
|
-
# = Author
|
91
|
-
#
|
92
|
-
# Luke Kanies
|
93
|
-
#
|
94
|
-
# = Copyright
|
95
|
-
#
|
96
|
-
# Copyright (c) 2005 Reductive Labs, LLC
|
97
|
-
# Licensed under the GNU Public License
|
98
|
-
|
99
|
-
require 'puppet'
|
100
|
-
require 'puppet/sslcertificates'
|
101
|
-
require 'getoptlong'
|
102
|
-
|
103
|
-
options = [
|
104
|
-
[ "--all", "-a", GetoptLong::NO_ARGUMENT ],
|
105
|
-
[ "--clean", "-c", GetoptLong::NO_ARGUMENT ],
|
106
|
-
[ "--debug", "-d", GetoptLong::NO_ARGUMENT ],
|
107
|
-
[ "--generate", "-g", GetoptLong::NO_ARGUMENT ],
|
108
|
-
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
|
109
|
-
[ "--list", "-l", GetoptLong::NO_ARGUMENT ],
|
110
|
-
[ "--print", "-p", GetoptLong::NO_ARGUMENT ],
|
111
|
-
[ "--revoke", "-r", GetoptLong::NO_ARGUMENT ],
|
112
|
-
[ "--sign", "-s", GetoptLong::NO_ARGUMENT ],
|
113
|
-
[ "--verify", GetoptLong::NO_ARGUMENT ],
|
114
|
-
[ "--version", "-V", GetoptLong::NO_ARGUMENT ],
|
115
|
-
[ "--verbose", "-v", GetoptLong::NO_ARGUMENT ]
|
116
|
-
]
|
117
|
-
|
118
|
-
# Add all of the config parameters as valid options.
|
119
|
-
Puppet.settings.addargs(options)
|
120
|
-
|
121
|
-
result = GetoptLong.new(*options)
|
122
|
-
|
123
|
-
mode = nil
|
124
|
-
all = false
|
125
|
-
generate = nil
|
126
|
-
|
127
|
-
modes = [:clean, :list, :revoke, :generate, :sign, :print, :verify]
|
128
|
-
|
129
|
-
begin
|
130
|
-
result.each { |opt,arg|
|
131
|
-
case opt
|
132
|
-
when "--all"
|
133
|
-
all = true
|
134
|
-
when "--debug"
|
135
|
-
Puppet::Util::Log.level = :debug
|
136
|
-
when "--generate"
|
137
|
-
generate = arg
|
138
|
-
mode = :generate
|
139
|
-
when "--help"
|
140
|
-
if Puppet.features.usage?
|
141
|
-
RDoc::usage && exit
|
142
|
-
else
|
143
|
-
puts "No help available unless you have RDoc::usage installed"
|
144
|
-
exit
|
145
|
-
end
|
146
|
-
when "--list"
|
147
|
-
mode = :list
|
148
|
-
when "--revoke"
|
149
|
-
mode = :revoke
|
150
|
-
when "--sign"
|
151
|
-
mode = :sign
|
152
|
-
when "--version"
|
153
|
-
puts "%s" % Puppet.version
|
154
|
-
exit
|
155
|
-
when "--verbose"
|
156
|
-
Puppet::Util::Log.level = :info
|
157
|
-
else
|
158
|
-
tmp = opt.sub("--", '').to_sym
|
159
|
-
if modes.include?(tmp)
|
160
|
-
mode = tmp
|
161
|
-
else
|
162
|
-
Puppet.settings.handlearg(opt, arg)
|
163
|
-
end
|
164
|
-
end
|
165
|
-
}
|
166
|
-
rescue GetoptLong::InvalidOption => detail
|
167
|
-
$stderr.puts "Try '#{$0} --help'"
|
168
|
-
exit(1)
|
169
|
-
end
|
170
|
-
|
171
|
-
# Now parse the config
|
172
|
-
Puppet.parse_config
|
173
|
-
|
174
|
-
if Puppet.settings.print_configs?
|
175
|
-
exit(Puppet.settings.print_configs ? 0 : 1)
|
176
|
-
end
|
177
|
-
|
178
|
-
begin
|
179
|
-
ca = Puppet::SSLCertificates::CA.new()
|
180
|
-
rescue => detail
|
181
|
-
if Puppet[:debug]
|
182
|
-
puts detail.backtrace
|
183
|
-
end
|
184
|
-
puts detail.to_s
|
185
|
-
exit(23)
|
186
|
-
end
|
187
|
-
|
188
|
-
unless mode
|
189
|
-
$stderr.puts "You must specify a mode; see the output from --help"
|
190
|
-
exit(12)
|
191
|
-
end
|
192
|
-
|
193
|
-
if [:verify, :print, :generate, :clean, :revoke, :list].include?(mode)
|
194
|
-
hosts = ARGV.collect { |h| h.downcase }
|
195
|
-
end
|
196
|
-
|
197
|
-
if [:sign, :list].include?(mode)
|
198
|
-
waiting = ca.list
|
199
|
-
unless waiting.length > 0 or (mode == :list and all)
|
200
|
-
puts "No certificates to sign"
|
201
|
-
if ARGV.length > 0
|
202
|
-
exit(17)
|
203
|
-
else
|
204
|
-
exit(0)
|
205
|
-
end
|
206
|
-
end
|
207
|
-
end
|
208
|
-
|
209
|
-
case mode
|
210
|
-
when :list
|
211
|
-
waiting = ca.list
|
212
|
-
if waiting.length > 0
|
213
|
-
puts waiting.join("\n")
|
214
|
-
end
|
215
|
-
if all
|
216
|
-
puts ca.list_signed.collect { |cert | cert.sub(/^/,"+ ") }.join("\n")
|
217
|
-
end
|
218
|
-
when :clean
|
219
|
-
if hosts.empty? and all == false
|
220
|
-
$stderr.puts "You must specify one or more hosts to clean or --all to clean all host certificates"
|
221
|
-
exit(24)
|
222
|
-
end
|
223
|
-
|
224
|
-
cleaned = false
|
225
|
-
|
226
|
-
if all
|
227
|
-
certs = ca.list
|
228
|
-
certs |= ca.list_signed
|
229
|
-
if certs.empty?
|
230
|
-
$stderr.puts "No certificates to clean"
|
231
|
-
exit(24)
|
232
|
-
end
|
233
|
-
certs.each do |c|
|
234
|
-
ca.clean(c)
|
235
|
-
end
|
236
|
-
cleaned = true
|
237
|
-
else
|
238
|
-
hosts.each do |host|
|
239
|
-
|
240
|
-
unless cert = ca.getclientcert(host)[0] || ca.getclientcsr(host)
|
241
|
-
$stderr.puts "Could not find client certificate or request for %s" % host
|
242
|
-
next
|
243
|
-
end
|
244
|
-
|
245
|
-
ca.clean(host)
|
246
|
-
cleaned = true
|
247
|
-
end
|
248
|
-
end
|
249
|
-
|
250
|
-
unless cleaned
|
251
|
-
exit(27)
|
252
|
-
end
|
253
|
-
when :sign
|
254
|
-
to_sign = ARGV.collect { |h| h.downcase }
|
255
|
-
unless to_sign.length > 0 or all
|
256
|
-
$stderr.puts(
|
257
|
-
"You must specify one or more hosts to sign certificates for or --all to sign all certificates"
|
258
|
-
)
|
259
|
-
exit(24)
|
260
|
-
end
|
261
|
-
|
262
|
-
unless all
|
263
|
-
to_sign.each { |host|
|
264
|
-
unless waiting.include?(host)
|
265
|
-
$stderr.puts "No waiting request for %s" % host
|
266
|
-
end
|
267
|
-
}
|
268
|
-
waiting = waiting.find_all { |host|
|
269
|
-
to_sign.include?(host)
|
270
|
-
}
|
271
|
-
end
|
272
|
-
|
273
|
-
waiting.each { |host|
|
274
|
-
begin
|
275
|
-
csr = ca.getclientcsr(host)
|
276
|
-
rescue => detail
|
277
|
-
$stderr.puts "Could not retrieve request for %s: %s" % [host, detail]
|
278
|
-
end
|
279
|
-
|
280
|
-
begin
|
281
|
-
ca.sign(csr)
|
282
|
-
$stderr.puts "Signed %s" % host
|
283
|
-
rescue => detail
|
284
|
-
$stderr.puts "Could not sign request for %s: %s" % [host, detail]
|
285
|
-
end
|
286
|
-
|
287
|
-
begin
|
288
|
-
ca.removeclientcsr(host)
|
289
|
-
rescue => detail
|
290
|
-
$stderr.puts "Could not remove request for %s: %s" % [host, detail]
|
291
|
-
end
|
292
|
-
}
|
293
|
-
when :generate
|
294
|
-
# we need to generate a certificate for a host
|
295
|
-
hosts.each { |host|
|
296
|
-
puts "Generating certificate for %s" % host
|
297
|
-
cert = Puppet::SSLCertificates::Certificate.new(
|
298
|
-
:name => host
|
299
|
-
)
|
300
|
-
cert.mkcsr
|
301
|
-
signedcert, cacert = ca.sign(cert.csr)
|
302
|
-
|
303
|
-
cert.cert = signedcert
|
304
|
-
cert.cacert = cacert
|
305
|
-
cert.write
|
306
|
-
}
|
307
|
-
when :print
|
308
|
-
hosts.each { |h|
|
309
|
-
cert = ca.getclientcert(h)[0]
|
310
|
-
puts cert.to_text
|
311
|
-
}
|
312
|
-
when :revoke
|
313
|
-
hosts.each { |h|
|
314
|
-
serial = nil
|
315
|
-
if h =~ /^0x[0-9a-f]+$/
|
316
|
-
serial = h.to_i(16)
|
317
|
-
elsif h =~ /^[0-9]+$/
|
318
|
-
serial = h.to_i
|
319
|
-
else
|
320
|
-
cert = ca.getclientcert(h)[0]
|
321
|
-
if cert.nil?
|
322
|
-
$stderr.puts "Could not find client certificate for %s" % h
|
323
|
-
else
|
324
|
-
serial = cert.serial
|
325
|
-
end
|
326
|
-
end
|
327
|
-
unless serial.nil?
|
328
|
-
ca.revoke(serial)
|
329
|
-
puts "Revoked certificate with serial #{serial}"
|
330
|
-
end
|
331
|
-
}
|
332
|
-
when :verify
|
333
|
-
unless ssl = %x{which openssl}.chomp
|
334
|
-
raise "Can't verify certificates without the openssl binary and could not find one"
|
335
|
-
end
|
336
|
-
success = true
|
337
|
-
|
338
|
-
cacert = Puppet[:localcacert]
|
339
|
-
|
340
|
-
hosts.each do |host|
|
341
|
-
print "%s: " % host
|
342
|
-
file = ca.host2certfile(host)
|
343
|
-
unless FileTest.exist?(file)
|
344
|
-
puts "no certificate found"
|
345
|
-
success = false
|
346
|
-
next
|
347
|
-
end
|
348
|
-
|
349
|
-
|
350
|
-
command = %{#{ssl} verify -CAfile #{cacert} #{file}}
|
351
|
-
output = %x{#{command}}
|
352
|
-
if $? == 0
|
353
|
-
puts "valid"
|
354
|
-
else
|
355
|
-
puts output
|
356
|
-
success = false
|
357
|
-
end
|
358
|
-
end
|
359
|
-
else
|
360
|
-
$stderr.puts "Invalid mode %s" % mode
|
361
|
-
exit(42)
|
362
|
-
end
|
363
|
-
|
data/bin/puppetd
DELETED
@@ -1,439 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# == Synopsis
|
3
|
-
#
|
4
|
-
# Retrieve the client configuration from the central puppet server and apply
|
5
|
-
# it to the local host.
|
6
|
-
#
|
7
|
-
# Currently must be run out periodically, using cron or something similar.
|
8
|
-
#
|
9
|
-
# = Usage
|
10
|
-
#
|
11
|
-
# puppetd [-D|--daemonize|--no-daemonize] [-d|--debug] [--disable] [--enable]
|
12
|
-
# [-h|--help] [--fqdn <host name>] [-l|--logdest syslog|<file>|console]
|
13
|
-
# [-o|--onetime] [--serve <handler>] [-t|--test] [--noop]
|
14
|
-
# [-V|--version] [-v|--verbose] [-w|--waitforcert <seconds>]
|
15
|
-
#
|
16
|
-
# = Description
|
17
|
-
#
|
18
|
-
# This is the main puppet client. Its job is to retrieve the local machine's
|
19
|
-
# configuration from a remote server and apply it. In order to successfully
|
20
|
-
# communicate with the remote server, the client must have a certificate signed
|
21
|
-
# by a certificate authority that the server trusts; the recommended method
|
22
|
-
# for this, at the moment, is to run a certificate authority as part of the
|
23
|
-
# puppet server (which is the default). The client will connect and request
|
24
|
-
# a signed certificate, and will continue connecting until it receives one.
|
25
|
-
#
|
26
|
-
# Once the client has a signed certificate, it will retrieve its configuration
|
27
|
-
# and apply it.
|
28
|
-
#
|
29
|
-
# = Usage Notes
|
30
|
-
#
|
31
|
-
# +puppetd+ does its best to find a compromise between interactive use and
|
32
|
-
# daemon use. Run with no arguments and no configuration, it will go into the
|
33
|
-
# backgroun, attempt to get a signed certificate, and retrieve and apply its
|
34
|
-
# configuration every 30 minutes.
|
35
|
-
#
|
36
|
-
# Some flags are meant specifically for interactive use -- in particular,
|
37
|
-
# +test+ and +tags+ are useful. +test+ enables verbose logging, causes
|
38
|
-
# the daemon to stay in the foreground, exits if the server's configuration is
|
39
|
-
# invalid (this happens if, for instance, you've left a syntax error on the
|
40
|
-
# server), and exits after running the configuration once (rather than hanging
|
41
|
-
# around as a long-running process).
|
42
|
-
#
|
43
|
-
# +tags+ allows you to specify what portions of a configuration you want to apply.
|
44
|
-
# Puppet elements are tagged with all of the class or definition names that
|
45
|
-
# contain them, and you can use the +tags+ flag to specify one of these names,
|
46
|
-
# causing only configuration elements contained within that class or definition
|
47
|
-
# to be applied. This is very useful when you are testing new configurations --
|
48
|
-
# for instance, if you are just starting to manage +ntpd+, you would put all of
|
49
|
-
# the new elements into an +ntpd+ class, and call puppet with +--tags ntpd+,
|
50
|
-
# which would only apply that small portion of the configuration during your
|
51
|
-
# testing, rather than applying the whole thing.
|
52
|
-
#
|
53
|
-
# = Options
|
54
|
-
#
|
55
|
-
# Note that any configuration parameter that's valid in the configuration file
|
56
|
-
# is also a valid long argument. For example, 'server' is a valid configuration
|
57
|
-
# parameter, so you can specify '--server <servername>' as an argument.
|
58
|
-
#
|
59
|
-
# See the configuration file documentation at
|
60
|
-
# http://reductivelabs.com/trac/puppet/wiki/ConfigurationReference for
|
61
|
-
# the full list of acceptable parameters. A commented list of all
|
62
|
-
# configuration options can also be generated by running puppetd with
|
63
|
-
# '--genconfig'.
|
64
|
-
#
|
65
|
-
# daemonize::
|
66
|
-
# Send the process into the background. This is the default.
|
67
|
-
#
|
68
|
-
# no-daemonize::
|
69
|
-
# Do not send the process into the background.
|
70
|
-
#
|
71
|
-
# debug::
|
72
|
-
# Enable full debugging.
|
73
|
-
#
|
74
|
-
# disable::
|
75
|
-
# Disable working on the local system. This puts a lock file in place,
|
76
|
-
# causing +puppetd+ not to work on the system until the lock file is removed.
|
77
|
-
# This is useful if you are testing a configuration and do not want the central
|
78
|
-
# configuration to override the local state until everything is tested and
|
79
|
-
# committed.
|
80
|
-
#
|
81
|
-
# +puppetd+ uses the same lock file while it is running, so no more than one
|
82
|
-
# +puppetd+ process is working at a time.
|
83
|
-
#
|
84
|
-
# +puppetd+ exits after executing this.
|
85
|
-
#
|
86
|
-
# enable::
|
87
|
-
# Enable working on the local system. This removes any lock file, causing
|
88
|
-
# +puppetd+ to start managing the local system again (although it will continue
|
89
|
-
# to use its normal scheduling, so it might not start for another half hour).
|
90
|
-
#
|
91
|
-
# +puppetd+ exits after executing this.
|
92
|
-
#
|
93
|
-
# fqdn::
|
94
|
-
# Set the fully-qualified domain name of the client. This is only used for
|
95
|
-
# certificate purposes, but can be used to override the discovered hostname.
|
96
|
-
# If you need to use this flag, it is generally an indication of a setup problem.
|
97
|
-
#
|
98
|
-
# help::
|
99
|
-
# Print this help message
|
100
|
-
#
|
101
|
-
# logdest::
|
102
|
-
# Where to send messages. Choose between syslog, the console, and a log file.
|
103
|
-
# Defaults to sending messages to syslog, or the console if debugging or
|
104
|
-
# verbosity is enabled.
|
105
|
-
#
|
106
|
-
# no-client::
|
107
|
-
# Do not create a config client. This will cause the daemon to run
|
108
|
-
# without ever checking for its configuration automatically, and only
|
109
|
-
# makes sense when used in conjunction with --listen.
|
110
|
-
#
|
111
|
-
# onetime::
|
112
|
-
# Run the configuration once, rather than as a long-running daemon. This is
|
113
|
-
# useful for interactively running puppetd.
|
114
|
-
#
|
115
|
-
# serve::
|
116
|
-
# Start another type of server. By default, +puppetd+ will start
|
117
|
-
# a service handler that allows authenticated and authorized remote nodes to
|
118
|
-
# trigger the configuration to be pulled down and applied. You can specify
|
119
|
-
# any handler here that does not require configuration, e.g., filebucket, ca,
|
120
|
-
# or resource. The handlers are in +lib/puppet/network/handler+, and the names
|
121
|
-
# must match exactly, both in the call to +serve+ and in +namespaceauth.conf+.
|
122
|
-
#
|
123
|
-
# test::
|
124
|
-
# Enable the most common options used for testing. These are +onetime+,
|
125
|
-
# +verbose+, +ignorecache, and +no-usecacheonfailure+.
|
126
|
-
#
|
127
|
-
# noop::
|
128
|
-
# Use +noop+ mode where the daemon runs in a no-op or dry-run mode. This is useful
|
129
|
-
# for seeing what changes Puppet will make without actually executing the changes.
|
130
|
-
#
|
131
|
-
# verbose::
|
132
|
-
# Turn on verbose reporting.
|
133
|
-
#
|
134
|
-
# version::
|
135
|
-
# Print the puppet version number and exit.
|
136
|
-
#
|
137
|
-
# waitforcert::
|
138
|
-
# This option only matters for daemons that do not yet have certificates
|
139
|
-
# and it is enabled by default, with a value of 120 (seconds). This causes
|
140
|
-
# +puppetd+ to connect to the server every 2 minutes and ask it to sign a
|
141
|
-
# certificate request. This is useful for the initial setup of a puppet
|
142
|
-
# client. You can turn off waiting for certificates by specifying a time
|
143
|
-
# of 0.
|
144
|
-
#
|
145
|
-
# = Example
|
146
|
-
#
|
147
|
-
# puppetd --server puppet.domain.com
|
148
|
-
#
|
149
|
-
# = Author
|
150
|
-
#
|
151
|
-
# Luke Kanies
|
152
|
-
#
|
153
|
-
# = Copyright
|
154
|
-
#
|
155
|
-
# Copyright (c) 2005, 2006 Reductive Labs, LLC
|
156
|
-
# Licensed under the GNU Public License
|
157
|
-
|
158
|
-
# Do an initial trap, so that cancels don't get a stack trace.
|
159
|
-
trap(:INT) do
|
160
|
-
$stderr.puts "Cancelling startup"
|
161
|
-
exit(0)
|
162
|
-
end
|
163
|
-
|
164
|
-
require 'puppet'
|
165
|
-
require 'puppet/executables/client/certhandler'
|
166
|
-
require 'puppet/network/client'
|
167
|
-
require 'getoptlong'
|
168
|
-
|
169
|
-
options = [
|
170
|
-
[ "--centrallogging", GetoptLong::NO_ARGUMENT ],
|
171
|
-
[ "--disable", GetoptLong::NO_ARGUMENT ],
|
172
|
-
[ "--debug", "-d", GetoptLong::NO_ARGUMENT ],
|
173
|
-
[ "--enable", GetoptLong::NO_ARGUMENT ],
|
174
|
-
[ "--fqdn", "-f", GetoptLong::REQUIRED_ARGUMENT ],
|
175
|
-
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
|
176
|
-
[ "--logdest", "-l", GetoptLong::REQUIRED_ARGUMENT ],
|
177
|
-
[ "--onetime", "-o", GetoptLong::NO_ARGUMENT ],
|
178
|
-
[ "--test", "-t", GetoptLong::NO_ARGUMENT ],
|
179
|
-
[ "--serve", "-s", GetoptLong::REQUIRED_ARGUMENT ],
|
180
|
-
[ "--no-client", GetoptLong::NO_ARGUMENT ],
|
181
|
-
[ "--verbose", "-v", GetoptLong::NO_ARGUMENT ],
|
182
|
-
[ "--version", "-V", GetoptLong::NO_ARGUMENT ],
|
183
|
-
[ "--waitforcert", "-w", GetoptLong::REQUIRED_ARGUMENT ]
|
184
|
-
]
|
185
|
-
|
186
|
-
# Add all of the config parameters as valid options.
|
187
|
-
Puppet.settings.addargs(options)
|
188
|
-
|
189
|
-
result = GetoptLong.new(*options)
|
190
|
-
|
191
|
-
args = {}
|
192
|
-
|
193
|
-
options = {
|
194
|
-
:waitforcert => 120, # Default to checking for certs every 5 minutes
|
195
|
-
:onetime => false,
|
196
|
-
:verbose => false,
|
197
|
-
:debug => false,
|
198
|
-
:centrallogs => false,
|
199
|
-
:setdest => false,
|
200
|
-
:enable => false,
|
201
|
-
:disable => false,
|
202
|
-
:client => true,
|
203
|
-
:fqdn => nil,
|
204
|
-
:serve => {}
|
205
|
-
}
|
206
|
-
|
207
|
-
begin
|
208
|
-
explicit_waitforcert = false
|
209
|
-
result.each { |opt,arg|
|
210
|
-
case opt
|
211
|
-
# First check to see if the argument is a valid configuration parameter;
|
212
|
-
# if so, set it. NOTE: there is a catch-all at the bottom for defaults.rb
|
213
|
-
when "--disable"
|
214
|
-
options[:disable] = true
|
215
|
-
when "--serve"
|
216
|
-
if Puppet::Network::Handler.handler(arg)
|
217
|
-
options[:serve][arg.to_sym] = {}
|
218
|
-
else
|
219
|
-
raise "Could not find handler for %s" % arg
|
220
|
-
end
|
221
|
-
when "--enable"
|
222
|
-
options[:enable] = true
|
223
|
-
when "--test"
|
224
|
-
options[:test] = true
|
225
|
-
when "--centrallogging"
|
226
|
-
options[:centrallogs] = true
|
227
|
-
when "--help"
|
228
|
-
if Puppet.features.usage?
|
229
|
-
RDoc::usage && exit
|
230
|
-
else
|
231
|
-
puts "No help available unless you have RDoc::usage installed"
|
232
|
-
exit
|
233
|
-
end
|
234
|
-
when "--version"
|
235
|
-
puts "%s" % Puppet.version
|
236
|
-
exit
|
237
|
-
when "--verbose"
|
238
|
-
options[:verbose] = true
|
239
|
-
when "--debug"
|
240
|
-
options[:debug] = true
|
241
|
-
when "--fqdn"
|
242
|
-
options[:fqdn] = arg
|
243
|
-
when "--no-client"
|
244
|
-
options[:client] = false
|
245
|
-
when "--onetime"
|
246
|
-
options[:onetime] = true
|
247
|
-
options[:waitforcert] = 0 unless explicit_waitforcert
|
248
|
-
when "--port"
|
249
|
-
args[:Port] = arg
|
250
|
-
when "--logdest"
|
251
|
-
begin
|
252
|
-
Puppet::Util::Log.newdestination(arg)
|
253
|
-
options[:setdest] = true
|
254
|
-
rescue => detail
|
255
|
-
if Puppet[:debug]
|
256
|
-
puts detail.backtrace
|
257
|
-
end
|
258
|
-
$stderr.puts detail.to_s
|
259
|
-
end
|
260
|
-
when "--waitforcert"
|
261
|
-
options[:waitforcert] = arg.to_i
|
262
|
-
explicit_waitforcert = true
|
263
|
-
else
|
264
|
-
Puppet.settings.handlearg(opt, arg)
|
265
|
-
end
|
266
|
-
}
|
267
|
-
rescue GetoptLong::InvalidOption => detail
|
268
|
-
$stderr.puts detail
|
269
|
-
$stderr.puts "Try '#{$0} --help'"
|
270
|
-
exit(1)
|
271
|
-
end
|
272
|
-
|
273
|
-
# Now parse the config
|
274
|
-
Puppet.parse_config
|
275
|
-
|
276
|
-
if options[:test]
|
277
|
-
# Enable all of the most common test options.
|
278
|
-
Puppet.settings.handlearg("--ignorecache")
|
279
|
-
Puppet.settings.handlearg("--no-usecacheonfailure")
|
280
|
-
Puppet.settings.handlearg("--no-splay")
|
281
|
-
Puppet.settings.handlearg("--show_diff")
|
282
|
-
Puppet.settings.handlearg("--no-daemonize")
|
283
|
-
options[:verbose] = true
|
284
|
-
options[:onetime] = true
|
285
|
-
options[:waitforcert] = 0
|
286
|
-
end
|
287
|
-
|
288
|
-
# Handle the logging settings.
|
289
|
-
if options[:debug] or options[:verbose]
|
290
|
-
Puppet::Util::Log.newdestination(:console)
|
291
|
-
if options[:debug]
|
292
|
-
Puppet::Util::Log.level = :debug
|
293
|
-
else
|
294
|
-
Puppet::Util::Log.level = :info
|
295
|
-
end
|
296
|
-
end
|
297
|
-
|
298
|
-
unless options[:setdest]
|
299
|
-
Puppet::Util::Log.newdestination(:syslog)
|
300
|
-
end
|
301
|
-
|
302
|
-
if Puppet.settings.print_configs?
|
303
|
-
exit(Puppet.settings.print_configs ? 0 : 1)
|
304
|
-
end
|
305
|
-
|
306
|
-
# If noop is set, then also enable diffs
|
307
|
-
if Puppet[:noop]
|
308
|
-
Puppet[:show_diff] = true
|
309
|
-
end
|
310
|
-
|
311
|
-
args[:Server] = Puppet[:server]
|
312
|
-
if options[:fqdn]
|
313
|
-
args[:FQDN] = options[:fqdn]
|
314
|
-
Puppet[:certname] = options[:fqdn]
|
315
|
-
end
|
316
|
-
|
317
|
-
if options[:centrallogs]
|
318
|
-
logdest = args[:Server]
|
319
|
-
|
320
|
-
if args.include?(:Port)
|
321
|
-
logdest += ":" + args[:Port]
|
322
|
-
end
|
323
|
-
Puppet::Util::Log.newdestination(logdest)
|
324
|
-
end
|
325
|
-
|
326
|
-
# We need tomake the client either way, we just don't start it
|
327
|
-
# if --no-client is set.
|
328
|
-
client = Puppet::Network::Client.master.new(args)
|
329
|
-
if options[:enable]
|
330
|
-
client.enable
|
331
|
-
elsif options[:disable]
|
332
|
-
client.disable
|
333
|
-
end
|
334
|
-
|
335
|
-
if options[:enable] or options[:disable]
|
336
|
-
exit(0)
|
337
|
-
end
|
338
|
-
|
339
|
-
server = nil
|
340
|
-
|
341
|
-
# It'd be nice to daemonize later, but we have to daemonize before the
|
342
|
-
# waitforcert happens.
|
343
|
-
if Puppet[:daemonize]
|
344
|
-
client.daemonize
|
345
|
-
end
|
346
|
-
|
347
|
-
unless Puppet::Executables::Client::CertHandler.new(options[:waitforcert], options[:onetime]).read_retrieve
|
348
|
-
client.recycle_connection
|
349
|
-
end
|
350
|
-
|
351
|
-
objects = []
|
352
|
-
|
353
|
-
# This has to go after the certs are dealt with.
|
354
|
-
if Puppet[:listen] and ! options[:onetime]
|
355
|
-
unless FileTest.exists?(Puppet[:authconfig])
|
356
|
-
Puppet.err "Will not start without authorization file %s" %
|
357
|
-
Puppet[:authconfig]
|
358
|
-
exit(14)
|
359
|
-
end
|
360
|
-
|
361
|
-
# FIXME: we should really figure out how to distribute the CRL
|
362
|
-
# to clients. In the meantime, we just disable CRL checking if
|
363
|
-
# the CRL file doesn't exist
|
364
|
-
unless File::exist?(Puppet[:cacrl])
|
365
|
-
Puppet[:cacrl] = 'false'
|
366
|
-
end
|
367
|
-
|
368
|
-
handlers = nil
|
369
|
-
|
370
|
-
if options[:serve].empty?
|
371
|
-
handlers = {:Runner => {}}
|
372
|
-
else
|
373
|
-
handlers = options[:serve]
|
374
|
-
end
|
375
|
-
|
376
|
-
handlers.each do |name, hash|
|
377
|
-
Puppet.info "Starting handler for %s" % name
|
378
|
-
end
|
379
|
-
|
380
|
-
args[:Handlers] = handlers
|
381
|
-
args[:Port] = Puppet[:puppetport]
|
382
|
-
|
383
|
-
require 'puppet/network/http_server/webrick'
|
384
|
-
|
385
|
-
begin
|
386
|
-
server = Puppet::Network::HTTPServer::WEBrick.new(args)
|
387
|
-
rescue => detail
|
388
|
-
$stderr.puts detail
|
389
|
-
puts detail.backtrace
|
390
|
-
exit(1)
|
391
|
-
end
|
392
|
-
|
393
|
-
objects << server
|
394
|
-
elsif options[:onetime] and Puppet[:listen]
|
395
|
-
Puppet.notice "Ignoring --listen on onetime run"
|
396
|
-
end
|
397
|
-
|
398
|
-
if options[:client]
|
399
|
-
objects << client
|
400
|
-
end
|
401
|
-
|
402
|
-
# Set traps for INT and TERM
|
403
|
-
Puppet.settraps
|
404
|
-
|
405
|
-
# If --onetime is specified, we don't run 'start', which means we don't
|
406
|
-
# create a pidfile.
|
407
|
-
if options[:onetime]
|
408
|
-
unless options[:client]
|
409
|
-
$stderr.puts "onetime is specified but there is no client"
|
410
|
-
exit(43)
|
411
|
-
end
|
412
|
-
|
413
|
-
# Add the service, so the traps work correctly.
|
414
|
-
Puppet.newservice(client)
|
415
|
-
|
416
|
-
begin
|
417
|
-
client.run
|
418
|
-
rescue => detail
|
419
|
-
if Puppet[:trace]
|
420
|
-
puts detail.backtrace
|
421
|
-
end
|
422
|
-
Puppet.err detail.to_s
|
423
|
-
end
|
424
|
-
exit(0)
|
425
|
-
else
|
426
|
-
if server
|
427
|
-
Puppet.newservice(server)
|
428
|
-
end
|
429
|
-
|
430
|
-
if options[:client]
|
431
|
-
Puppet.notice "Starting Puppet client version %s" % [Puppet.version]
|
432
|
-
Puppet.newservice(client)
|
433
|
-
end
|
434
|
-
|
435
|
-
Puppet.settraps
|
436
|
-
|
437
|
-
Puppet.start
|
438
|
-
end
|
439
|
-
|