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
|
@@ -38,7 +38,7 @@ Puppet::Type.type(:service).provide :gentoo, :parent => :init do
|
|
38
38
|
return :false unless line
|
39
39
|
|
40
40
|
# If it's enabled then it will print output showing service | runlevel
|
41
|
-
if output =~ /#{@resource[:name]}\s*\|\s*default/
|
41
|
+
if output =~ /#{@resource[:name]}\s*\|\s*(boot|default)/
|
42
42
|
return :true
|
43
43
|
else
|
44
44
|
return :false
|
File without changes
|
@@ -103,12 +103,21 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do
|
|
103
103
|
|
104
104
|
def status
|
105
105
|
# launchctl list <jobname> exits zero if the job is loaded
|
106
|
-
# and non-zero if it isn't. Simple way to check...
|
106
|
+
# and non-zero if it isn't. Simple way to check... but is only
|
107
|
+
# available on OS X 10.5 unfortunately, so we grab the whole list
|
108
|
+
# and check if our resource is included. The output formats differ
|
109
|
+
# between 10.4 and 10.5, thus the necessity for splitting
|
107
110
|
begin
|
108
|
-
launchctl :list
|
109
|
-
|
110
|
-
|
111
|
+
output = launchctl :list
|
112
|
+
if output.nil?
|
113
|
+
raise Puppet::Error.new("launchctl list failed to return any data.")
|
114
|
+
end
|
115
|
+
output.split("\n").each do |j|
|
116
|
+
return :running if j.split(/\s/).last == resource[:name]
|
117
|
+
end
|
111
118
|
return :stopped
|
119
|
+
rescue Puppet::ExecutionFailure
|
120
|
+
raise Puppet::Error.new("Unable to determine status of #{resource[:name]}")
|
112
121
|
end
|
113
122
|
end
|
114
123
|
|
@@ -9,7 +9,7 @@ Puppet::Type.type(:service).provide :redhat, :parent => :init do
|
|
9
9
|
|
10
10
|
commands :chkconfig => "/sbin/chkconfig", :service => "/sbin/service"
|
11
11
|
|
12
|
-
defaultfor :operatingsystem => [:redhat, :fedora, :suse, :centos, :sles]
|
12
|
+
defaultfor :operatingsystem => [:redhat, :fedora, :suse, :centos, :sles, :oel, :ovm]
|
13
13
|
|
14
14
|
def self.defpath
|
15
15
|
superclass.defpath
|
@@ -73,12 +73,12 @@ Puppet::Type.type(:service).provide :redhat, :parent => :init do
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
def
|
77
|
-
service
|
76
|
+
def startcmd
|
77
|
+
[command(:service), @resource[:name], "start"]
|
78
78
|
end
|
79
79
|
|
80
|
-
def
|
81
|
-
service
|
80
|
+
def stopcmd
|
81
|
+
[command(:service), @resource[:name], "stop"]
|
82
82
|
end
|
83
83
|
|
84
84
|
end
|
File without changes
|
@@ -36,29 +36,46 @@ Puppet::Type.type(:ssh_authorized_key).provide(:parsed,
|
|
36
36
|
:rts => /^\s+/,
|
37
37
|
:match => /^(?:(.+) )?(\d+) (\d+) (\d+)(?: (.+))?$/
|
38
38
|
|
39
|
-
def
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
39
|
+
def target
|
40
|
+
@resource.should(:target)
|
41
|
+
end
|
42
|
+
|
43
|
+
def user
|
44
|
+
@resource.should(:user)
|
45
|
+
end
|
46
|
+
|
47
|
+
def dir_perm
|
48
|
+
# Determine correct permission for created directory and file
|
49
|
+
# we can afford more restrictive permissions when the user is known
|
50
|
+
if target
|
51
|
+
if user
|
52
|
+
0700
|
53
|
+
else
|
54
|
+
0755
|
55
|
+
end
|
47
56
|
end
|
57
|
+
end
|
48
58
|
|
49
|
-
|
59
|
+
def file_perm
|
60
|
+
if target
|
61
|
+
if user
|
62
|
+
0600
|
63
|
+
else
|
64
|
+
0644
|
65
|
+
end
|
66
|
+
end
|
50
67
|
end
|
51
68
|
|
52
69
|
def flush
|
53
70
|
# As path expansion had to be moved in the provider, we cannot generate new file
|
54
71
|
# resources and thus have to chown and chmod here. It smells hackish.
|
55
|
-
|
72
|
+
|
56
73
|
# Create target's parent directory if nonexistant
|
57
|
-
if target
|
58
|
-
dir = File.dirname(
|
74
|
+
if target
|
75
|
+
dir = File.dirname(target)
|
59
76
|
if not File.exist? dir
|
60
77
|
Puppet.debug("Creating directory %s which did not exist" % dir)
|
61
|
-
Dir.mkdir(dir,
|
78
|
+
Dir.mkdir(dir, dir_perm)
|
62
79
|
end
|
63
80
|
end
|
64
81
|
|
@@ -66,9 +83,19 @@ Puppet::Type.type(:ssh_authorized_key).provide(:parsed,
|
|
66
83
|
super
|
67
84
|
|
68
85
|
# Ensure correct permissions
|
69
|
-
if target and user
|
70
|
-
|
71
|
-
|
86
|
+
if target and user
|
87
|
+
uid = Puppet::Util.uid(user)
|
88
|
+
|
89
|
+
if uid
|
90
|
+
File.chown(uid, nil, dir)
|
91
|
+
File.chown(uid, nil, target)
|
92
|
+
else
|
93
|
+
raise Puppet::Error, "Specified user does not exist"
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
97
|
+
if target
|
98
|
+
File.chmod(file_perm, target)
|
72
99
|
end
|
73
100
|
end
|
74
101
|
|
File without changes
|
@@ -31,7 +31,7 @@ Puppet::Type.type(:user).provide :useradd, :parent => Puppet::Provider::NameServ
|
|
31
31
|
cmd = []
|
32
32
|
if @resource.managehome?
|
33
33
|
cmd << "-m"
|
34
|
-
elsif %w{Fedora RedHat}.include?(Facter.value("operatingsystem"))
|
34
|
+
elsif %w{Fedora RedHat CentOS OEL OVS}.include?(Facter.value("operatingsystem"))
|
35
35
|
cmd << "-M"
|
36
36
|
end
|
37
37
|
cmd
|
@@ -1,9 +1,13 @@
|
|
1
1
|
class AddEnvironmentToHost < ActiveRecord::Migration
|
2
2
|
def self.up
|
3
|
-
|
3
|
+
unless ActiveRecord::Base.connection.columns(:hosts).collect {|c| c.name}.include?("environment")
|
4
|
+
add_column :hosts, :environment, :string
|
5
|
+
end
|
4
6
|
end
|
5
7
|
|
6
8
|
def self.down
|
7
|
-
|
9
|
+
if ActiveRecord::Base.connection.columns(:hosts).collect {|c| c.name}.include?("environment")
|
10
|
+
remove_column :hosts, :environment
|
11
|
+
end
|
8
12
|
end
|
9
13
|
end
|
data/lib/puppet/rails/host.rb
CHANGED
@@ -3,8 +3,6 @@ require 'puppet/rails/fact_name'
|
|
3
3
|
require 'puppet/rails/source_file'
|
4
4
|
require 'puppet/util/rails/collection_merger'
|
5
5
|
|
6
|
-
# Puppet::TIME_DEBUG = true
|
7
|
-
|
8
6
|
class Puppet::Rails::Host < ActiveRecord::Base
|
9
7
|
include Puppet::Util
|
10
8
|
include Puppet::Util::CollectionMerger
|
@@ -12,9 +10,7 @@ class Puppet::Rails::Host < ActiveRecord::Base
|
|
12
10
|
has_many :fact_values, :dependent => :destroy
|
13
11
|
has_many :fact_names, :through => :fact_values
|
14
12
|
belongs_to :source_file
|
15
|
-
has_many :resources,
|
16
|
-
:include => :param_values,
|
17
|
-
:dependent => :destroy
|
13
|
+
has_many :resources, :dependent => :destroy
|
18
14
|
|
19
15
|
# If the host already exists, get rid of its objects
|
20
16
|
def self.clean(host)
|
@@ -38,7 +34,7 @@ class Puppet::Rails::Host < ActiveRecord::Base
|
|
38
34
|
host = new(:name => node.name)
|
39
35
|
end
|
40
36
|
}
|
41
|
-
Puppet.
|
37
|
+
Puppet.debug("Searched for host in %0.2f seconds" % seconds)
|
42
38
|
if ip = node.parameters["ipaddress"]
|
43
39
|
host.ip = ip
|
44
40
|
end
|
@@ -53,7 +49,7 @@ class Puppet::Rails::Host < ActiveRecord::Base
|
|
53
49
|
seconds = Benchmark.realtime {
|
54
50
|
host.setresources(resources)
|
55
51
|
}
|
56
|
-
Puppet.
|
52
|
+
Puppet.debug("Handled resources in %0.2f seconds" % seconds)
|
57
53
|
|
58
54
|
host.last_compile = Time.now
|
59
55
|
|
@@ -117,27 +113,60 @@ class Puppet::Rails::Host < ActiveRecord::Base
|
|
117
113
|
|
118
114
|
# Set our resources.
|
119
115
|
def setresources(list)
|
120
|
-
|
116
|
+
resource_by_id = nil
|
121
117
|
seconds = Benchmark.realtime {
|
118
|
+
resource_by_id = find_resources()
|
119
|
+
}
|
120
|
+
Puppet.debug("Searched for resources in %0.2f seconds" % seconds)
|
122
121
|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
end
|
122
|
+
seconds = Benchmark.realtime {
|
123
|
+
find_resources_parameters_tags(resource_by_id)
|
124
|
+
} if id
|
125
|
+
Puppet.debug("Searched for resource params and tags in %0.2f seconds" % seconds)
|
126
|
+
|
127
|
+
seconds = Benchmark.realtime {
|
128
|
+
compare_to_catalog(resource_by_id, list)
|
131
129
|
}
|
130
|
+
Puppet.debug("Resource comparison took %0.2f seconds" % seconds)
|
131
|
+
end
|
132
|
+
|
133
|
+
def find_resources
|
134
|
+
resources.find(:all, :include => :source_file).inject({}) do | hash, resource |
|
135
|
+
hash[resource.id] = resource
|
136
|
+
hash
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
def find_resources_parameters_tags(resources)
|
141
|
+
# initialize all resource parameters
|
142
|
+
resources.each do |key,resource|
|
143
|
+
resource.params_hash = []
|
144
|
+
end
|
132
145
|
|
133
|
-
|
146
|
+
find_resources_parameters(resources)
|
147
|
+
find_resources_tags(resources)
|
148
|
+
end
|
149
|
+
|
150
|
+
# it seems that it can happen (see bug #2010) some resources are duplicated in the
|
151
|
+
# database (ie logically corrupted database), in which case we remove the extraneous
|
152
|
+
# entries.
|
153
|
+
def compare_to_catalog(existing, list)
|
154
|
+
extra_db_resources = []
|
155
|
+
resources = existing.inject({}) do |hash, res|
|
156
|
+
resource = res[1]
|
157
|
+
if hash.include?(resource.ref)
|
158
|
+
extra_db_resources << hash[resource.ref]
|
159
|
+
end
|
160
|
+
hash[resource.ref] = resource
|
161
|
+
hash
|
162
|
+
end
|
134
163
|
|
135
164
|
compiled = list.inject({}) do |hash, resource|
|
136
165
|
hash[resource.ref] = resource
|
137
166
|
hash
|
138
167
|
end
|
139
|
-
|
140
|
-
ar_hash_merge(
|
168
|
+
|
169
|
+
ar_hash_merge(resources, compiled,
|
141
170
|
:create => Proc.new { |ref, resource|
|
142
171
|
resource.to_rails(self)
|
143
172
|
}, :delete => Proc.new { |resource|
|
@@ -145,6 +174,28 @@ class Puppet::Rails::Host < ActiveRecord::Base
|
|
145
174
|
}, :modify => Proc.new { |db, mem|
|
146
175
|
mem.modify_rails(db)
|
147
176
|
})
|
177
|
+
|
178
|
+
# fix-up extraneous resources
|
179
|
+
extra_db_resources.each do |resource|
|
180
|
+
self.resources.delete(resource)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
184
|
+
def find_resources_parameters(resources)
|
185
|
+
params = Puppet::Rails::ParamValue.find_all_params_from_host(self)
|
186
|
+
|
187
|
+
# assign each loaded parameters/tags to the resource it belongs to
|
188
|
+
params.each do |param|
|
189
|
+
resources[param['resource_id']].add_param_to_hash(param) if resources.include?(param['resource_id'])
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
def find_resources_tags(resources)
|
194
|
+
tags = Puppet::Rails::ResourceTag.find_all_tags_from_host(self)
|
195
|
+
|
196
|
+
tags.each do |tag|
|
197
|
+
resources[tag['resource_id']].add_tag_to_hash(tag) if resources.include?(tag['resource_id'])
|
198
|
+
end
|
148
199
|
end
|
149
200
|
|
150
201
|
def update_connect_time
|
@@ -1,28 +1,47 @@
|
|
1
|
+
require 'puppet/util/rails/reference_serializer'
|
2
|
+
|
1
3
|
class Puppet::Rails::ParamValue < ActiveRecord::Base
|
4
|
+
include Puppet::Util::ReferenceSerializer
|
5
|
+
extend Puppet::Util::ReferenceSerializer
|
6
|
+
|
2
7
|
belongs_to :param_name
|
3
8
|
belongs_to :resource
|
4
9
|
|
5
10
|
def value
|
6
|
-
|
7
|
-
if val =~ /^--- \!/
|
8
|
-
YAML.load(val)
|
9
|
-
else
|
10
|
-
val
|
11
|
-
end
|
11
|
+
unserialize_value(self[:value])
|
12
12
|
end
|
13
13
|
|
14
14
|
# I could not find a cleaner way to handle making sure that resource references
|
15
15
|
# were consistently serialized and deserialized.
|
16
16
|
def value=(val)
|
17
|
-
|
18
|
-
self[:value] = YAML.dump(val)
|
19
|
-
else
|
20
|
-
self[:value] = val
|
21
|
-
end
|
17
|
+
self[:value] = serialize_value(val)
|
22
18
|
end
|
23
19
|
|
24
20
|
def to_label
|
25
21
|
"#{self.param_name.name}"
|
26
|
-
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# returns an array of hash containing all the parameters of a given resource
|
25
|
+
def self.find_all_params_from_resource(db_resource)
|
26
|
+
params = db_resource.connection.select_all("SELECT v.id, v.value, v.line, v.resource_id, v.param_name_id, n.name FROM param_values as v INNER JOIN param_names as n ON v.param_name_id=n.id WHERE v.resource_id=%s" % db_resource.id)
|
27
|
+
params.each do |val|
|
28
|
+
val['value'] = unserialize_value(val['value'])
|
29
|
+
val['line'] = val['line'] ? Integer(val['line']) : nil
|
30
|
+
val['resource_id'] = Integer(val['resource_id'])
|
31
|
+
end
|
32
|
+
params
|
33
|
+
end
|
34
|
+
|
35
|
+
# returns an array of hash containing all the parameters of a given host
|
36
|
+
def self.find_all_params_from_host(db_host)
|
37
|
+
params = db_host.connection.select_all("SELECT v.id, v.value, v.line, v.resource_id, v.param_name_id, n.name FROM param_values as v INNER JOIN resources r ON v.resource_id=r.id INNER JOIN param_names as n ON v.param_name_id=n.id WHERE r.host_id=%s" % db_host.id)
|
38
|
+
params.each do |val|
|
39
|
+
val['value'] = unserialize_value(val['value'])
|
40
|
+
val['line'] = val['line'] ? Integer(val['line']) : nil
|
41
|
+
val['resource_id'] = Integer(val['resource_id'])
|
42
|
+
end
|
43
|
+
params
|
44
|
+
end
|
45
|
+
|
27
46
|
end
|
28
47
|
|
@@ -1,10 +1,12 @@
|
|
1
1
|
require 'puppet'
|
2
2
|
require 'puppet/rails/param_name'
|
3
|
+
require 'puppet/rails/param_value'
|
3
4
|
require 'puppet/rails/puppet_tag'
|
4
5
|
require 'puppet/util/rails/collection_merger'
|
5
6
|
|
6
7
|
class Puppet::Rails::Resource < ActiveRecord::Base
|
7
8
|
include Puppet::Util::CollectionMerger
|
9
|
+
include Puppet::Util::ReferenceSerializer
|
8
10
|
|
9
11
|
has_many :param_values, :dependent => :destroy, :class_name => "Puppet::Rails::ParamValue"
|
10
12
|
has_many :param_names, :through => :param_values, :class_name => "Puppet::Rails::ParamName"
|
@@ -32,21 +34,46 @@ class Puppet::Rails::Resource < ActiveRecord::Base
|
|
32
34
|
self.source_file = Puppet::Rails::SourceFile.find_or_create_by_filename(file)
|
33
35
|
end
|
34
36
|
|
37
|
+
def title
|
38
|
+
unserialize_value(self[:title])
|
39
|
+
end
|
40
|
+
|
41
|
+
def add_param_to_hash(param)
|
42
|
+
@params_hash ||= []
|
43
|
+
@params_hash << param
|
44
|
+
end
|
45
|
+
|
46
|
+
def add_tag_to_hash(tag)
|
47
|
+
@tags_hash ||= []
|
48
|
+
@tags_hash << tag
|
49
|
+
end
|
50
|
+
|
51
|
+
def params_hash=(hash)
|
52
|
+
@params_hash = hash
|
53
|
+
end
|
54
|
+
|
55
|
+
def tags_hash=(hash)
|
56
|
+
@tags_hash = hash
|
57
|
+
end
|
58
|
+
|
35
59
|
# returns a hash of param_names.name => [param_values]
|
36
60
|
def get_params_hash(values = nil)
|
37
|
-
values ||=
|
38
|
-
values.
|
39
|
-
|
40
|
-
|
61
|
+
values ||= @params_hash || Puppet::Rails::ParamValue.find_all_params_from_resource(self)
|
62
|
+
if values.size == 0
|
63
|
+
return {}
|
64
|
+
end
|
65
|
+
values.inject({}) do |hash, value|
|
66
|
+
hash[value['name']] ||= []
|
67
|
+
hash[value['name']] << value
|
41
68
|
hash
|
42
69
|
end
|
43
70
|
end
|
44
|
-
|
71
|
+
|
45
72
|
def get_tag_hash(tags = nil)
|
46
|
-
tags ||=
|
73
|
+
tags ||= @tags_hash || Puppet::Rails::ResourceTag.find_all_tags_from_resource(self)
|
47
74
|
return tags.inject({}) do |hash, tag|
|
48
75
|
# We have to store the tag object, not just the tag name.
|
49
|
-
hash[tag
|
76
|
+
hash[tag['name']] = tag
|
50
77
|
hash
|
51
78
|
end
|
52
79
|
end
|
@@ -73,7 +100,7 @@ class Puppet::Rails::Resource < ActiveRecord::Base
|
|
73
100
|
result = get_params_hash
|
74
101
|
result.each do |param, value|
|
75
102
|
if value.is_a?(Array)
|
76
|
-
result[param] = value.collect { |v| v
|
103
|
+
result[param] = value.collect { |v| v['value'] }
|
77
104
|
else
|
78
105
|
result[param] = value.value
|
79
106
|
end
|
@@ -82,7 +109,7 @@ class Puppet::Rails::Resource < ActiveRecord::Base
|
|
82
109
|
end
|
83
110
|
|
84
111
|
def ref
|
85
|
-
"%s[%s]" % [self[:restype].split("::").collect { |s| s.capitalize }.join("::"), self
|
112
|
+
"%s[%s]" % [self[:restype].split("::").collect { |s| s.capitalize }.join("::"), self.title.to_s]
|
86
113
|
end
|
87
114
|
|
88
115
|
# Convert our object to a resource. Do not retain whether the object
|