puppet 3.0.0.rc5 → 3.0.0.rc7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puppet might be problematic. Click here for more details.
- data/LICENSE +1 -1
- data/README_DEVELOPER.md +209 -1
- data/README_HIERA.md +148 -0
- data/Rakefile +25 -27
- data/bin/extlookup2hiera +56 -0
- data/conf/auth.conf +34 -34
- data/examples/hiera/README.md +91 -0
- data/examples/hiera/etc/hiera.yaml +15 -0
- data/examples/hiera/etc/hieradb/common.yaml +3 -0
- data/examples/hiera/etc/hieradb/dc1.yaml +6 -0
- data/examples/hiera/etc/hieradb/development.yaml +2 -0
- data/examples/hiera/etc/puppet.conf +3 -0
- data/examples/hiera/modules/data/manifests/common.pp +3 -0
- data/examples/hiera/modules/ntp/manifests/config.pp +5 -0
- data/examples/hiera/modules/ntp/manifests/data.pp +3 -0
- data/examples/hiera/modules/ntp/templates/ntp.conf.erb +3 -0
- data/examples/hiera/modules/users/manifests/common.pp +3 -0
- data/examples/hiera/modules/users/manifests/dc1.pp +3 -0
- data/examples/hiera/modules/users/manifests/development.pp +3 -0
- data/examples/hiera/site.pp +3 -0
- data/ext/build_defaults.yaml +23 -0
- data/ext/debian/README.Debian +8 -0
- data/ext/debian/README.source +2 -0
- data/ext/debian/TODO.Debian +1 -0
- data/ext/debian/changelog.erb +1104 -0
- data/ext/debian/compat +1 -0
- data/ext/debian/control +143 -0
- data/ext/debian/copyright +361 -0
- data/ext/debian/docs +1 -0
- data/ext/debian/fileserver.conf +17 -0
- data/ext/debian/puppet-common.dirs +8 -0
- data/ext/debian/puppet-common.install +4 -0
- data/ext/debian/puppet-common.lintian-overrides +5 -0
- data/ext/debian/puppet-common.manpages +2 -0
- data/ext/debian/puppet-common.postinst +35 -0
- data/ext/debian/puppet-common.postrm +32 -0
- data/ext/debian/puppet-el.dirs +1 -0
- data/ext/debian/puppet-el.emacsen-install +25 -0
- data/ext/debian/puppet-el.emacsen-remove +11 -0
- data/ext/debian/puppet-el.emacsen-startup +9 -0
- data/ext/debian/puppet-el.install +1 -0
- data/ext/debian/puppet-testsuite.install +2 -0
- data/ext/debian/puppet-testsuite.lintian-overrides +4 -0
- data/ext/debian/puppet.conf +14 -0
- data/ext/debian/puppet.default +7 -0
- data/ext/debian/puppet.init +118 -0
- data/ext/debian/puppet.lintian-overrides +3 -0
- data/ext/debian/puppet.logrotate +11 -0
- data/ext/debian/puppet.manpages +32 -0
- data/ext/debian/puppet.postinst +20 -0
- data/ext/debian/puppet.postrm +20 -0
- data/ext/debian/puppet.preinst +20 -0
- data/ext/debian/puppetmaster-common.install +2 -0
- data/ext/debian/puppetmaster-common.manpages +2 -0
- data/ext/debian/puppetmaster-common.puppetqd.default +27 -0
- data/ext/debian/puppetmaster-common.puppetqd.init +84 -0
- data/ext/debian/puppetmaster-passenger.dirs +4 -0
- data/ext/debian/puppetmaster-passenger.postinst +66 -0
- data/ext/debian/puppetmaster-passenger.postrm +33 -0
- data/ext/debian/puppetmaster.README.debian +16 -0
- data/ext/debian/puppetmaster.default +38 -0
- data/ext/debian/puppetmaster.init +158 -0
- data/ext/debian/puppetmaster.lintian-overrides +3 -0
- data/ext/debian/puppetmaster.postinst +20 -0
- data/ext/debian/puppetmaster.postrm +5 -0
- data/ext/debian/puppetmaster.preinst +22 -0
- data/ext/debian/rules +128 -0
- data/ext/debian/source/format +1 -0
- data/ext/debian/source/options +1 -0
- data/ext/debian/vim-puppet.README.Debian +13 -0
- data/ext/debian/vim-puppet.dirs +3 -0
- data/ext/debian/vim-puppet.yaml +5 -0
- data/ext/debian/watch +2 -0
- data/ext/emacs/puppet-mode.el +1 -0
- data/ext/envpuppet +4 -0
- data/ext/envpuppet.bat +3 -2
- data/{conf → ext}/freebsd/puppetd +0 -0
- data/{conf → ext}/freebsd/puppetmasterd +0 -0
- data/{conf → ext}/gentoo/conf.d/puppet +0 -0
- data/{conf → ext}/gentoo/conf.d/puppetmaster +0 -0
- data/{conf → ext}/gentoo/init.d/puppet +0 -0
- data/{conf → ext}/gentoo/init.d/puppetmaster +0 -0
- data/{conf → ext}/gentoo/puppet/fileserver.conf +0 -0
- data/{conf → ext}/gentoo/puppet/puppet.conf +0 -0
- data/ext/ips/puppet-agent +49 -0
- data/ext/ips/puppet-master +44 -0
- data/ext/ips/puppet.conf +29 -0
- data/ext/ips/puppet.p5m.erb +12 -0
- data/ext/ips/puppetagent.xml +46 -0
- data/ext/ips/puppetmaster.xml +42 -0
- data/ext/ips/rules +19 -0
- data/ext/ips/transforms +34 -0
- data/{conf → ext}/osx/PackageInfo.plist +0 -0
- data/{conf → ext}/osx/createpackage.sh +1 -1
- data/ext/osx/file_mapping.yaml +33 -0
- data/ext/osx/preflight.erb +37 -0
- data/{tasks/rake/templates → ext/osx}/prototype.plist.erb +0 -0
- data/ext/packaging/README-Solaris.md +117 -0
- data/ext/packaging/README.md +89 -0
- data/ext/packaging/tasks/00_utils.rb +236 -0
- data/ext/packaging/tasks/10_setupvars.rake +62 -0
- data/ext/packaging/tasks/apple.rake +201 -0
- data/ext/packaging/tasks/clean.rake +5 -0
- data/ext/packaging/tasks/deb.rake +105 -0
- data/ext/packaging/tasks/gem.rake +52 -0
- data/ext/packaging/tasks/ips.rake +78 -0
- data/ext/packaging/tasks/mock.rake +88 -0
- data/ext/packaging/tasks/release.rake +20 -0
- data/ext/packaging/tasks/rpm.rake +39 -0
- data/ext/packaging/tasks/ship.rake +34 -0
- data/ext/packaging/tasks/sign.rake +76 -0
- data/ext/packaging/tasks/tar.rake +20 -0
- data/ext/project_data.yaml +25 -0
- data/ext/rack/files/apache2.conf +2 -1
- data/{conf → ext}/redhat/client.init +0 -0
- data/{conf → ext}/redhat/client.sysconfig +0 -0
- data/{conf → ext}/redhat/fileserver.conf +0 -0
- data/{conf → ext}/redhat/logrotate +0 -0
- data/{conf → ext}/redhat/puppet.conf +0 -0
- data/{conf/redhat/puppet.spec → ext/redhat/puppet.spec.erb} +140 -33
- data/{conf → ext}/redhat/queue.init +0 -0
- data/{conf → ext}/redhat/rundir-perms.patch +0 -0
- data/{conf → ext}/redhat/server.init +0 -0
- data/{conf → ext}/redhat/server.sysconfig +0 -0
- data/{conf → ext}/solaris/pkginfo +0 -0
- data/{conf → ext}/solaris/smf/puppetd.xml +0 -0
- data/{conf → ext}/solaris/smf/puppetmasterd.xml +0 -0
- data/{conf → ext}/solaris/smf/svc-puppetd +0 -0
- data/{conf → ext}/solaris/smf/svc-puppetmasterd +0 -0
- data/{conf → ext}/suse/client.init +0 -0
- data/{conf → ext}/suse/fileserver.conf +0 -0
- data/{conf → ext}/suse/logrotate +0 -0
- data/{conf → ext}/suse/puppet.conf +0 -0
- data/{conf → ext}/suse/puppet.spec +1 -1
- data/{conf → ext}/suse/server.init +0 -0
- data/ext/systemd/puppetagent.service +13 -0
- data/ext/systemd/puppetmaster.service +13 -0
- data/{conf → ext}/windows/eventlog/Rakefile +0 -0
- data/{conf → ext}/windows/eventlog/puppetres.dll +0 -0
- data/{conf → ext}/windows/eventlog/puppetres.mc +0 -0
- data/ext/windows/service/daemon.bat +6 -0
- data/ext/windows/service/daemon.rb +90 -0
- data/install.rb +22 -32
- data/lib/hiera/backend/puppet_backend.rb +102 -0
- data/lib/hiera/scope.rb +42 -0
- data/lib/hiera_puppet.rb +89 -0
- data/lib/puppet.rb +1 -1
- data/lib/puppet/agent.rb +2 -2
- data/lib/puppet/agent/locker.rb +12 -9
- data/lib/puppet/application.rb +10 -8
- data/lib/puppet/application/agent.rb +12 -8
- data/lib/puppet/application/apply.rb +2 -2
- data/lib/puppet/application/cert.rb +6 -6
- data/lib/puppet/application/certificate.rb +1 -4
- data/lib/puppet/application/describe.rb +1 -1
- data/lib/puppet/application/device.rb +5 -2
- data/lib/puppet/application/doc.rb +1 -1
- data/lib/puppet/application/face_base.rb +3 -13
- data/lib/puppet/application/filebucket.rb +1 -1
- data/lib/puppet/application/inspect.rb +1 -1
- data/lib/puppet/application/kick.rb +4 -2
- data/lib/puppet/application/master.rb +2 -2
- data/lib/puppet/application/queue.rb +3 -1
- data/lib/puppet/application/resource.rb +1 -1
- data/lib/puppet/configurer.rb +11 -7
- data/lib/puppet/configurer/downloader.rb +1 -4
- data/lib/puppet/daemon.rb +4 -4
- data/lib/puppet/defaults.rb +64 -60
- data/lib/puppet/external/dot.rb +1 -1
- data/lib/puppet/external/pson/common.rb +15 -0
- data/lib/puppet/external/pson/pure.rb +0 -62
- data/lib/puppet/external/pson/pure/generator.rb +1 -1
- data/lib/puppet/external/pson/pure/parser.rb +2 -2
- data/lib/puppet/face/ca.rb +19 -14
- data/lib/puppet/face/config.rb +2 -2
- data/lib/puppet/face/facts.rb +1 -1
- data/lib/puppet/face/help/action.erb +0 -1
- data/lib/puppet/face/help/face.erb +0 -1
- data/lib/puppet/face/help/man.erb +3 -6
- data/lib/puppet/face/module/install.rb +1 -1
- data/lib/puppet/face/module/list.rb +1 -1
- data/lib/puppet/face/module/uninstall.rb +1 -1
- data/lib/puppet/face/node.rb +1 -1
- data/lib/puppet/face/node/clean.rb +30 -25
- data/lib/puppet/feature/base.rb +0 -3
- data/lib/puppet/feature/rails.rb +2 -1
- data/lib/puppet/file_serving/terminus_selector.rb +1 -1
- data/lib/puppet/indirector/catalog/active_record.rb +5 -0
- data/lib/puppet/indirector/catalog/static_compiler.rb +2 -3
- data/lib/puppet/indirector/certificate/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_request/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/certificate_revocation_list/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/face.rb +3 -3
- data/lib/puppet/indirector/facts/active_record.rb +5 -0
- data/lib/puppet/indirector/facts/facter.rb +1 -4
- data/lib/puppet/indirector/facts/inventory_active_record.rb +6 -0
- data/lib/puppet/indirector/file_bucket_file/file.rb +2 -1
- data/lib/puppet/indirector/indirection.rb +2 -2
- data/lib/puppet/indirector/key/disabled_ca.rb +22 -0
- data/lib/puppet/indirector/node/active_record.rb +5 -0
- data/lib/puppet/indirector/request.rb +4 -0
- data/lib/puppet/indirector/resource/active_record.rb +5 -0
- data/lib/puppet/network/authentication.rb +30 -0
- data/lib/puppet/network/http.rb +0 -13
- data/lib/puppet/network/http/connection.rb +10 -2
- data/lib/puppet/network/http/handler.rb +8 -0
- data/lib/puppet/network/http/mongrel/rest.rb +5 -0
- data/lib/puppet/network/http/rack/rest.rb +7 -0
- data/lib/puppet/network/http/webrick.rb +3 -6
- data/lib/puppet/network/http/webrick/rest.rb +4 -0
- data/lib/puppet/network/server.rb +9 -33
- data/lib/puppet/node.rb +1 -1
- data/lib/puppet/node/facts.rb +0 -1
- data/lib/puppet/parser/compiler.rb +1 -1
- data/lib/puppet/parser/functions.rb +12 -1
- data/lib/puppet/parser/functions/hiera.rb +8 -0
- data/lib/puppet/parser/functions/hiera_array.rb +8 -0
- data/lib/puppet/parser/functions/hiera_hash.rb +8 -0
- data/lib/puppet/parser/functions/hiera_include.rb +11 -0
- data/lib/puppet/parser/functions/shellquote.rb +21 -29
- data/lib/puppet/parser/lexer.rb +2 -1
- data/lib/puppet/parser/scope.rb +8 -0
- data/lib/puppet/provider/exec/windows.rb +1 -1
- data/lib/puppet/provider/group/groupadd.rb +2 -3
- data/lib/puppet/provider/package/pkg.rb +37 -10
- data/lib/puppet/provider/service/daemontools.rb +1 -1
- data/lib/puppet/provider/service/launchd.rb +1 -1
- data/lib/puppet/provider/service/redhat.rb +1 -1
- data/lib/puppet/provider/service/runit.rb +1 -1
- data/lib/puppet/provider/user/useradd.rb +8 -3
- data/lib/puppet/provider/user/windows_adsi.rb +11 -0
- data/lib/puppet/provider/zfs/zfs.rb +29 -2
- data/lib/puppet/provider/zone/solaris.rb +144 -39
- data/lib/puppet/provider/zpool/zpool.rb +7 -10
- data/lib/puppet/settings.rb +50 -86
- data/lib/puppet/settings/duration_setting.rb +34 -0
- data/lib/puppet/settings/terminus_setting.rb +16 -0
- data/lib/puppet/ssl/base.rb +49 -9
- data/lib/puppet/ssl/certificate.rb +13 -9
- data/lib/puppet/ssl/certificate_authority.rb +4 -0
- data/lib/puppet/ssl/certificate_authority/interface.rb +10 -17
- data/lib/puppet/ssl/certificate_factory.rb +4 -21
- data/lib/puppet/ssl/certificate_request.rb +1 -10
- data/lib/puppet/ssl/certificate_revocation_list.rb +1 -3
- data/lib/puppet/ssl/digest.rb +20 -0
- data/lib/puppet/ssl/host.rb +31 -6
- data/lib/puppet/test/test_helper.rb +1 -1
- data/lib/puppet/transaction/report.rb +2 -1
- data/lib/puppet/type.rb +1 -1
- data/lib/puppet/type/augeas.rb +1 -1
- data/lib/puppet/type/cron.rb +1 -1
- data/lib/puppet/type/exec.rb +7 -8
- data/lib/puppet/type/file.rb +1 -1
- data/lib/puppet/type/file/content.rb +2 -2
- data/lib/puppet/type/file/ensure.rb +1 -1
- data/lib/puppet/type/file/mode.rb +1 -1
- data/lib/puppet/type/file/selcontext.rb +6 -2
- data/lib/puppet/type/file/source.rb +1 -1
- data/lib/puppet/type/schedule.rb +1 -1
- data/lib/puppet/type/scheduled_task.rb +1 -1
- data/lib/puppet/type/tidy.rb +1 -1
- data/lib/puppet/type/zone.rb +126 -253
- data/lib/puppet/util.rb +10 -23
- data/lib/puppet/util/adsi.rb +22 -14
- data/lib/puppet/util/log/destinations.rb +7 -0
- data/lib/puppet/util/log/rate_limited_logger.rb +40 -0
- data/lib/puppet/util/metric.rb +2 -2
- data/lib/puppet/util/monkey_patches.rb +8 -0
- data/lib/puppet/util/platform.rb +7 -0
- data/lib/puppet/util/selinux.rb +31 -36
- data/lib/puppet/util/windows/error.rb +1 -1
- data/lib/puppet/util/windows/process.rb +3 -3
- data/lib/puppet/util/windows/security.rb +7 -7
- data/lib/puppet/util/windows/user.rb +65 -2
- data/lib/puppet/util/zaml.rb +90 -46
- data/lib/puppet/version.rb +1 -1
- data/spec/fixtures/hiera.yaml +9 -0
- data/spec/fixtures/manifests/site.pp +0 -0
- data/spec/integration/defaults_spec.rb +25 -11
- data/spec/integration/faces/ca_spec.rb +11 -16
- data/spec/integration/network/server/webrick_spec.rb +14 -27
- data/spec/integration/node_spec.rb +4 -1
- data/spec/integration/parser/functions/require_spec.rb +3 -3
- data/spec/integration/parser/undef_param_spec.rb +88 -0
- data/spec/integration/provider/mount_spec.rb +4 -1
- data/spec/integration/ssl/certificate_authority_spec.rb +18 -0
- data/spec/lib/puppet_spec/files.rb +3 -3
- data/spec/lib/puppet_spec/settings.rb +0 -1
- data/spec/shared_contexts/platform.rb +8 -0
- data/spec/spec_helper.rb +6 -0
- data/spec/unit/agent/locker_spec.rb +8 -2
- data/spec/unit/application/agent_spec.rb +29 -7
- data/spec/unit/application/apply_spec.rb +1 -1
- data/spec/unit/application/device_spec.rb +18 -1
- data/spec/unit/application/face_base_spec.rb +16 -2
- data/spec/unit/application/kick_spec.rb +8 -0
- data/spec/unit/application/queue_spec.rb +5 -0
- data/spec/unit/application_spec.rb +13 -23
- data/spec/unit/configurer/downloader_spec.rb +2 -11
- data/spec/unit/configurer_spec.rb +6 -0
- data/spec/unit/face/node_spec.rb +1 -1
- data/spec/unit/hiera/backend/puppet_backend_spec.rb +140 -0
- data/spec/unit/hiera/scope_spec.rb +62 -0
- data/spec/unit/hiera_puppet_spec.rb +111 -0
- data/spec/unit/indirector/catalog/active_record_spec.rb +4 -0
- data/spec/unit/indirector/catalog/static_compiler_spec.rb +194 -0
- data/spec/unit/indirector/certificate/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_request/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/certificate_revocation_list/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/facts/active_record_spec.rb +37 -26
- data/spec/unit/indirector/facts/inventory_active_record_spec.rb +5 -0
- data/spec/unit/indirector/hiera_spec.rb +2 -1
- data/spec/unit/indirector/key/disabled_ca_spec.rb +33 -0
- data/spec/unit/indirector/node/active_record_spec.rb +7 -0
- data/spec/unit/indirector/request_spec.rb +22 -0
- data/spec/unit/indirector/resource/active_record_spec.rb +5 -0
- data/spec/unit/module_tool/application_spec.rb +1 -1
- data/spec/unit/network/authentication_spec.rb +86 -0
- data/spec/unit/network/http/connection_spec.rb +21 -0
- data/spec/unit/network/http/handler_spec.rb +12 -0
- data/spec/unit/network/http/rack/rest_spec.rb +7 -0
- data/spec/unit/network/http/webrick_spec.rb +11 -26
- data/spec/unit/network/server_spec.rb +79 -192
- data/spec/unit/node/facts_spec.rb +2 -2
- data/spec/unit/parser/ast/vardef_spec.rb +4 -4
- data/spec/unit/parser/files_spec.rb +3 -0
- data/spec/unit/parser/functions/defined_spec.rb +5 -5
- data/spec/unit/parser/functions/fqdn_rand_spec.rb +1 -1
- data/spec/unit/parser/functions/hiera_array_spec.rb +23 -0
- data/spec/unit/parser/functions/hiera_hash_spec.rb +19 -0
- data/spec/unit/parser/functions/hiera_include_spec.rb +19 -0
- data/spec/unit/parser/functions/hiera_spec.rb +21 -0
- data/spec/unit/parser/functions/include_spec.rb +3 -3
- data/spec/unit/parser/functions/realize_spec.rb +3 -3
- data/spec/unit/parser/functions/require_spec.rb +5 -5
- data/spec/unit/parser/functions/shellquote_spec.rb +0 -4
- data/spec/unit/parser/functions_spec.rb +6 -10
- data/spec/unit/parser/lexer_spec.rb +13 -0
- data/spec/unit/parser/scope_spec.rb +16 -1
- data/spec/unit/provider/exec/posix_spec.rb +7 -6
- data/spec/unit/provider/group/groupadd_spec.rb +36 -30
- data/spec/unit/provider/package/pkg_spec.rb +16 -2
- data/spec/unit/provider/service/redhat_spec.rb +2 -2
- data/spec/unit/provider/sshkey/parsed_spec.rb +4 -0
- data/spec/unit/provider/user/user_role_add_spec.rb +125 -126
- data/spec/unit/provider/user/useradd_spec.rb +147 -118
- data/spec/unit/provider/user/windows_adsi_spec.rb +22 -0
- data/spec/unit/provider/zone/solaris_spec.rb +126 -7
- data/spec/unit/provider/zpool/zpool_spec.rb +4 -3
- data/spec/unit/puppet_spec.rb +7 -0
- data/spec/unit/settings/duration_setting_spec.rb +45 -0
- data/spec/unit/settings/terminus_setting_spec.rb +28 -0
- data/spec/unit/settings_spec.rb +21 -23
- data/spec/unit/ssl/base_spec.rb +68 -19
- data/spec/unit/ssl/certificate_authority/interface_spec.rb +19 -30
- data/spec/unit/ssl/certificate_authority_spec.rb +3 -2
- data/spec/unit/ssl/certificate_factory_spec.rb +15 -6
- data/spec/unit/ssl/certificate_request_spec.rb +80 -113
- data/spec/unit/ssl/certificate_revocation_list_spec.rb +1 -1
- data/spec/unit/ssl/certificate_spec.rb +26 -2
- data/spec/unit/ssl/digest_spec.rb +35 -0
- data/spec/unit/ssl/host_spec.rb +73 -27
- data/spec/unit/ssl/key_spec.rb +0 -4
- data/spec/unit/type/exec_spec.rb +1 -1
- data/spec/unit/type/file_spec.rb +2 -1
- data/spec/unit/type/scheduled_task_spec.rb +2 -2
- data/spec/unit/type/zone_spec.rb +52 -10
- data/spec/unit/util/adsi_spec.rb +19 -0
- data/spec/unit/util/checksums_spec.rb +2 -3
- data/spec/unit/util/execution_spec.rb +1 -1
- data/spec/unit/util/log/destinations_spec.rb +1 -0
- data/spec/unit/util/log/rate_limited_logger_spec.rb +51 -0
- data/spec/unit/util/logging_spec.rb +6 -6
- data/spec/unit/util/selinux_spec.rb +24 -32
- data/spec/unit/util/zaml_spec.rb +94 -6
- data/spec/unit/util_spec.rb +17 -0
- data/spec/watchr.rb +2 -6
- data/tasks/{rake/manpages.rake → manpages.rake} +0 -0
- data/tasks/{rake/parser.rake → parser.rake} +0 -0
- metadata +1003 -119
- data/CHANGELOG +0 -9233
- data/conf/osx/preflight +0 -24
- data/lib/puppet/network/http/mongrel.rb +0 -35
- data/lib/puppet/util/config_timeout.rb +0 -24
- data/spec/unit/network/http/mongrel/rest_spec.rb +0 -257
- data/spec/unit/network/http/mongrel_spec.rb +0 -91
- data/spec/unit/network/http_spec.rb +0 -31
- data/spec/unit/util/config_timeout_spec.rb +0 -57
- data/tasks/rake/apple.rake +0 -176
- data/tasks/rake/changelog.rake +0 -15
- data/tasks/rake/ci.rake +0 -22
- data/tasks/rake/dailybuild.rake +0 -9
- data/tasks/rake/gem.rake +0 -63
- data/tasks/rake/git_workflow.rake +0 -134
- data/tasks/rake/metrics.rake +0 -14
- data/tasks/rake/sign.rake +0 -14
- data/tasks/rake/testbranch.rake +0 -16
- data/tasks/rake/yard.rake +0 -11
data/lib/puppet/type/augeas.rb
CHANGED
@@ -20,7 +20,7 @@ Puppet::Type.newtype(:augeas) do
|
|
20
20
|
feature :need_to_run?, "If the command should run"
|
21
21
|
feature :execute_changes, "Actually make the changes"
|
22
22
|
|
23
|
-
@doc = <<-EOT
|
23
|
+
@doc = <<-'EOT'
|
24
24
|
Apply a change or an array of changes to the filesystem
|
25
25
|
using the augeas tool.
|
26
26
|
|
data/lib/puppet/type/cron.rb
CHANGED
@@ -3,7 +3,7 @@ require 'facter'
|
|
3
3
|
require 'puppet/util/filetype'
|
4
4
|
|
5
5
|
Puppet::Type.newtype(:cron) do
|
6
|
-
@doc = <<-EOT
|
6
|
+
@doc = <<-'EOT'
|
7
7
|
Installs and manages cron jobs. Every cron resource requires a command
|
8
8
|
and user attribute, as well as at least one periodic attribute (hour,
|
9
9
|
minute, month, monthday, weekday, or special). While the name of the cron
|
data/lib/puppet/type/exec.rb
CHANGED
@@ -180,10 +180,9 @@ module Puppet
|
|
180
180
|
end
|
181
181
|
|
182
182
|
newparam(:logoutput) do
|
183
|
-
desc "Whether to log output. Defaults to
|
184
|
-
|
185
|
-
|
186
|
-
**true**, *false*, *on_failure*, and any legal log level."
|
183
|
+
desc "Whether to log output. Defaults to `on_failure`, which only logs
|
184
|
+
the output when the command has a non-zero exit code. In addition to
|
185
|
+
the values below, you may set this attribute to any legal log level."
|
187
186
|
|
188
187
|
defaultto :on_failure
|
189
188
|
|
@@ -276,7 +275,7 @@ module Puppet
|
|
276
275
|
|
277
276
|
|
278
277
|
newcheck(:refreshonly) do
|
279
|
-
desc <<-EOT
|
278
|
+
desc <<-'EOT'
|
280
279
|
The command should only be run as a
|
281
280
|
refresh mechanism for when a dependent object is changed. It only
|
282
281
|
makes sense to use this option when this command depends on some
|
@@ -313,7 +312,7 @@ module Puppet
|
|
313
312
|
end
|
314
313
|
|
315
314
|
newcheck(:creates, :parent => Puppet::Parameter::Path) do
|
316
|
-
desc <<-EOT
|
315
|
+
desc <<-'EOT'
|
317
316
|
A file that this command creates. If this
|
318
317
|
parameter is provided, then the command will only be run
|
319
318
|
if the specified file does not exist.
|
@@ -338,7 +337,7 @@ module Puppet
|
|
338
337
|
end
|
339
338
|
|
340
339
|
newcheck(:unless) do
|
341
|
-
desc <<-EOT
|
340
|
+
desc <<-'EOT'
|
342
341
|
If this parameter is set, then this `exec` will run unless
|
343
342
|
the command returns 0. For example:
|
344
343
|
|
@@ -380,7 +379,7 @@ module Puppet
|
|
380
379
|
end
|
381
380
|
|
382
381
|
newcheck(:onlyif) do
|
383
|
-
desc <<-EOT
|
382
|
+
desc <<-'EOT'
|
384
383
|
If this parameter is set, then this `exec` will only run if
|
385
384
|
the command returns 0. For example:
|
386
385
|
|
data/lib/puppet/type/file.rb
CHANGED
@@ -15,7 +15,7 @@ module Puppet
|
|
15
15
|
|
16
16
|
attr_reader :actual_content
|
17
17
|
|
18
|
-
desc <<-EOT
|
18
|
+
desc <<-'EOT'
|
19
19
|
The desired contents of a file, as a string. This attribute is mutually
|
20
20
|
exclusive with `source` and `target`.
|
21
21
|
|
@@ -177,7 +177,7 @@ module Puppet
|
|
177
177
|
yield read_file_from_filebucket
|
178
178
|
elsif source_or_content.nil?
|
179
179
|
yield ''
|
180
|
-
elsif Puppet[:default_file_terminus] ==
|
180
|
+
elsif Puppet[:default_file_terminus] == :file_server
|
181
181
|
yield source_or_content.content
|
182
182
|
elsif source_or_content.local?
|
183
183
|
chunk_file_from_disk(source_or_content) { |chunk| yield chunk }
|
@@ -5,7 +5,7 @@ module Puppet
|
|
5
5
|
require 'puppet/util/symbolic_file_mode'
|
6
6
|
include Puppet::Util::SymbolicFileMode
|
7
7
|
|
8
|
-
desc <<-EOT
|
8
|
+
desc <<-'EOT'
|
9
9
|
Whether to create files that don't currently exist.
|
10
10
|
Possible values are *absent*, *present*, *file*, and *directory*.
|
11
11
|
Specifying `present` will match any form of file existence, and
|
@@ -6,7 +6,7 @@ module Puppet
|
|
6
6
|
require 'puppet/util/symbolic_file_mode'
|
7
7
|
include Puppet::Util::SymbolicFileMode
|
8
8
|
|
9
|
-
desc <<-EOT
|
9
|
+
desc <<-'EOT'
|
10
10
|
The desired permissions mode for the file, in symbolic or numeric
|
11
11
|
notation. Puppet uses traditional Unix permission schemes and translates
|
12
12
|
them to equivalent permissions for systems which represent permissions
|
@@ -48,9 +48,13 @@ module Puppet
|
|
48
48
|
def insync?(value)
|
49
49
|
if not selinux_support?
|
50
50
|
debug("SELinux bindings not found. Ignoring parameter.")
|
51
|
-
|
51
|
+
true
|
52
|
+
elsif not selinux_label_support?(@resource[:path])
|
53
|
+
debug("SELinux not available for this filesystem. Ignoring parameter.")
|
54
|
+
true
|
55
|
+
else
|
56
|
+
super
|
52
57
|
end
|
53
|
-
super
|
54
58
|
end
|
55
59
|
|
56
60
|
def sync
|
@@ -12,7 +12,7 @@ module Puppet
|
|
12
12
|
include Puppet::Util::Diff
|
13
13
|
|
14
14
|
attr_accessor :source, :local
|
15
|
-
desc <<-EOT
|
15
|
+
desc <<-'EOT'
|
16
16
|
A source file, which will be copied into place on the local system.
|
17
17
|
Values can be URIs pointing to remote files, or fully qualified paths to
|
18
18
|
files available on the local system (including files on NFS shares or
|
data/lib/puppet/type/schedule.rb
CHANGED
@@ -80,7 +80,7 @@ Puppet::Type.newtype(:scheduled_task) do
|
|
80
80
|
end
|
81
81
|
|
82
82
|
newproperty(:trigger, :array_matching => :all) do
|
83
|
-
desc <<-EOT
|
83
|
+
desc <<-'EOT'
|
84
84
|
One or more triggers defining when the task should run. A single trigger is
|
85
85
|
represented as a hash, and multiple triggers can be specified with an array of
|
86
86
|
hashes.
|
data/lib/puppet/type/tidy.rb
CHANGED
@@ -43,7 +43,7 @@ Puppet::Type.newtype(:tidy) do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
newparam(:matches) do
|
46
|
-
desc <<-EOT
|
46
|
+
desc <<-'EOT'
|
47
47
|
One or more (shell type) file glob patterns, which restrict
|
48
48
|
the list of files to be tidied to those whose basenames match
|
49
49
|
at least one of the patterns specified. Multiple patterns can
|
data/lib/puppet/type/zone.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'puppet/property/list'
|
1
2
|
Puppet::Type.newtype(:zone) do
|
2
3
|
@doc = "Manages Solaris zones.
|
3
4
|
|
@@ -5,69 +6,45 @@ Puppet::Type.newtype(:zone) do
|
|
5
6
|
the zone's filesystem (with the `path` attribute), the zone resource will
|
6
7
|
autorequire that directory."
|
7
8
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
class StateMachine
|
10
|
+
# A silly little state machine.
|
11
|
+
def initialize
|
12
|
+
@state = {}
|
13
|
+
@sequence = []
|
14
|
+
@state_aliases = {}
|
15
|
+
@default = nil
|
15
16
|
end
|
16
|
-
end
|
17
|
-
|
18
|
-
# Those properties that can have multiple instances.
|
19
|
-
class ZoneMultiConfigProperty < ZoneConfigProperty
|
20
|
-
def configtext
|
21
|
-
list = @should
|
22
|
-
|
23
|
-
current_value = self.retrieve
|
24
|
-
|
25
|
-
unless current_value.is_a? Symbol
|
26
|
-
if current_value.is_a? Array
|
27
|
-
list += current_value
|
28
|
-
else
|
29
|
-
list << current_value if current_value
|
30
|
-
end
|
31
|
-
end
|
32
17
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
tmpis = [current_value]
|
39
|
-
else
|
40
|
-
tmpis = []
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
rms = []
|
45
|
-
adds = []
|
18
|
+
# The order of calling insert_state is important
|
19
|
+
def insert_state(name, transitions)
|
20
|
+
@sequence << name
|
21
|
+
@state[name] = transitions
|
22
|
+
end
|
46
23
|
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
next if tmpis.include?(obj) and @should.include?(obj)
|
24
|
+
def alias_state(state, salias)
|
25
|
+
@state_aliases[state] = salias
|
26
|
+
end
|
51
27
|
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
adds << obj
|
56
|
-
end
|
57
|
-
end
|
28
|
+
def name(n)
|
29
|
+
@state_aliases[n.to_sym] || n.to_sym
|
30
|
+
end
|
58
31
|
|
32
|
+
def index(state)
|
33
|
+
@sequence.index(name(state))
|
34
|
+
end
|
59
35
|
|
60
|
-
|
61
|
-
|
36
|
+
# return all states between fs and ss excluding fs
|
37
|
+
def sequence(fs, ss)
|
38
|
+
fi = index(fs)
|
39
|
+
si= index(ss)
|
40
|
+
(if fi > si
|
41
|
+
then @sequence[si .. fi].map{|i| @state[i]}.reverse
|
42
|
+
else @sequence[fi .. si].map{|i| @state[i]}
|
43
|
+
end)[1..-1]
|
62
44
|
end
|
63
45
|
|
64
|
-
|
65
|
-
|
66
|
-
if current_value.is_a? Array and @should.is_a? Array
|
67
|
-
current_value.sort == @should.sort
|
68
|
-
else
|
69
|
-
current_value == @should
|
70
|
-
end
|
46
|
+
def cmp?(a,b)
|
47
|
+
index(a) < index(b)
|
71
48
|
end
|
72
49
|
end
|
73
50
|
|
@@ -78,98 +55,66 @@ autorequire that directory."
|
|
78
55
|
only then can be `running`. Note also that `halt` is currently
|
79
56
|
used to stop zones."
|
80
57
|
|
81
|
-
|
82
|
-
|
58
|
+
def self.fsm
|
59
|
+
return @fsm if @fsm
|
60
|
+
@fsm = StateMachine.new
|
61
|
+
end
|
83
62
|
|
84
63
|
def self.alias_state(values)
|
85
|
-
|
86
|
-
|
87
|
-
@state_aliases[nick] = name
|
64
|
+
values.each do |k,v|
|
65
|
+
fsm.alias_state(k,v)
|
88
66
|
end
|
89
67
|
end
|
90
68
|
|
91
|
-
def self.
|
92
|
-
|
93
|
-
|
94
|
-
@parametervalues << name
|
95
|
-
|
96
|
-
@states[name] = hash
|
97
|
-
hash[:name] = name
|
98
|
-
end
|
99
|
-
|
100
|
-
def self.state_name(name)
|
101
|
-
@state_aliases[name.to_sym] || name.to_sym
|
69
|
+
def self.seqvalue(name, hash)
|
70
|
+
fsm.insert_state(name, hash)
|
71
|
+
self.newvalue name
|
102
72
|
end
|
103
73
|
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
74
|
+
# This is seq value because the order of declaration is important.
|
75
|
+
# i.e we go linearly from :absent -> :configured -> :installed -> :running
|
76
|
+
seqvalue :absent, :down => :destroy
|
77
|
+
seqvalue :configured, :up => :configure, :down => :uninstall
|
78
|
+
seqvalue :installed, :up => :install, :down => :stop
|
79
|
+
seqvalue :running, :up => :start
|
108
80
|
|
109
81
|
alias_state :incomplete => :installed, :ready => :installed, :shutting_down => :running
|
110
82
|
|
111
83
|
defaultto :running
|
112
84
|
|
113
|
-
def self.state_index(value)
|
114
|
-
@parametervalues.index(state_name(value))
|
115
|
-
end
|
116
|
-
|
117
|
-
# Return all of the states between two listed values, exclusive
|
118
|
-
# of the first item.
|
119
85
|
def self.state_sequence(first, second)
|
120
|
-
|
121
|
-
unless findex = @parametervalues.index(state_name(first))
|
122
|
-
raise ArgumentError, "'#{first}' is not a valid zone state"
|
123
|
-
end
|
124
|
-
unless sindex = @parametervalues.index(state_name(second))
|
125
|
-
raise ArgumentError, "'#{first}' is not a valid zone state"
|
126
|
-
end
|
127
|
-
list = nil
|
128
|
-
|
129
|
-
# Apparently ranges are unidirectional, so we have to reverse
|
130
|
-
# the range op twice.
|
131
|
-
if findex > sindex
|
132
|
-
list = @parametervalues[sindex..findex].collect do |name|
|
133
|
-
@states[name]
|
134
|
-
end.reverse
|
135
|
-
else
|
136
|
-
list = @parametervalues[findex..sindex].collect do |name|
|
137
|
-
@states[name]
|
138
|
-
end
|
139
|
-
end
|
140
|
-
|
141
|
-
# The first result is the current state, so don't return it.
|
142
|
-
list[1..-1]
|
86
|
+
fsm.sequence(first, second)
|
143
87
|
end
|
144
88
|
|
89
|
+
# Why override it? because property/ensure.rb has a default retrieve method
|
90
|
+
# that knows only about :present and :absent. That method just calls
|
91
|
+
# provider.exists? and returns :present if a result was returned.
|
145
92
|
def retrieve
|
146
93
|
provider.properties[:ensure]
|
147
94
|
end
|
148
95
|
|
96
|
+
def provider_sync_send(method)
|
97
|
+
warned = false
|
98
|
+
while provider.processing?
|
99
|
+
next if warned
|
100
|
+
info "Waiting for zone to finish processing"
|
101
|
+
warned = true
|
102
|
+
sleep 1
|
103
|
+
end
|
104
|
+
provider.send(method)
|
105
|
+
provider.flush()
|
106
|
+
end
|
107
|
+
|
149
108
|
def sync
|
150
109
|
method = nil
|
151
|
-
|
152
|
-
direction = :up
|
153
|
-
else
|
154
|
-
direction = :down
|
155
|
-
end
|
110
|
+
direction = up? ? :up : :down
|
156
111
|
|
157
112
|
# We need to get the state we're currently in and just call
|
158
113
|
# everything between it and us.
|
159
114
|
self.class.state_sequence(self.retrieve, self.should).each do |state|
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
unless warned
|
164
|
-
info "Waiting for zone to finish processing"
|
165
|
-
warned = true
|
166
|
-
end
|
167
|
-
sleep 1
|
168
|
-
end
|
169
|
-
provider.send(method)
|
170
|
-
else
|
171
|
-
raise Puppet::DevError, "Cannot move #{direction} from #{st[:name]}"
|
172
|
-
end
|
115
|
+
method = state[direction]
|
116
|
+
raise Puppet::DevError, "Cannot move #{direction} from #{st[:name]}" unless method
|
117
|
+
provider_sync_send(method)
|
173
118
|
end
|
174
119
|
|
175
120
|
("zone_#{self.should}").intern
|
@@ -177,18 +122,9 @@ autorequire that directory."
|
|
177
122
|
|
178
123
|
# Are we moving up the property tree?
|
179
124
|
def up?
|
180
|
-
|
181
|
-
self.class.state_index(current_value) < self.class.state_index(self.should)
|
125
|
+
self.class.fsm.cmp?(self.retrieve, self.should)
|
182
126
|
end
|
183
127
|
|
184
|
-
# We override the newvalue in the parent class. Thus the values that we get from the
|
185
|
-
# manifest are stored as they are and later compared to the current state of the instance,
|
186
|
-
# which is in symbol form. Hence we have to convert this to symbol here for now.
|
187
|
-
# TODO: fix this so that munging is no longer necessary. see also #15886
|
188
|
-
|
189
|
-
munge do |value|
|
190
|
-
value.intern
|
191
|
-
end
|
192
128
|
end
|
193
129
|
|
194
130
|
newparam(:name) do
|
@@ -209,82 +145,47 @@ autorequire that directory."
|
|
209
145
|
zone will be used. The zone from which you clone must not be running."
|
210
146
|
end
|
211
147
|
|
212
|
-
newproperty(:ip, :parent =>
|
148
|
+
newproperty(:ip, :parent => Puppet::Property::List) do
|
213
149
|
require 'ipaddr'
|
214
150
|
|
215
151
|
desc "The IP address of the zone. IP addresses must be specified
|
216
152
|
with the interface, separated by a colon, e.g.: bge0:192.168.0.1.
|
217
153
|
For multiple interfaces, specify them in an array."
|
218
154
|
|
219
|
-
#
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
cmd += "set address=#{ip}\n" if ip
|
225
|
-
cmd += "set defrouter=#{defrouter}\n" if defrouter
|
226
|
-
#if @resource[:iptype] == :shared
|
227
|
-
cmd += "end\n"
|
155
|
+
# The default action of list should is to lst.join(' '). By specifying
|
156
|
+
# @should, we ensure the should remains an array. If we override should, we
|
157
|
+
# should also override insync?() -- property/list.rb
|
158
|
+
def should
|
159
|
+
@should
|
228
160
|
end
|
229
161
|
|
230
|
-
#
|
231
|
-
def
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
# Remove an interface.
|
237
|
-
def rm(str)
|
238
|
-
interface, ip, defrouter = ipsplit(str)
|
239
|
-
# Reality seems to disagree with the documentation here; the docs
|
240
|
-
# specify that braces are required, but they're apparently only
|
241
|
-
# required if you're specifying multiple values.
|
242
|
-
if ip
|
243
|
-
"remove net address=#{ip}"
|
244
|
-
elsif interface
|
245
|
-
"remove net interface=#{interface}"
|
246
|
-
else
|
247
|
-
raise ArgumentError, "can not remove network based on default router"
|
248
|
-
end
|
162
|
+
# overridden so that we match with self.should
|
163
|
+
def insync?(is)
|
164
|
+
return true unless is
|
165
|
+
is = [] if is == :absent
|
166
|
+
is.sort == self.should.sort
|
249
167
|
end
|
250
168
|
end
|
251
169
|
|
252
|
-
newproperty(:iptype
|
170
|
+
newproperty(:iptype) do
|
253
171
|
desc "The IP stack type of the zone."
|
254
|
-
|
255
172
|
defaultto :shared
|
256
|
-
|
257
173
|
newvalue :shared
|
258
174
|
newvalue :exclusive
|
259
|
-
|
260
|
-
def configtext
|
261
|
-
"set ip-type=#{self.should}"
|
262
|
-
end
|
263
175
|
end
|
264
176
|
|
265
|
-
newproperty(:autoboot, :
|
177
|
+
newproperty(:autoboot, :boolean => true) do
|
266
178
|
desc "Whether the zone should automatically boot."
|
267
|
-
|
268
179
|
defaultto true
|
269
|
-
|
270
|
-
newvalue(:true) {}
|
271
|
-
newvalue(:false) {}
|
272
|
-
|
273
|
-
def configtext
|
274
|
-
"set autoboot=#{self.should}"
|
275
|
-
end
|
180
|
+
newvalues(:true, :false)
|
276
181
|
end
|
277
182
|
|
278
|
-
newproperty(:path
|
183
|
+
newproperty(:path) do
|
279
184
|
desc "The root of the zone's filesystem. Must be a fully qualified
|
280
185
|
file name. If you include `%s` in the path, then it will be
|
281
186
|
replaced with the zone's name. Currently, you cannot use
|
282
187
|
Puppet to move a zone. Consequently this is a readonly property."
|
283
188
|
|
284
|
-
def configtext
|
285
|
-
"set zonepath=#{self.should}"
|
286
|
-
end
|
287
|
-
|
288
189
|
validate do |value|
|
289
190
|
raise ArgumentError, "The zone base must be fully qualified" unless value =~ /^\//
|
290
191
|
end
|
@@ -298,74 +199,57 @@ autorequire that directory."
|
|
298
199
|
end
|
299
200
|
end
|
300
201
|
|
301
|
-
newproperty(:pool
|
202
|
+
newproperty(:pool) do
|
302
203
|
desc "The resource pool for this zone."
|
303
|
-
|
304
|
-
def configtext
|
305
|
-
"set pool=#{self.should}"
|
306
|
-
end
|
307
204
|
end
|
308
205
|
|
309
|
-
newproperty(:shares
|
206
|
+
newproperty(:shares) do
|
310
207
|
desc "Number of FSS CPU shares allocated to the zone."
|
311
|
-
|
312
|
-
def configtext
|
313
|
-
"add rctl\nset name=zone.cpu-shares\nadd value (priv=privileged,limit=#{self.should},action=none)\nend"
|
314
|
-
end
|
315
208
|
end
|
316
209
|
|
317
|
-
newproperty(:dataset, :parent =>
|
210
|
+
newproperty(:dataset, :parent => Puppet::Property::List ) do
|
318
211
|
desc "The list of datasets delegated to the non-global zone from the
|
319
212
|
global zone. All datasets must be zfs filesystem names which are
|
320
213
|
different from the mountpoint."
|
321
214
|
|
215
|
+
def should
|
216
|
+
@should
|
217
|
+
end
|
218
|
+
|
219
|
+
# overridden so that we match with self.should
|
220
|
+
def insync?(is)
|
221
|
+
return true unless is
|
222
|
+
is = [] if is == :absent
|
223
|
+
is.sort == self.should.sort
|
224
|
+
end
|
225
|
+
|
322
226
|
validate do |value|
|
323
227
|
unless value !~ /^\//
|
324
228
|
raise ArgumentError, "Datasets must be the name of a zfs filesystem"
|
325
229
|
end
|
326
230
|
end
|
231
|
+
end
|
327
232
|
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
end
|
332
|
-
|
333
|
-
# Remove a zfs filesystem from our list of datasets.
|
334
|
-
def rm(dataset)
|
335
|
-
"remove dataset name=#{dataset}"
|
336
|
-
end
|
233
|
+
newproperty(:inherit, :parent => Puppet::Property::List) do
|
234
|
+
desc "The list of directories that the zone inherits from the global
|
235
|
+
zone. All directories must be fully qualified."
|
337
236
|
|
338
237
|
def should
|
339
238
|
@should
|
340
239
|
end
|
341
|
-
end
|
342
|
-
|
343
240
|
|
344
|
-
|
345
|
-
|
346
|
-
|
241
|
+
# overridden so that we match with self.should
|
242
|
+
def insync?(is)
|
243
|
+
return true unless is
|
244
|
+
is = [] if is == :absent
|
245
|
+
is.sort == self.should.sort
|
246
|
+
end
|
347
247
|
|
348
248
|
validate do |value|
|
349
249
|
unless value =~ /^\//
|
350
250
|
raise ArgumentError, "Inherited filesystems must be fully qualified"
|
351
251
|
end
|
352
252
|
end
|
353
|
-
|
354
|
-
# Add a directory to our list of inherited directories.
|
355
|
-
def add(dir)
|
356
|
-
"add inherit-pkg-dir\nset dir=#{dir}\nend"
|
357
|
-
end
|
358
|
-
|
359
|
-
def rm(dir)
|
360
|
-
# Reality seems to disagree with the documentation here; the docs
|
361
|
-
# specify that braces are required, but they're apparently only
|
362
|
-
# required if you're specifying multiple values.
|
363
|
-
"remove inherit-pkg-dir dir=#{dir}"
|
364
|
-
end
|
365
|
-
|
366
|
-
def should
|
367
|
-
@should
|
368
|
-
end
|
369
253
|
end
|
370
254
|
|
371
255
|
# Specify the sysidcfg file. This is pretty hackish, because it's
|
@@ -429,22 +313,14 @@ autorequire that directory."
|
|
429
313
|
# type. We just need to autorequire the dataset zfs itself as the zfs type
|
430
314
|
# will autorequire all of the zfs parents and zpool.
|
431
315
|
autorequire(:zfs) do
|
432
|
-
|
433
|
-
|
434
|
-
if @parameters.include? :dataset
|
435
|
-
reqs = []
|
436
|
-
# Autorequire each dataset
|
437
|
-
self[:dataset].each { |value|
|
438
|
-
reqs << value
|
439
|
-
}
|
440
|
-
reqs
|
441
|
-
end
|
316
|
+
# Check if we have datasets in our zone configuration and autorequire each dataset
|
317
|
+
self[:dataset] if @parameters.include? :dataset
|
442
318
|
end
|
443
319
|
|
444
320
|
def validate_ip(ip, name)
|
445
|
-
|
321
|
+
IPAddr.new(ip) if ip
|
446
322
|
rescue ArgumentError
|
447
|
-
|
323
|
+
self.fail "'#{ip}' is an invalid #{name}"
|
448
324
|
end
|
449
325
|
|
450
326
|
def validate_exclusive(interface, address, router)
|
@@ -460,26 +336,24 @@ autorequire that directory."
|
|
460
336
|
|
461
337
|
validate do
|
462
338
|
return unless self[:ip]
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
339
|
+
# self[:ip] reflects the type passed from proeprty:ip.should. If we
|
340
|
+
# override it and pass @should, then we get an array here back.
|
341
|
+
self[:ip].each do |ip|
|
342
|
+
interface, address, router = ip.split(':')
|
343
|
+
if self[:iptype] == :shared
|
344
|
+
validate_shared(interface, address, router)
|
345
|
+
else
|
346
|
+
validate_exclusive(interface, address, router)
|
347
|
+
end
|
468
348
|
end
|
469
349
|
end
|
470
350
|
|
471
351
|
def retrieve
|
472
352
|
provider.flush
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
# Return all properties as absent.
|
478
|
-
return properties.inject({}) do | prophash, property|
|
479
|
-
prophash[property] = :absent
|
480
|
-
prophash
|
481
|
-
end
|
482
|
-
end
|
353
|
+
hash = provider.properties
|
354
|
+
return setstatus(hash) unless hash.nil? or hash[:ensure] == :absent
|
355
|
+
# Return all properties as absent.
|
356
|
+
return Hash[properties.map{|p| [p, :absent]} ]
|
483
357
|
end
|
484
358
|
|
485
359
|
# Take the results of a listing and set everything appropriately.
|
@@ -490,9 +364,8 @@ autorequire that directory."
|
|
490
364
|
case self.class.attrtype(param)
|
491
365
|
when :property
|
492
366
|
# Only try to provide values for the properties we're managing
|
493
|
-
|
494
|
-
|
495
|
-
end
|
367
|
+
prop = self.property(param)
|
368
|
+
prophash[prop] = value if prop
|
496
369
|
else
|
497
370
|
self[param] = value
|
498
371
|
end
|