puppet 0.24.7 → 0.24.8
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 +72 -0
- data/README.rst +38 -0
- data/Rakefile +3 -1
- data/bin/filebucket +0 -0
- data/bin/puppet +0 -0
- data/bin/puppetca +0 -0
- data/bin/puppetd +0 -0
- data/bin/puppetdoc +0 -0
- data/bin/puppetmasterd +0 -0
- data/bin/puppetrun +0 -0
- data/bin/ralsh +4 -0
- data/conf/gentoo/init.d/puppetmaster +0 -0
- data/conf/osx/createpackage.sh +0 -0
- data/conf/osx/preflight +0 -0
- data/conf/redhat/puppet.spec +20 -3
- data/conf/solaris/smf/svc-puppetd +0 -0
- data/conf/solaris/smf/svc-puppetmasterd +0 -0
- data/examples/etc/init.d/sleeper +0 -0
- data/examples/mac_dscl.pp +0 -0
- data/examples/mac_dscl_revert.pp +0 -0
- data/examples/mac_netinfo.pp +0 -0
- data/examples/mac_pkgdmg.pp +0 -0
- data/ext/bin/sleeper +0 -0
- data/ext/dbfix.sql +132 -0
- data/ext/logcheck/puppet +2 -1
- data/ext/module_puppet +0 -0
- data/ext/nagios/check_puppet.rb +0 -0
- data/ext/puppet-test +0 -0
- data/ext/puppetlast +0 -0
- data/ext/vim/syntax/puppet.vim +2 -1
- data/install.rb +2 -2
- data/lib/puppet.rb +1 -1
- data/lib/puppet/daemon.rb +0 -0
- data/lib/puppet/defaults.rb +9 -0
- data/lib/puppet/executables/client/certhandler.rb +6 -1
- data/lib/puppet/external/base64.rb +0 -0
- data/lib/puppet/external/nagios.rb +0 -0
- data/lib/puppet/external/nagios/base.rb +0 -0
- data/lib/puppet/external/nagios/parser.rb +39 -57
- data/lib/puppet/file_collection.rb +30 -0
- data/lib/puppet/file_collection/lookup.rb +20 -0
- data/lib/puppet/indirector/facts/facter.rb +6 -2
- data/lib/puppet/indirector/node/ldap.rb +75 -39
- data/lib/puppet/network/authstore.rb +0 -0
- data/lib/puppet/network/handler/filebucket.rb +0 -0
- data/lib/puppet/network/handler/fileserver.rb +0 -0
- data/lib/puppet/network/handler/report.rb +0 -0
- data/lib/puppet/network/handler/resource.rb +0 -0
- data/lib/puppet/network/handler/runner.rb +0 -0
- data/lib/puppet/network/rights.rb +0 -0
- data/lib/puppet/network/xmlrpc/client.rb +113 -53
- data/lib/puppet/node/facts.rb +0 -0
- data/lib/puppet/parser/ast.rb +4 -3
- data/lib/puppet/parser/ast/astarray.rb +2 -1
- data/lib/puppet/parser/ast/leaf.rb +1 -1
- data/lib/puppet/parser/ast/resource.rb +20 -20
- data/lib/puppet/parser/ast/resource_override.rb +2 -2
- data/lib/puppet/parser/collector.rb +1 -2
- data/lib/puppet/parser/functions/realize.rb +1 -1
- data/lib/puppet/parser/functions/regsubst.rb +93 -0
- data/lib/puppet/parser/functions/sprintf.rb +17 -0
- data/lib/puppet/parser/functions/versioncmp.rb +10 -0
- data/lib/puppet/parser/resource.rb +10 -6
- data/lib/puppet/parser/resource/param.rb +17 -14
- data/lib/puppet/parser/resource/reference.rb +2 -0
- data/lib/puppet/parser/scope.rb +3 -3
- data/lib/puppet/property/list.rb +5 -1
- data/lib/puppet/provider/augeas/augeas.rb +146 -44
- data/lib/puppet/provider/cron/crontab.rb +0 -0
- data/lib/puppet/provider/mailalias/aliases.rb +0 -0
- data/lib/puppet/provider/maillist/mailman.rb +0 -0
- data/lib/puppet/provider/mount/parsed.rb +0 -0
- data/lib/puppet/provider/naginator.rb +7 -2
- data/lib/puppet/provider/nameservice/directoryservice.rb +128 -44
- data/lib/puppet/provider/package/apple.rb +0 -0
- data/lib/puppet/provider/package/apt.rb +0 -0
- data/lib/puppet/provider/package/aptitude.rb +0 -0
- data/lib/puppet/provider/package/blastwave.rb +0 -0
- data/lib/puppet/provider/package/darwinport.rb +0 -0
- data/lib/puppet/provider/package/dpkg.rb +0 -0
- data/lib/puppet/provider/package/fink.rb +0 -0
- data/lib/puppet/provider/package/freebsd.rb +0 -0
- data/lib/puppet/provider/package/gem.rb +0 -0
- data/lib/puppet/provider/package/openbsd.rb +0 -0
- data/lib/puppet/provider/package/ports.rb +0 -0
- data/lib/puppet/provider/package/rpm.rb +0 -0
- data/lib/puppet/provider/package/sun.rb +0 -0
- data/lib/puppet/provider/package/sunfreeware.rb +0 -0
- data/lib/puppet/provider/package/up2date.rb +4 -2
- data/lib/puppet/provider/package/yum.rb +0 -0
- data/lib/puppet/provider/parsedfile.rb +47 -22
- data/lib/puppet/provider/port/parsed.rb +0 -0
- data/lib/puppet/provider/service/base.rb +0 -0
- data/lib/puppet/provider/service/debian.rb +0 -0
- data/lib/puppet/provider/service/gentoo.rb +1 -1
- data/lib/puppet/provider/service/init.rb +0 -0
- data/lib/puppet/provider/service/launchd.rb +13 -4
- data/lib/puppet/provider/service/redhat.rb +5 -5
- data/lib/puppet/provider/service/smf.rb +0 -0
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +43 -16
- data/lib/puppet/provider/sshkey/parsed.rb +0 -0
- data/lib/puppet/provider/user/useradd.rb +1 -1
- data/lib/puppet/rails/database/003_add_environment_to_host.rb +6 -2
- data/lib/puppet/rails/host.rb +70 -19
- data/lib/puppet/rails/param_value.rb +31 -12
- data/lib/puppet/rails/resource.rb +36 -9
- data/lib/puppet/rails/resource_tag.rb +18 -0
- data/lib/puppet/reference/report.rb +1 -0
- data/lib/puppet/reports.rb +0 -0
- data/lib/puppet/sslcertificates.rb +0 -0
- data/lib/puppet/transaction.rb +1 -1
- data/lib/puppet/type.rb +2 -6
- data/lib/puppet/type/augeas.rb +23 -15
- data/lib/puppet/type/cron.rb +0 -0
- data/lib/puppet/type/exec.rb +0 -0
- data/lib/puppet/type/file/checksum.rb +7 -35
- data/lib/puppet/type/file/content.rb +11 -8
- data/lib/puppet/type/file/ensure.rb +0 -0
- data/lib/puppet/type/file/group.rb +0 -0
- data/lib/puppet/type/file/mode.rb +0 -0
- data/lib/puppet/type/file/owner.rb +0 -0
- data/lib/puppet/type/file/selcontext.rb +8 -0
- data/lib/puppet/type/file/source.rb +0 -0
- data/lib/puppet/type/file/type.rb +0 -0
- data/lib/puppet/type/filebucket.rb +0 -0
- data/lib/puppet/type/group.rb +0 -0
- data/lib/puppet/type/host.rb +0 -0
- data/lib/puppet/type/mailalias.rb +0 -0
- data/lib/puppet/type/maillist.rb +0 -0
- data/lib/puppet/type/mount.rb +0 -0
- data/lib/puppet/type/port.rb +0 -0
- data/lib/puppet/type/schedule.rb +0 -0
- data/lib/puppet/type/ssh_authorized_key.rb +14 -0
- data/lib/puppet/type/sshkey.rb +0 -0
- data/lib/puppet/type/tidy.rb +0 -0
- data/lib/puppet/type/user.rb +6 -0
- data/lib/puppet/type/yumrepo.rb +4 -1
- data/lib/puppet/type/zfs.rb +0 -0
- data/lib/puppet/type/zpool.rb +0 -0
- data/lib/puppet/util/autoload.rb +2 -2
- data/lib/puppet/util/filetype.rb +7 -96
- data/lib/puppet/util/inifile.rb +1 -0
- data/lib/puppet/util/instance_loader.rb +0 -0
- data/lib/puppet/util/loadedfile.rb +0 -0
- data/lib/puppet/util/nagios_maker.rb +4 -0
- data/lib/puppet/util/package.rb +2 -0
- data/lib/puppet/util/posix.rb +0 -0
- data/lib/puppet/util/rails/reference_serializer.rb +18 -0
- data/lib/puppet/util/selinux.rb +3 -1
- data/spec/integration/checksum.rb +1 -0
- data/spec/integration/defaults.rb +9 -0
- data/spec/integration/file_serving/configuration.rb +0 -0
- data/spec/integration/file_serving/content.rb +0 -0
- data/spec/integration/file_serving/metadata.rb +0 -0
- data/spec/integration/indirector/direct_file_server.rb +0 -0
- data/spec/integration/indirector/file_content/file_server.rb +0 -0
- data/spec/integration/indirector/file_metadata/file_server.rb +0 -0
- data/spec/integration/indirector/module_files.rb +0 -0
- data/spec/integration/indirector/node/ldap.rb +0 -0
- data/spec/integration/indirector/rest.rb +0 -0
- data/spec/integration/network/server/mongrel.rb +0 -0
- data/spec/integration/network/server/webrick.rb +0 -0
- data/spec/integration/node.rb +0 -0
- data/spec/integration/node/catalog.rb +0 -0
- data/spec/integration/node/facts.rb +0 -0
- data/spec/integration/provider/package.rb +0 -0
- data/spec/integration/provider/service/init.rb +0 -0
- data/spec/integration/reference/providers.rb +0 -0
- data/spec/integration/reports.rb +4 -0
- data/spec/integration/transaction/report.rb +7 -1
- data/spec/integration/type/package.rb +5 -2
- data/spec/integration/util/file_locking.rb +0 -0
- data/spec/unit/executables/client/certhandler.rb +13 -0
- data/spec/unit/file_collection.rb +53 -0
- data/spec/unit/file_collection/lookup.rb +46 -0
- data/spec/unit/file_serving/configuration.rb +0 -0
- data/spec/unit/file_serving/configuration/parser.rb +0 -0
- data/spec/unit/file_serving/content.rb +0 -0
- data/spec/unit/file_serving/file_base.rb +0 -0
- data/spec/unit/file_serving/fileset.rb +0 -0
- data/spec/unit/file_serving/indirection_hooks.rb +0 -0
- data/spec/unit/file_serving/metadata.rb +0 -0
- data/spec/unit/file_serving/mount.rb +0 -0
- data/spec/unit/file_serving/terminus_helper.rb +0 -0
- data/spec/unit/indirector.rb +0 -0
- data/spec/unit/indirector/catalog/compiler.rb +0 -0
- data/spec/unit/indirector/catalog/yaml.rb +0 -0
- data/spec/unit/indirector/checksum/file.rb +0 -0
- data/spec/unit/indirector/code.rb +0 -0
- data/spec/unit/indirector/direct_file_server.rb +0 -0
- data/spec/unit/indirector/envelope.rb +0 -0
- data/spec/unit/indirector/exec.rb +0 -0
- data/spec/unit/indirector/facts/facter.rb +27 -2
- data/spec/unit/indirector/facts/yaml.rb +0 -0
- data/spec/unit/indirector/file.rb +0 -0
- data/spec/unit/indirector/file_content/file.rb +0 -0
- data/spec/unit/indirector/file_content/file_server.rb +0 -0
- data/spec/unit/indirector/file_content/modules.rb +0 -0
- data/spec/unit/indirector/file_content/rest.rb +0 -0
- data/spec/unit/indirector/file_metadata/file.rb +0 -0
- data/spec/unit/indirector/file_metadata/file_server.rb +0 -0
- data/spec/unit/indirector/file_metadata/modules.rb +0 -0
- data/spec/unit/indirector/file_metadata/rest.rb +0 -0
- data/spec/unit/indirector/file_server.rb +0 -0
- data/spec/unit/indirector/indirection.rb +0 -0
- data/spec/unit/indirector/ldap.rb +0 -0
- data/spec/unit/indirector/memory.rb +0 -0
- data/spec/unit/indirector/module_files.rb +0 -0
- data/spec/unit/indirector/node/exec.rb +0 -0
- data/spec/unit/indirector/node/ldap.rb +20 -0
- data/spec/unit/indirector/node/memory.rb +0 -0
- data/spec/unit/indirector/node/plain.rb +0 -0
- data/spec/unit/indirector/node/rest.rb +0 -0
- data/spec/unit/indirector/node/yaml.rb +0 -0
- data/spec/unit/indirector/plain.rb +0 -0
- data/spec/unit/indirector/report/processor.rb +0 -0
- data/spec/unit/indirector/request.rb +0 -0
- data/spec/unit/indirector/rest.rb +0 -0
- data/spec/unit/indirector/ssl_rsa/file.rb +5 -0
- data/spec/unit/indirector/terminus.rb +0 -0
- data/spec/unit/indirector/yaml.rb +0 -0
- data/spec/unit/module.rb +0 -0
- data/spec/unit/network/client.rb +0 -0
- data/spec/unit/network/client/master.rb +0 -0
- data/spec/unit/network/http.rb +0 -0
- data/spec/unit/network/http/mongrel.rb +0 -0
- data/spec/unit/network/http/mongrel/rest.rb +0 -0
- data/spec/unit/network/http/mongrel/xmlrpc.rb +0 -0
- data/spec/unit/network/http/webrick.rb +0 -0
- data/spec/unit/network/http/webrick/rest.rb +0 -0
- data/spec/unit/network/http/webrick/xmlrpc.rb +0 -0
- data/spec/unit/network/http_pool.rb +0 -0
- data/spec/unit/network/server.rb +0 -0
- data/spec/unit/network/xmlrpc/client.rb +165 -7
- data/spec/unit/node.rb +0 -0
- data/spec/unit/node/catalog.rb +1 -0
- data/spec/unit/node/environment.rb +0 -0
- data/spec/unit/node/facts.rb +0 -0
- data/spec/unit/other/checksum.rb +0 -0
- data/spec/unit/other/pgraph.rb +0 -0
- data/spec/unit/other/transbucket.rb +4 -4
- data/spec/unit/other/transobject.rb +0 -0
- data/spec/unit/parameter.rb +0 -0
- data/spec/unit/parser/ast.rb +5 -1
- data/spec/unit/parser/ast/arithmetic_operator.rb +0 -0
- data/spec/unit/parser/ast/astarray.rb +2 -2
- data/spec/unit/parser/ast/boolean_operator.rb +0 -0
- data/spec/unit/parser/ast/collexpr.rb +0 -0
- data/spec/unit/parser/ast/comparison_operator.rb +0 -0
- data/spec/unit/parser/ast/definition.rb +0 -0
- data/spec/unit/parser/ast/hostclass.rb +0 -0
- data/spec/unit/parser/ast/minus.rb +0 -0
- data/spec/unit/parser/ast/node.rb +0 -0
- data/spec/unit/parser/ast/nop.rb +0 -0
- data/spec/unit/parser/ast/not.rb +0 -0
- data/spec/unit/parser/ast/resource.rb +103 -0
- data/spec/unit/parser/ast/resource_override.rb +0 -0
- data/spec/unit/parser/ast/resource_reference.rb +0 -0
- data/spec/unit/parser/ast/vardef.rb +0 -0
- data/spec/unit/parser/collector.rb +4 -4
- data/spec/unit/parser/compiler.rb +0 -0
- data/spec/unit/parser/functions/realize.rb +51 -0
- data/spec/unit/parser/functions/regsubst.rb +88 -0
- data/spec/unit/parser/functions/sprintf.rb +42 -0
- data/spec/unit/parser/functions/versioncmp.rb +29 -0
- data/spec/unit/parser/interpreter.rb +0 -0
- data/spec/unit/parser/lexer.rb +0 -0
- data/spec/unit/parser/parser.rb +0 -0
- data/spec/unit/parser/resource.rb +4 -0
- data/spec/unit/parser/resource/reference.rb +4 -0
- data/spec/unit/parser/scope.rb +14 -0
- data/spec/unit/parser/templatewrapper.rb +0 -0
- data/spec/unit/property.rb +0 -0
- data/spec/unit/property/list.rb +4 -0
- data/spec/unit/provider/augeas/augeas.rb +219 -92
- data/spec/unit/provider/confine.rb +0 -0
- data/spec/unit/provider/confine/exists.rb +0 -0
- data/spec/unit/provider/confine/false.rb +0 -0
- data/spec/unit/provider/confine/feature.rb +0 -0
- data/spec/unit/provider/confine/true.rb +0 -0
- data/spec/unit/provider/confine/variable.rb +0 -0
- data/spec/unit/provider/confine_collection.rb +0 -0
- data/spec/unit/provider/confiner.rb +0 -0
- data/spec/unit/provider/group/groupadd.rb +0 -0
- data/spec/unit/provider/group/ldap.rb +0 -0
- data/spec/unit/provider/ldap.rb +0 -0
- data/spec/unit/provider/macauthorization.rb +0 -0
- data/spec/unit/provider/mcx/mcxcontent.rb +0 -0
- data/spec/unit/provider/mount.rb +0 -0
- data/spec/unit/provider/mount/parsed.rb +1 -0
- data/spec/unit/provider/naginator.rb +58 -0
- data/spec/unit/provider/package/apt.rb +0 -0
- data/spec/unit/provider/package/dpkg.rb +0 -0
- data/spec/unit/provider/parsedfile.rb +95 -0
- data/spec/unit/provider/selboolean.rb +0 -0
- data/spec/unit/provider/selmodule.rb +0 -0
- data/spec/unit/provider/service/launchd.rb +9 -1
- data/spec/unit/provider/ssh_authorized_key/parsed.rb +63 -19
- data/spec/unit/provider/user/hpux.rb +0 -0
- data/spec/unit/provider/user/ldap.rb +0 -0
- data/spec/unit/provider/user/useradd.rb +0 -0
- data/spec/unit/provider/zfs/solaris.rb +0 -0
- data/spec/unit/provider/zone/solaris.rb +0 -0
- data/spec/unit/provider/zpool/solaris.rb +0 -0
- data/spec/unit/rails.rb +1 -0
- data/spec/unit/relationship.rb +0 -0
- data/spec/unit/reports.rb +0 -0
- data/spec/unit/resource_reference.rb +0 -0
- data/spec/unit/simple_graph.rb +0 -0
- data/spec/unit/{other/transaction.rb → transaction.rb} +16 -1
- data/spec/unit/transaction/change.rb +0 -0
- data/spec/unit/transaction/event.rb +0 -0
- data/spec/unit/transaction/report.rb +0 -0
- data/spec/unit/type.rb +0 -0
- data/spec/unit/type/computer.rb +0 -0
- data/spec/unit/type/exec.rb +0 -0
- data/spec/unit/type/file.rb +2 -0
- data/spec/unit/type/file/content.rb +30 -0
- data/spec/unit/type/file/ensure.rb +0 -0
- data/spec/unit/type/file/group.rb +0 -0
- data/spec/unit/type/file/owner.rb +0 -0
- data/spec/unit/type/file/selinux.rb +6 -0
- data/spec/unit/type/group.rb +3 -0
- data/spec/unit/type/macauthorization.rb +0 -0
- data/spec/unit/type/mcx.rb +0 -0
- data/spec/unit/type/mount.rb +0 -0
- data/spec/unit/type/nagios.rb +0 -0
- data/spec/unit/type/noop_metaparam.rb +1 -0
- data/spec/unit/type/package.rb +0 -0
- data/spec/unit/type/schedule.rb +0 -0
- data/spec/unit/type/selboolean.rb +0 -0
- data/spec/unit/type/selmodule.rb +0 -0
- data/spec/unit/type/service.rb +0 -0
- data/spec/unit/type/ssh_authorized_key.rb +31 -8
- data/spec/unit/type/tidy.rb +4 -0
- data/spec/unit/type/user.rb +17 -0
- data/spec/unit/type/zfs.rb +0 -0
- data/spec/unit/type/zone.rb +0 -0
- data/spec/unit/type/zpool.rb +0 -0
- data/spec/unit/util/autoload.rb +39 -0
- data/spec/unit/util/checksums.rb +0 -0
- data/spec/unit/util/constant_inflector.rb +0 -0
- data/spec/unit/util/file_locking.rb +0 -0
- data/spec/unit/util/filetype.rb +110 -0
- data/spec/unit/util/ldap/connection.rb +0 -0
- data/spec/unit/util/ldap/generator.rb +0 -0
- data/spec/unit/util/ldap/manager.rb +0 -0
- data/spec/unit/util/loadedfile.rb +0 -0
- data/spec/unit/util/log.rb +0 -0
- data/spec/unit/util/metric.rb +0 -0
- data/spec/unit/util/nagios_maker.rb +32 -34
- data/spec/unit/util/package.rb +21 -0
- data/spec/unit/util/posix.rb +0 -0
- data/spec/unit/util/resource_template.rb +0 -0
- data/spec/unit/util/settings.rb +0 -0
- data/spec/unit/util/storage.rb +0 -0
- data/spec/unit/util/tagging.rb +0 -0
- data/spec/unit/util/uri_helper.rb +0 -0
- data/spec/unit/util/warnings.rb +0 -0
- data/test/certmgr/ca.rb +0 -0
- data/test/certmgr/certmgr.rb +0 -0
- data/test/certmgr/inventory.rb +0 -0
- data/test/certmgr/support.rb +0 -0
- data/test/data/snippets/subclass_name_duplication.pp +0 -0
- data/test/executables/filebucket.rb +6 -3
- data/test/executables/puppetbin.rb +1 -1
- data/test/executables/puppetca.rb +0 -0
- data/test/executables/puppetd.rb +0 -0
- data/test/executables/puppetmasterd.rb +0 -0
- data/test/executables/puppetmodule.rb +0 -0
- data/test/language/ast.rb +0 -0
- data/test/language/ast/casestatement.rb +0 -0
- data/test/language/ast/resource.rb +0 -0
- data/test/language/ast/resource_reference.rb +0 -0
- data/test/language/ast/selector.rb +0 -0
- data/test/language/ast/variable.rb +0 -0
- data/test/language/functions.rb +0 -0
- data/test/language/parser.rb +0 -0
- data/test/language/resource.rb +0 -40
- data/test/language/scope.rb +0 -0
- data/test/language/snippets.rb +0 -0
- data/test/language/transportable.rb +0 -0
- data/test/lib/puppettest.rb +3 -0
- data/test/lib/puppettest/support/resources.rb +0 -0
- data/test/network/authconfig.rb +0 -0
- data/test/network/authorization.rb +0 -0
- data/test/network/authstore.rb +0 -0
- data/test/network/client/ca.rb +0 -0
- data/test/network/client/client.rb +0 -0
- data/test/network/client/dipper.rb +0 -0
- data/test/network/client/master.rb +0 -0
- data/test/network/client/resource.rb +0 -0
- data/test/network/client_request.rb +0 -0
- data/test/network/daemon.rb +0 -0
- data/test/network/handler/bucket.rb +0 -0
- data/test/network/handler/ca.rb +0 -0
- data/test/network/handler/fileserver.rb +0 -0
- data/test/network/handler/handler.rb +0 -0
- data/test/network/handler/master.rb +0 -0
- data/test/network/handler/report.rb +0 -0
- data/test/network/handler/resource.rb +0 -0
- data/test/network/handler/runner.rb +0 -0
- data/test/network/rights.rb +0 -0
- data/test/network/server/mongrel_test.rb +0 -0
- data/test/network/server/webrick.rb +0 -0
- data/test/network/xmlrpc/client.rb +0 -0
- data/test/network/xmlrpc/processor.rb +0 -0
- data/test/network/xmlrpc/server.rb +0 -0
- data/test/network/xmlrpc/webrick_servlet.rb +0 -0
- data/test/other/dsl.rb +0 -0
- data/test/other/events.rb +0 -0
- data/test/other/overrides.rb +0 -0
- data/test/other/provider.rb +0 -0
- data/test/other/puppet.rb +0 -0
- data/test/other/relationships.rb +0 -0
- data/test/other/report.rb +0 -0
- data/test/other/transactions.rb +0 -0
- data/test/puppet/conffiles.rb +0 -0
- data/test/puppet/defaults.rb +0 -0
- data/test/puppet/errortest.rb +0 -0
- data/test/puppet/tc_suidmanager.rb +0 -0
- data/test/rails/ast.rb +0 -0
- data/test/rails/configuration.rb +0 -0
- data/test/rails/host.rb +0 -0
- data/test/rails/rails.rb +0 -0
- data/test/rails/railsparameter.rb +0 -0
- data/test/rails/railsresource.rb +0 -0
- data/test/ral/manager/attributes.rb +0 -0
- data/test/ral/manager/instances.rb +0 -0
- data/test/ral/manager/manager.rb +0 -0
- data/test/ral/manager/provider.rb +0 -0
- data/test/ral/manager/type.rb +0 -3
- data/test/ral/providers/cron/crontab.rb +0 -0
- data/test/ral/providers/group.rb +0 -0
- data/test/ral/providers/host/netinfo.rb +0 -0
- data/test/ral/providers/host/parsed.rb +0 -0
- data/test/ral/providers/mailalias/aliases.rb +0 -0
- data/test/ral/providers/mount/netinfo.rb +0 -0
- data/test/ral/providers/nameservice.rb +0 -0
- data/test/ral/providers/package.rb +0 -0
- data/test/ral/providers/package/aptitude.rb +0 -0
- data/test/ral/providers/package/aptrpm.rb +0 -0
- data/test/ral/providers/parsedfile.rb +0 -0
- data/test/ral/providers/port/parsed.rb +0 -0
- data/test/ral/providers/provider.rb +0 -0
- data/test/ral/providers/service/base.rb +0 -0
- data/test/ral/providers/service/debian.rb +0 -0
- data/test/ral/providers/sshkey/parsed.rb +0 -0
- data/test/ral/providers/user.rb +0 -0
- data/test/ral/providers/user/useradd.rb +0 -0
- data/test/ral/type/basic.rb +0 -0
- data/test/ral/type/cron.rb +0 -0
- data/test/ral/type/exec.rb +0 -0
- data/test/ral/type/file.rb +0 -0
- data/test/ral/type/file/target.rb +0 -0
- data/test/ral/type/filebucket.rb +0 -0
- data/test/ral/type/fileignoresource.rb +0 -0
- data/test/ral/type/filesources.rb +0 -0
- data/test/ral/type/group.rb +0 -0
- data/test/ral/type/host.rb +0 -0
- data/test/ral/type/mailalias.rb +0 -0
- data/test/ral/type/parameter.rb +0 -0
- data/test/ral/type/port.rb +0 -0
- data/test/ral/type/property.rb +0 -0
- data/test/ral/type/resources.rb +0 -0
- data/test/ral/type/service.rb +0 -0
- data/test/ral/type/sshkey.rb +0 -0
- data/test/ral/type/tidy.rb +0 -0
- data/test/ral/type/user.rb +0 -0
- data/test/ral/type/yumrepo.rb +0 -0
- data/test/ral/type/zone.rb +0 -0
- data/test/test +0 -0
- data/test/util/autoload.rb +0 -0
- data/test/util/classgen.rb +0 -0
- data/test/util/execution.rb +0 -0
- data/test/util/features.rb +0 -0
- data/test/util/fileparsing.rb +0 -0
- data/test/util/inifile.rb +0 -0
- data/test/util/instance_loader.rb +0 -0
- data/test/util/log.rb +0 -0
- data/test/util/metrics.rb +0 -0
- data/test/util/package.rb +0 -0
- data/test/util/pidlock.rb +0 -0
- data/test/util/settings.rb +0 -0
- data/test/util/storage.rb +0 -0
- data/test/util/subclass_loader.rb +0 -0
- data/test/util/utiltest.rb +0 -0
- metadata +981 -968
- data/test/util/filetype.rb +0 -137
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -7,6 +7,7 @@ require 'puppet/external/nagios'
|
|
7
7
|
|
8
8
|
# The base class for all Naginator providers.
|
9
9
|
class Puppet::Provider::Naginator < Puppet::Provider::ParsedFile
|
10
|
+
NAME_STRING = "## --PUPPET_NAME-- (called '_naginator_name' in the manifest)"
|
10
11
|
# Retrieve the associated class from Nagios::Base.
|
11
12
|
def self.nagios_type
|
12
13
|
unless defined?(@nagios_type) and @nagios_type
|
@@ -23,11 +24,15 @@ class Puppet::Provider::Naginator < Puppet::Provider::ParsedFile
|
|
23
24
|
end
|
24
25
|
|
25
26
|
def self.parse(text)
|
26
|
-
|
27
|
+
begin
|
28
|
+
Nagios::Parser.new.parse(text.gsub(NAME_STRING, "_naginator_name"))
|
29
|
+
rescue => detail
|
30
|
+
raise Puppet::Error, "Could not parse configuration for %s: %s" % [resource_type.name, detail]
|
31
|
+
end
|
27
32
|
end
|
28
33
|
|
29
34
|
def self.to_file(records)
|
30
|
-
header + records.collect { |record| record.to_s }.join("\n")
|
35
|
+
header + records.collect { |record| record.to_s }.join("\n").gsub("_naginator_name", NAME_STRING)
|
31
36
|
end
|
32
37
|
|
33
38
|
def self.skip_record?(record)
|
@@ -15,6 +15,7 @@
|
|
15
15
|
require 'puppet'
|
16
16
|
require 'puppet/provider/nameservice'
|
17
17
|
require 'facter/util/plist'
|
18
|
+
require 'cgi'
|
18
19
|
|
19
20
|
|
20
21
|
class Puppet::Provider::NameService
|
@@ -26,6 +27,7 @@ class DirectoryService < Puppet::Provider::NameService
|
|
26
27
|
# e.g. Puppet::Type.type(:user).provide :directoryservice, :ds_path => "Users"
|
27
28
|
# This is referenced in the get_ds_path class method
|
28
29
|
attr_writer :ds_path
|
30
|
+
attr_writer :macosx_version_major
|
29
31
|
end
|
30
32
|
|
31
33
|
|
@@ -40,6 +42,7 @@ class DirectoryService < Puppet::Provider::NameService
|
|
40
42
|
|
41
43
|
commands :dscl => "/usr/bin/dscl"
|
42
44
|
commands :dseditgroup => "/usr/sbin/dseditgroup"
|
45
|
+
commands :sw_vers => "/usr/bin/sw_vers"
|
43
46
|
confine :operatingsystem => :darwin
|
44
47
|
defaultfor :operatingsystem => :darwin
|
45
48
|
|
@@ -100,12 +103,31 @@ class DirectoryService < Puppet::Provider::NameService
|
|
100
103
|
# @ds_path is an attribute of the class itself.
|
101
104
|
if defined? @ds_path
|
102
105
|
return @ds_path
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
106
|
+
end
|
107
|
+
# JJM: "Users" or "Groups" etc ... (Based on the Puppet::Type)
|
108
|
+
# Remember this is a class method, so self.class is Class
|
109
|
+
# Also, @resource_type seems to be the reference to the
|
110
|
+
# Puppet::Type this class object is providing for.
|
111
|
+
return @resource_type.name.to_s.capitalize + "s"
|
112
|
+
end
|
113
|
+
|
114
|
+
def self.get_macosx_version_major
|
115
|
+
if defined? @macosx_version_major
|
116
|
+
return @macosx_version_major
|
117
|
+
end
|
118
|
+
begin
|
119
|
+
product_version = Facter.value(:macosx_productversion)
|
120
|
+
if product_version.nil?
|
121
|
+
raise Puppet::Error, "Could not determine OS X version"
|
122
|
+
end
|
123
|
+
product_version_major = product_version.scan(/(\d+)\.(\d+)./).join(".")
|
124
|
+
if %w{10.0 10.1 10.2 10.3}.include?(product_version_major)
|
125
|
+
raise Puppet::Error, "%s is not supported by the directoryservice provider" % product_version_major
|
126
|
+
end
|
127
|
+
@macosx_version_major = product_version_major
|
128
|
+
return @macosx_version_major
|
129
|
+
rescue Puppet::ExecutionFailure => detail
|
130
|
+
raise Puppet::Error, "Could not determine OS X version: %s" % detail
|
109
131
|
end
|
110
132
|
end
|
111
133
|
|
@@ -119,34 +141,56 @@ class DirectoryService < Puppet::Provider::NameService
|
|
119
141
|
return dscl_output.split("\n")
|
120
142
|
end
|
121
143
|
|
122
|
-
def self.
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
#
|
127
|
-
#
|
128
|
-
#
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
# NBK: shortcut the process if the resource is missing
|
133
|
-
return nil unless all_present_str_array.include? resource_name
|
144
|
+
def self.parse_dscl_url_data(dscl_output)
|
145
|
+
# we need to construct a Hash from the dscl -url output to match
|
146
|
+
# that returned by the dscl -plist output for 10.5+ clients.
|
147
|
+
#
|
148
|
+
# Nasty assumptions:
|
149
|
+
# a) no values *end* in a colon ':', only keys
|
150
|
+
# b) if a line ends in a colon and the next line does start with
|
151
|
+
# a space, then the second line is a value of the first.
|
152
|
+
# c) (implied by (b)) keys don't start with spaces.
|
134
153
|
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
154
|
+
dscl_plist = {}
|
155
|
+
dscl_output.split("\n").inject([]) do |array, line|
|
156
|
+
if line =~ /^\s+/ # it's a value
|
157
|
+
array[-1] << line # add the value to the previous key
|
158
|
+
else
|
159
|
+
array << line
|
160
|
+
end
|
161
|
+
array
|
162
|
+
end.compact
|
163
|
+
|
164
|
+
dscl_output.each do |line|
|
165
|
+
# This should be a 'normal' entry. key and value on one line.
|
166
|
+
# We split on ': ' to deal with keys/values with a colon in them.
|
167
|
+
split_array = line.split(/:\s+/)
|
168
|
+
key = split_array.first
|
169
|
+
value = CGI::unescape(split_array.last.strip.chomp)
|
170
|
+
# We need to treat GroupMembership separately as it is currently
|
171
|
+
# the only attribute we care about multiple values for, and
|
172
|
+
# the values can never contain spaces (shortnames)
|
173
|
+
# We also make every value an array to be consistent with the
|
174
|
+
# output of dscl -plist under 10.5
|
175
|
+
if key == "GroupMembership"
|
176
|
+
dscl_plist[key] = value.split(/\s/)
|
177
|
+
else
|
178
|
+
dscl_plist[key] = [value]
|
179
|
+
end
|
140
180
|
end
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
181
|
+
return dscl_plist
|
182
|
+
end
|
183
|
+
|
184
|
+
def self.parse_dscl_plist_data(dscl_output)
|
185
|
+
return Plist.parse_xml(dscl_output)
|
186
|
+
end
|
187
|
+
|
188
|
+
def self.generate_attribute_hash(input_hash, *type_properties)
|
189
|
+
attribute_hash = {}
|
190
|
+
input_hash.keys().each do |key|
|
147
191
|
ds_attribute = key.sub("dsAttrTypeStandard:", "")
|
148
192
|
next unless (@@ds_to_ns_attribute_map.keys.include?(ds_attribute) and type_properties.include? @@ds_to_ns_attribute_map[ds_attribute])
|
149
|
-
ds_value =
|
193
|
+
ds_value = input_hash[key]
|
150
194
|
case @@ds_to_ns_attribute_map[ds_attribute]
|
151
195
|
when :members:
|
152
196
|
ds_value = ds_value # only members uses arrays so far
|
@@ -172,7 +216,41 @@ class DirectoryService < Puppet::Provider::NameService
|
|
172
216
|
if @resource_type.validproperties.include?(:password)
|
173
217
|
attribute_hash[:password] = self.get_password(attribute_hash[:guid])
|
174
218
|
end
|
175
|
-
return attribute_hash
|
219
|
+
return attribute_hash
|
220
|
+
end
|
221
|
+
|
222
|
+
def self.single_report(resource_name, *type_properties)
|
223
|
+
# JJM 2007-07-24:
|
224
|
+
# Given a the name of an object and a list of properties of that
|
225
|
+
# object, return all property values in a hash.
|
226
|
+
#
|
227
|
+
# This class method returns nil if the object doesn't exist
|
228
|
+
# Otherwise, it returns a hash of the object properties.
|
229
|
+
|
230
|
+
all_present_str_array = list_all_present()
|
231
|
+
|
232
|
+
# NBK: shortcut the process if the resource is missing
|
233
|
+
return nil unless all_present_str_array.include? resource_name
|
234
|
+
|
235
|
+
dscl_vector = get_exec_preamble("-read", resource_name)
|
236
|
+
begin
|
237
|
+
dscl_output = execute(dscl_vector)
|
238
|
+
rescue Puppet::ExecutionFailure => detail
|
239
|
+
raise Puppet::Error, "Could not get report. command execution failed."
|
240
|
+
end
|
241
|
+
|
242
|
+
# Two code paths is ugly, but until we can drop 10.4 support we don't
|
243
|
+
# have a lot of choice. Ultimately this should all be done using Ruby
|
244
|
+
# to access the DirectoryService APIs directly, but that's simply not
|
245
|
+
# feasible for a while yet.
|
246
|
+
case self.get_macosx_version_major
|
247
|
+
when "10.4"
|
248
|
+
dscl_plist = self.parse_dscl_url_data(dscl_output)
|
249
|
+
when "10.5", "10.6"
|
250
|
+
dscl_plist = self.parse_dscl_plist_data(dscl_output)
|
251
|
+
end
|
252
|
+
|
253
|
+
return self.generate_attribute_hash(dscl_plist, *type_properties)
|
176
254
|
end
|
177
255
|
|
178
256
|
def self.get_exec_preamble(ds_action, resource_name = nil)
|
@@ -183,8 +261,16 @@ class DirectoryService < Puppet::Provider::NameService
|
|
183
261
|
# This method spits out proper DSCL commands for us.
|
184
262
|
# We EXPECT name to be @resource[:name] when called from an instance object.
|
185
263
|
|
186
|
-
#
|
187
|
-
|
264
|
+
# 10.4 doesn't support the -plist option for dscl, and 10.5 has a
|
265
|
+
# different format for the -url output with objects with spaces in
|
266
|
+
# their values. *sigh*. Use -url for 10.4 in the hope this can be
|
267
|
+
# deprecated one day, and use -plist for 10.5 and higher.
|
268
|
+
case self.get_macosx_version_major
|
269
|
+
when "10.4"
|
270
|
+
command_vector = [ command(:dscl), "-url", "." ]
|
271
|
+
when "10.5", "10.6"
|
272
|
+
command_vector = [ command(:dscl), "-plist", "." ]
|
273
|
+
end
|
188
274
|
# JJM: The actual action to perform. See "man dscl"
|
189
275
|
# Common actiosn: -create, -delete, -merge, -append, -passwd
|
190
276
|
command_vector << ds_action
|
@@ -234,15 +320,14 @@ class DirectoryService < Puppet::Provider::NameService
|
|
234
320
|
def self.get_password(guid)
|
235
321
|
password_hash = nil
|
236
322
|
password_hash_file = "#{@@password_hash_dir}/#{guid}"
|
237
|
-
|
238
|
-
if File.exists?(password_hash_file)
|
323
|
+
if File.exists?(password_hash_file) and File.file?(password_hash_file)
|
239
324
|
if not File.readable?(password_hash_file)
|
240
325
|
raise Puppet::Error("Could not read password hash file at #{password_hash_file} for #{@resource[:name]}")
|
241
326
|
end
|
242
327
|
f = File.new(password_hash_file)
|
243
328
|
password_hash = f.read
|
244
329
|
f.close
|
245
|
-
|
330
|
+
end
|
246
331
|
password_hash
|
247
332
|
end
|
248
333
|
|
@@ -322,9 +407,8 @@ class DirectoryService < Puppet::Provider::NameService
|
|
322
407
|
# to create objects with dscl, rather than the single command nameservice.rb
|
323
408
|
# expects to be returned by addcmd. Thus we don't bother defining addcmd.
|
324
409
|
def create
|
325
|
-
|
410
|
+
if exists?
|
326
411
|
info "already exists"
|
327
|
-
# The object already exists
|
328
412
|
return nil
|
329
413
|
end
|
330
414
|
|
@@ -373,25 +457,25 @@ class DirectoryService < Puppet::Provider::NameService
|
|
373
457
|
|
374
458
|
def remove_unwanted_members(current_members, new_members)
|
375
459
|
current_members.each do |member|
|
376
|
-
if not
|
460
|
+
if not new_members.include?(member)
|
377
461
|
cmd = [:dseditgroup, "-o", "edit", "-n", ".", "-d", member, @resource[:name]]
|
378
462
|
begin
|
379
463
|
execute(cmd)
|
380
464
|
rescue Puppet::ExecutionFailure => detail
|
381
|
-
raise Puppet::Error, "Could not
|
465
|
+
raise Puppet::Error, "Could not remove %s from group: %s, %s" % [member, @resource.name, detail]
|
382
466
|
end
|
383
467
|
end
|
384
468
|
end
|
385
469
|
end
|
386
470
|
|
387
471
|
def add_members(current_members, new_members)
|
388
|
-
new_members.each do |
|
389
|
-
if current_members.nil? or not current_members.include?(
|
390
|
-
cmd = [:dseditgroup, "-o", "edit", "-n", ".", "-a",
|
472
|
+
new_members.each do |new_member|
|
473
|
+
if current_members.nil? or not current_members.include?(new_member)
|
474
|
+
cmd = [:dseditgroup, "-o", "edit", "-n", ".", "-a", new_member, @resource[:name]]
|
391
475
|
begin
|
392
476
|
execute(cmd)
|
393
477
|
rescue Puppet::ExecutionFailure => detail
|
394
|
-
raise Puppet::Error, "Could not
|
478
|
+
raise Puppet::Error, "Could not add %s to group: %s, %s" % [new_member, @resource.name, detail]
|
395
479
|
end
|
396
480
|
end
|
397
481
|
end
|
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
|
File without changes
|
File without changes
|
File without changes
|
@@ -3,9 +3,11 @@ Puppet.type(:package).provide :up2date, :parent => :rpm, :source => :rpm do
|
|
3
3
|
mechanism."
|
4
4
|
|
5
5
|
commands :up2date => "/usr/sbin/up2date-nox"
|
6
|
-
|
6
|
+
|
7
|
+
defaultfor :operatingsystem => [:redhat, :oel, :ovm],
|
7
8
|
:lsbdistrelease => ["2.1", "3", "4"]
|
8
|
-
|
9
|
+
|
10
|
+
confine :operatingsystem => [:redhat, :oel, :ovm]
|
9
11
|
|
10
12
|
# Install a package using 'up2date'.
|
11
13
|
def install
|
File without changes
|
@@ -78,8 +78,24 @@ class Puppet::Provider::ParsedFile < Puppet::Provider
|
|
78
78
|
@modified.reject! { |t| flushed.include?(t) }
|
79
79
|
end
|
80
80
|
|
81
|
+
# Make sure our file is backed up, but only back it up once per transaction.
|
82
|
+
# We cheat and rely on the fact that @records is created on each prefetch.
|
83
|
+
def self.backup_target(target)
|
84
|
+
return nil unless target_object(target).respond_to?(:backup)
|
85
|
+
|
86
|
+
unless defined?(@backup_stats)
|
87
|
+
@backup_stats = {}
|
88
|
+
end
|
89
|
+
return nil if @backup_stats[target] == @records.object_id
|
90
|
+
|
91
|
+
target_object(target).backup
|
92
|
+
@backup_stats[target] = @records.object_id
|
93
|
+
end
|
94
|
+
|
81
95
|
# Flush all of the records relating to a specific target.
|
82
96
|
def self.flush_target(target)
|
97
|
+
backup_target(target)
|
98
|
+
|
83
99
|
records = target_records(target).reject { |r|
|
84
100
|
r[:ensure] == :absent
|
85
101
|
}
|
@@ -108,10 +124,11 @@ class Puppet::Provider::ParsedFile < Puppet::Provider
|
|
108
124
|
|
109
125
|
# Return a list of all of the records we can find.
|
110
126
|
def self.instances
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
127
|
+
targets.collect do |target|
|
128
|
+
prefetch_target(target)
|
129
|
+
end.flatten.reject { |r| skip_record?(r) }.collect do |record|
|
130
|
+
new(record)
|
131
|
+
end
|
115
132
|
end
|
116
133
|
|
117
134
|
# Override the default method with a lot more functionality.
|
@@ -171,31 +188,39 @@ class Puppet::Provider::ParsedFile < Puppet::Provider
|
|
171
188
|
# resource instance.
|
172
189
|
def self.prefetch(resources = nil)
|
173
190
|
# Reset the record list.
|
174
|
-
@records =
|
175
|
-
targets(resources).each do |target|
|
176
|
-
@records += prefetch_target(target)
|
177
|
-
end
|
191
|
+
@records = prefetch_all_targets(resources)
|
178
192
|
|
179
|
-
|
180
|
-
|
181
|
-
@records.each do |record|
|
182
|
-
# Skip things like comments and blank lines
|
183
|
-
next if skip_record?(record)
|
193
|
+
match_providers_with_resources(resources)
|
194
|
+
end
|
184
195
|
|
185
|
-
|
196
|
+
def self.match_providers_with_resources(resources)
|
197
|
+
return unless resources
|
198
|
+
matchers = resources.dup
|
199
|
+
@records.each do |record|
|
200
|
+
# Skip things like comments and blank lines
|
201
|
+
next if skip_record?(record)
|
202
|
+
|
203
|
+
if name = record[:name] and resource = resources[name]
|
204
|
+
resource.provider = new(record)
|
205
|
+
elsif respond_to?(:match)
|
206
|
+
if resource = match(record, matchers)
|
207
|
+
# Remove this resource from circulation so we don't unnecessarily try to match
|
208
|
+
matchers.delete(resource.title)
|
209
|
+
record[:name] = resource[:name]
|
186
210
|
resource.provider = new(record)
|
187
|
-
elsif respond_to?(:match)
|
188
|
-
if resource = match(record, matchers)
|
189
|
-
# Remove this resource from circulation so we don't unnecessarily try to match
|
190
|
-
matchers.delete(resource.title)
|
191
|
-
record[:name] = resource[:name]
|
192
|
-
resource.provider = new(record)
|
193
|
-
end
|
194
211
|
end
|
195
212
|
end
|
196
213
|
end
|
197
214
|
end
|
198
215
|
|
216
|
+
def self.prefetch_all_targets(resources)
|
217
|
+
records = []
|
218
|
+
targets(resources).each do |target|
|
219
|
+
records += prefetch_target(target)
|
220
|
+
end
|
221
|
+
records
|
222
|
+
end
|
223
|
+
|
199
224
|
# Prefetch an individual target.
|
200
225
|
def self.prefetch_target(target)
|
201
226
|
target_records = retrieve(target).each do |r|
|
@@ -217,6 +242,7 @@ class Puppet::Provider::ParsedFile < Puppet::Provider
|
|
217
242
|
|
218
243
|
# Is there an existing record with this name?
|
219
244
|
def self.record?(name)
|
245
|
+
return nil unless @records
|
220
246
|
@records.find { |r| r[:name] == name }
|
221
247
|
end
|
222
248
|
|
@@ -367,4 +393,3 @@ class Puppet::Provider::ParsedFile < Puppet::Provider
|
|
367
393
|
end
|
368
394
|
end
|
369
395
|
end
|
370
|
-
|