puppet 0.24.4 → 0.24.5
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 +170 -0
- data/Rakefile +6 -4
- data/bin/filebucket +3 -2
- data/bin/puppet +7 -4
- data/bin/puppetca +32 -14
- data/bin/puppetd +12 -34
- data/bin/puppetmasterd +3 -2
- data/bin/puppetrun +5 -43
- data/bin/ralsh +2 -2
- data/conf/debian/README.source +2 -0
- data/conf/debian/TODO.Debian +1 -0
- data/conf/debian/changelog +257 -0
- data/conf/debian/compat +1 -0
- data/conf/debian/control +45 -0
- data/conf/debian/copyright +17 -0
- data/conf/debian/docs +1 -0
- data/conf/debian/fileserver.conf +12 -0
- data/conf/debian/puppet.NEWS +63 -0
- data/conf/debian/puppet.conf +8 -0
- data/conf/debian/puppet.dirs +7 -0
- data/conf/debian/puppet.files +6 -0
- data/conf/debian/puppet.init +64 -0
- data/conf/debian/puppet.logrotate +11 -0
- data/conf/debian/puppet.postinst +9 -0
- data/conf/debian/puppet.postrm +21 -0
- data/conf/debian/puppet.preinst +25 -0
- data/conf/debian/puppetmaster.files +4 -0
- data/conf/debian/puppetmaster.init +58 -0
- data/conf/debian/rules +115 -0
- data/conf/debian/watch +2 -0
- data/conf/gentoo/init.d/puppet +1 -1
- data/conf/gentoo/init.d/puppetmaster +32 -31
- data/conf/redhat/client.init +10 -2
- data/conf/redhat/puppet.spec +4 -1
- data/conf/redhat/server.init +9 -1
- data/examples/{code/allatonce → allatonce} +0 -0
- data/examples/{code/assignments → assignments} +0 -0
- data/examples/{code/components → components} +0 -0
- data/examples/{root/etc → etc}/init.d/sleeper +0 -0
- data/examples/{root/etc → etc}/otherfile +0 -0
- data/examples/{root/etc → etc}/puppet/fileserver.conf +0 -0
- data/examples/{root/etc → etc}/puppet/namespaceauth.conf +0 -0
- data/examples/{root/etc → etc}/puppet/puppet.conf +0 -0
- data/examples/{root/etc → etc}/puppet/tagmail.conf +0 -0
- data/examples/{code/execs → execs} +0 -0
- data/examples/{code/file.bl → file.bl} +0 -0
- data/examples/{code/filedefaults → filedefaults} +0 -0
- data/examples/{code/fileparsing → fileparsing} +0 -0
- data/examples/{code/filerecursion → filerecursion} +0 -0
- data/examples/{code/functions → functions} +0 -0
- data/examples/{code/groups → groups} +0 -0
- data/examples/{code/head → head} +0 -0
- data/examples/{code/importing → importing} +0 -0
- data/examples/{code/mac_automount.pp → mac_automount.pp} +0 -0
- data/examples/{code/mac_dscl.pp → mac_dscl.pp} +0 -0
- data/examples/{code/mac_dscl_revert.pp → mac_dscl_revert.pp} +0 -0
- data/examples/{code/mac_netinfo.pp → mac_netinfo.pp} +0 -0
- data/examples/{code/mac_pkgdmg.pp → mac_pkgdmg.pp} +0 -0
- data/examples/{code/modules → modules}/sample-module.pp +0 -0
- data/examples/{code/modules → modules}/sample-module/README.txt +0 -0
- data/examples/{code/modules → modules}/sample-module/lib/puppet/parser/functions/hostname_to_dn.rb +0 -0
- data/examples/{code/modules → modules}/sample-module/manifests/init.pp +0 -0
- data/examples/{code/modules → modules}/sample-module/templates/sample.erb +0 -0
- data/examples/{code/nodes → nodes} +0 -0
- data/examples/{code/one → one} +0 -0
- data/examples/{code/relationships → relationships} +0 -0
- data/examples/{code/selectors → selectors} +0 -0
- data/examples/{code/simpletests → simpletests} +0 -0
- data/examples/{code/svncommit → svncommit} +0 -0
- data/ext/autotest/Rakefile +8 -0
- data/ext/autotest/config +43 -0
- data/ext/autotest/readme.rst +16 -0
- data/{examples/root → ext}/bin/sleeper +1 -1
- data/ext/emacs/puppet-mode.el +246 -184
- data/ext/ldap/puppet.schema +7 -2
- data/ext/module_puppet +4 -3
- data/ext/nagios/check_puppet.rb +117 -0
- data/ext/puppetlast +40 -0
- data/install.rb +12 -3
- data/lib/puppet.rb +1 -44
- data/lib/puppet/defaults.rb +23 -10
- data/lib/puppet/dsl.rb +2 -2
- data/lib/puppet/executables/client/certhandler.rb +77 -0
- data/lib/puppet/external/nagios.rb +1 -1
- data/lib/puppet/external/nagios/base.rb +60 -46
- data/lib/puppet/file_serving/indirection_hooks.rb +4 -2
- data/lib/puppet/file_serving/metadata.rb +0 -9
- data/lib/puppet/file_serving/terminus_helper.rb +4 -4
- data/lib/puppet/indirector.rb +26 -28
- data/lib/puppet/indirector/catalog/compiler.rb +6 -28
- data/lib/puppet/indirector/checksum/file.rb +2 -2
- data/lib/puppet/indirector/direct_file_server.rb +7 -7
- data/lib/puppet/indirector/envelope.rb +13 -0
- data/lib/puppet/indirector/exec.rb +2 -2
- data/lib/puppet/indirector/facts/facter.rb +2 -2
- data/lib/puppet/indirector/file.rb +17 -14
- data/lib/puppet/indirector/file_metadata/file.rb +2 -2
- data/lib/puppet/indirector/file_server.rb +14 -14
- data/lib/puppet/indirector/indirection.rb +113 -48
- data/lib/puppet/indirector/ldap.rb +13 -25
- data/lib/puppet/indirector/memory.rb +7 -7
- data/lib/puppet/indirector/module_files.rb +14 -14
- data/lib/puppet/indirector/node/exec.rb +3 -10
- data/lib/puppet/indirector/node/ldap.rb +138 -41
- data/lib/puppet/indirector/node/plain.rb +1 -8
- data/lib/puppet/indirector/node/rest.rb +1 -1
- data/lib/puppet/indirector/plain.rb +2 -2
- data/lib/puppet/indirector/report/processor.rb +2 -2
- data/lib/puppet/indirector/request.rb +42 -0
- data/lib/puppet/indirector/rest.rb +51 -3
- data/lib/puppet/indirector/terminus.rb +0 -27
- data/lib/puppet/indirector/yaml.rb +12 -17
- data/lib/puppet/metatype/attributes.rb +3 -7
- data/lib/puppet/metatype/evaluation.rb +2 -2
- data/lib/puppet/module.rb +6 -2
- data/lib/puppet/network/client/master.rb +29 -81
- data/lib/puppet/network/handler/master.rb +12 -43
- data/lib/puppet/network/http.rb +8 -6
- data/lib/puppet/network/http/handler.rb +42 -32
- data/lib/puppet/network/http/mongrel.rb +8 -9
- data/lib/puppet/network/http/mongrel/rest.rb +42 -15
- data/lib/puppet/network/http/webrick.rb +27 -16
- data/lib/puppet/network/http/webrick/rest.rb +38 -14
- data/lib/puppet/network/http_pool.rb +3 -2
- data/lib/puppet/network/server.rb +24 -22
- data/lib/puppet/network/xmlrpc/client.rb +6 -1
- data/lib/puppet/node.rb +38 -79
- data/lib/puppet/node/catalog.rb +9 -0
- data/lib/puppet/node/facts.rb +9 -1
- data/lib/puppet/parser/ast/function.rb +1 -1
- data/lib/puppet/parser/collector.rb +6 -0
- data/lib/puppet/parser/compiler.rb +1 -1
- data/lib/puppet/parser/functions.rb +25 -1
- data/lib/puppet/parser/interpreter.rb +2 -17
- data/lib/puppet/parser/parser.rb +4 -4
- data/lib/puppet/parser/parser_support.rb +6 -2
- data/lib/puppet/parser/resource.rb +6 -0
- data/lib/puppet/parser/templatewrapper.rb +9 -0
- data/lib/puppet/pgraph.rb +1 -1
- data/lib/puppet/property.rb +0 -1
- data/lib/puppet/provider.rb +9 -95
- data/lib/puppet/provider/confine.rb +77 -0
- data/lib/puppet/provider/confine/exists.rb +22 -0
- data/lib/puppet/provider/confine/false.rb +19 -0
- data/lib/puppet/provider/confine/feature.rb +17 -0
- data/lib/puppet/provider/confine/true.rb +20 -0
- data/lib/puppet/provider/confine/variable.rb +42 -0
- data/lib/puppet/provider/confine_collection.rb +47 -0
- data/lib/puppet/provider/confiner.rb +20 -0
- data/lib/puppet/provider/cron/crontab.rb +6 -2
- data/lib/puppet/provider/group/groupadd.rb +1 -1
- data/lib/puppet/provider/group/ldap.rb +48 -0
- data/lib/puppet/provider/ldap.rb +137 -0
- data/lib/puppet/provider/nameservice.rb +1 -2
- data/lib/puppet/provider/nameservice/objectadd.rb +2 -5
- data/lib/puppet/provider/package/dpkg.rb +16 -1
- data/lib/puppet/provider/package/freebsd.rb +15 -4
- data/lib/puppet/provider/package/gem.rb +33 -12
- data/lib/puppet/provider/package/pkgdmg.rb +1 -60
- data/lib/puppet/provider/package/ports.rb +6 -1
- data/lib/puppet/provider/package/rpm.rb +14 -13
- data/lib/puppet/provider/package/urpmi.rb +3 -3
- data/lib/puppet/provider/service/base.rb +4 -4
- data/lib/puppet/provider/service/debian.rb +1 -1
- data/lib/puppet/provider/service/init.rb +5 -3
- data/lib/puppet/provider/service/redhat.rb +35 -7
- data/lib/puppet/provider/ssh_authorized_key/parsed.rb +69 -0
- data/lib/puppet/provider/user/ldap.rb +133 -0
- data/lib/puppet/provider/user/useradd.rb +1 -1
- data/lib/puppet/rails/database/001_add_created_at_to_all_tables.rb +14 -14
- data/lib/puppet/rails/database/schema.rb +9 -0
- data/lib/puppet/rails/resource.rb +1 -0
- data/lib/puppet/reference/providers.rb +8 -2
- data/lib/puppet/reference/report.rb +23 -0
- data/lib/puppet/reports/rrdgraph.rb +4 -2
- data/lib/puppet/sslcertificates/ca.rb +9 -4
- data/lib/puppet/sslcertificates/support.rb +26 -2
- data/lib/puppet/transaction.rb +11 -16
- data/lib/puppet/transaction/change.rb +94 -0
- data/lib/puppet/transaction/event.rb +21 -0
- data/lib/puppet/transaction/report.rb +4 -0
- data/lib/puppet/type.rb +0 -2
- data/lib/puppet/type/file/ensure.rb +0 -5
- data/lib/puppet/type/file/group.rb +13 -7
- data/lib/puppet/type/file/source.rb +8 -15
- data/lib/puppet/type/file/target.rb +2 -0
- data/lib/puppet/type/group.rb +1 -1
- data/lib/puppet/type/mount.rb +4 -2
- data/lib/puppet/type/nagios_hostescalation.rb +3 -0
- data/lib/puppet/type/nagios_servicegroup.rb +3 -0
- data/lib/puppet/type/ssh_authorized_key.rb +56 -0
- data/lib/puppet/type/user.rb +3 -0
- data/lib/puppet/type/yumrepo.rb +0 -1
- data/lib/puppet/util.rb +1 -1
- data/lib/puppet/util/ldap.rb +5 -0
- data/lib/puppet/util/ldap/connection.rb +69 -0
- data/lib/puppet/util/ldap/generator.rb +45 -0
- data/lib/puppet/util/ldap/manager.rb +281 -0
- data/lib/puppet/util/posix.rb +2 -2
- data/lib/puppet/util/resource_template.rb +61 -0
- data/lib/puppet/util/settings.rb +63 -3
- data/lib/puppet/util/storage.rb +4 -0
- data/lib/puppet/util/warnings.rb +7 -0
- data/man/man8/filebucket.8 +116 -0
- data/man/man8/pi.8 +34 -0
- data/man/man8/puppet.8 +78 -0
- data/man/man8/puppet.conf.8 +1747 -0
- data/man/man8/puppetca.8 +118 -0
- data/man/man8/puppetd.8 +184 -0
- data/man/man8/puppetdoc.8 +62 -0
- data/man/man8/puppetmasterd.8 +87 -0
- data/man/man8/puppetrun.8 +151 -0
- data/man/man8/ralsh.8 +135 -0
- data/test/README +24 -0
- data/test/certmgr/support.rb +28 -1
- data/test/data/failers/badclassnoparam +10 -0
- data/test/data/failers/badclassparam +10 -0
- data/test/data/failers/badcompnoparam +9 -0
- data/test/data/failers/badcompparam +9 -0
- data/test/data/failers/badtypeparam +3 -0
- data/test/data/failers/noobjectrvalue +1 -0
- data/test/data/providers/cron/crontab.allthree +17 -0
- data/test/data/providers/cron/crontab.envNcomment +12 -0
- data/test/data/providers/cron/crontab.envNname +11 -0
- data/test/data/providers/cron/crontab.multirecords +12 -0
- data/test/data/providers/cron/crontab_collections.yaml +44 -0
- data/test/data/providers/cron/crontab_multiple_with_env.yaml +54 -0
- data/test/data/providers/cron/crontab_sample_records.yaml +272 -0
- data/test/data/providers/cron/examples/freebsd +2 -0
- data/test/data/providers/cron/examples/one +14 -0
- data/test/data/providers/cron/examples/openbsd +20 -0
- data/test/data/providers/package/testpackages.yaml +65 -0
- data/test/data/providers/ssh_authorized_key/parsed/authorized_keys +5 -0
- data/test/data/reports/1.yaml +108 -0
- data/test/data/reports/2.yaml +108 -0
- data/test/data/reports/tagmail_failers.conf +3 -0
- data/test/data/reports/tagmail_passers.conf +30 -0
- data/test/data/snippets/aliastest.pp +16 -0
- data/test/data/snippets/argumentdefaults +14 -0
- data/test/data/snippets/casestatement.pp +58 -0
- data/test/data/snippets/classheirarchy.pp +15 -0
- data/test/data/snippets/classincludes.pp +17 -0
- data/test/data/snippets/classpathtest +11 -0
- data/test/data/snippets/collection.pp +10 -0
- data/test/data/snippets/collection_within_virtual_definitions.pp +20 -0
- data/test/data/snippets/componentmetaparams.pp +11 -0
- data/test/data/snippets/componentrequire.pp +8 -0
- data/test/data/snippets/deepclassheirarchy.pp +23 -0
- data/test/data/snippets/defineoverrides.pp +17 -0
- data/test/data/snippets/emptyclass.pp +9 -0
- data/test/data/snippets/emptyexec.pp +3 -0
- data/test/data/snippets/falsevalues.pp +3 -0
- data/test/data/snippets/filecreate +11 -0
- data/test/data/snippets/fqdefinition.pp +5 -0
- data/test/data/snippets/fqparents.pp +11 -0
- data/test/data/snippets/implicititeration +15 -0
- data/test/data/snippets/multipleinstances +7 -0
- data/test/data/snippets/multisubs.pp +13 -0
- data/test/data/snippets/namevartest +9 -0
- data/test/data/snippets/scopetest +13 -0
- data/test/data/snippets/selectorvalues.pp +42 -0
- data/test/data/snippets/simpledefaults +5 -0
- data/test/data/snippets/simpleselector +38 -0
- data/test/data/snippets/singleary.pp +19 -0
- data/test/data/snippets/singlequote.pp +11 -0
- data/test/data/snippets/singleselector.pp +22 -0
- data/test/data/snippets/subclass_name_duplication.pp +11 -0
- data/test/data/snippets/tag.pp +9 -0
- data/test/data/snippets/tagged.pp +35 -0
- data/test/data/snippets/virtualresources.pp +14 -0
- data/test/data/types/hosts/1 +3 -0
- data/test/data/types/hosts/2 +13 -0
- data/test/data/types/hosts/solaris +5 -0
- data/test/data/types/mailalias/file1 +183 -0
- data/test/data/types/mount/freebsd.fstab +7 -0
- data/test/data/types/mount/linux.fstab +11 -0
- data/test/data/types/mount/solaris.fstab +11 -0
- data/test/data/types/port/1 +533 -0
- data/test/data/types/port/darwin +11866 -0
- data/test/data/types/ssh_authorized_key/1 +2 -0
- data/test/data/types/sshkey/1 +21 -0
- data/test/data/types/yumrepos/fedora-devel.repo +26 -0
- data/test/data/types/yumrepos/fedora.repo +9 -0
- data/test/language/parser.rb +8 -1
- data/test/lib/puppettest/runnable_test.rb +3 -0
- data/test/lib/puppettest/support/utils.rb +1 -1
- data/test/lib/rake/puppet_testtask.rb +3 -0
- data/test/lib/stubba.rb +1 -1
- data/test/network/client/ca.rb +1 -0
- data/test/network/client/master.rb +13 -127
- data/test/network/handler/master.rb +61 -80
- data/test/other/provider.rb +0 -45
- data/test/other/transactions.rb +53 -15
- data/test/rails/host.rb +0 -37
- data/test/ral/providers/cron/crontab.rb +32 -3
- data/test/ral/providers/provider.rb +28 -7
- data/test/ral/type/filesources.rb +2 -18
- data/test/ral/type/sshkey.rb +0 -1
- data/test/ral/type/user.rb +6 -0
- data/test/test +241 -0
- metadata +289 -113
- data/examples/root/etc/configfile +0 -0
- data/examples/root/etc/debian-passwd +0 -29
- data/examples/root/etc/debian-syslog.conf +0 -71
- data/lib/puppet/event.rb +0 -28
- data/lib/puppet/network/handler/configuration.rb +0 -184
- data/lib/puppet/network/http/mongrel/xmlrpc.rb +0 -4
- data/lib/puppet/network/http/webrick/xmlrpc.rb +0 -4
- data/lib/puppet/propertychange.rb +0 -141
- data/lib/puppet/provider/interface/redhat.rb +0 -250
- data/lib/puppet/provider/interface/sunos.rb +0 -133
- data/lib/puppet/type/interface.rb +0 -60
- data/lib/puppet/util/variables.rb +0 -38
- data/test/network/handler/configuration.rb +0 -160
- data/test/other/propertychange.rb +0 -140
- data/test/util/loadedfile.rb +0 -121
@@ -228,7 +228,9 @@ class Nagios::Base
|
|
228
228
|
|
229
229
|
# This is probably a bad idea.
|
230
230
|
def name=(value)
|
231
|
-
|
231
|
+
unless self.class.namevar.to_s == "name"
|
232
|
+
send(self.class.namevar.to_s + "=", value)
|
233
|
+
end
|
232
234
|
end
|
233
235
|
|
234
236
|
def namevar
|
@@ -318,59 +320,64 @@ class Nagios::Base
|
|
318
320
|
self.class.name
|
319
321
|
end
|
320
322
|
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
323
|
+
# object types
|
324
|
+
newtype :command do
|
325
|
+
setparameters :command_name, :command_line
|
326
|
+
end
|
325
327
|
|
326
|
-
|
328
|
+
newtype :contact do
|
327
329
|
setparameters :contact_name, :alias, :host_notification_period,
|
328
|
-
|
329
|
-
|
330
|
-
|
330
|
+
:host_notification_commands, :service_notification_period,
|
331
|
+
:service_notification_commands, :register, :email, :pager,
|
332
|
+
:service_notification_options, :host_notification_options
|
331
333
|
|
332
334
|
setsuperior "person"
|
333
|
-
|
335
|
+
end
|
334
336
|
|
335
|
-
|
336
|
-
|
337
|
-
|
337
|
+
newtype :contactgroup do
|
338
|
+
setparameters :contactgroup_name, :alias, :members
|
339
|
+
end
|
338
340
|
|
339
|
-
|
341
|
+
newtype :host do
|
340
342
|
setparameters :host_name, :notifications_enabled, :event_handler_enabled,
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
:failure_prediction_enabled, :parents
|
343
|
+
:flap_detection_enabled, :process_perf_data, :retain_status_information,
|
344
|
+
:retain_nonstatus_information, :register, :use, :alias,
|
345
|
+
:address, :check_command, :max_check_attempts, :notification_interval,
|
346
|
+
:notification_period, :notification_options, :checks_enabled,
|
347
|
+
:failure_prediction_enabled, :parents, :contact_groups
|
346
348
|
|
347
349
|
setsuperior "person"
|
348
|
-
|
349
350
|
map :address => "ipHostNumber"
|
350
|
-
|
351
|
-
|
352
|
-
newtype :hostextinfo do
|
353
|
-
auxiliary = true
|
351
|
+
end
|
354
352
|
|
353
|
+
newtype :hostextinfo do
|
354
|
+
auxiliary = true
|
355
355
|
setparameters :host_name, :notes_url, :icon_image, :icon_image_alt, :vrml_image,
|
356
|
-
|
356
|
+
"2d_coords".intern, "3d_coords".intern
|
357
357
|
|
358
358
|
setnamevar :host_name
|
359
|
-
|
359
|
+
end
|
360
360
|
|
361
|
-
|
361
|
+
newtype :hostgroup do
|
362
362
|
setparameters :hostgroup_name, :alias, :contact_groups, :members
|
363
|
-
|
363
|
+
end
|
364
|
+
|
365
|
+
newtype :hostescalation do
|
366
|
+
setparameters :name, :first_notification, :last_notification,
|
367
|
+
:notification_interval, :contact_groups,
|
368
|
+
:escalation_options, :register, :hostgroup_name
|
369
|
+
setnamevar :name
|
370
|
+
end
|
364
371
|
|
365
|
-
|
366
|
-
|
372
|
+
newtype :hostgroupescalation do
|
373
|
+
auxiliary = true
|
367
374
|
setparameters :hostgroup_name, :first_notification, :last_notification,
|
368
|
-
|
375
|
+
:contact_groups, :notification_interval
|
369
376
|
|
370
377
|
setnamevar :hostgroup_name
|
371
|
-
|
378
|
+
end
|
372
379
|
|
373
|
-
|
380
|
+
newtype :service do
|
374
381
|
attach :host => :host_name
|
375
382
|
setparameters :name, :active_checks_enabled, :passive_checks_enabled,
|
376
383
|
:parallelize_check, :obsess_over_service, :check_freshness,
|
@@ -381,41 +388,48 @@ class Nagios::Base
|
|
381
388
|
:normal_check_interval, :retry_check_interval, :contact_groups,
|
382
389
|
:notification_interval, :notification_period, :notification_options,
|
383
390
|
:service_description, :host_name, :freshness_threshold,
|
384
|
-
:check_command
|
391
|
+
:check_command, :hostgroup_name, :event_handler, :servicegroups, :host
|
385
392
|
|
386
393
|
suppress :host_name
|
387
394
|
|
388
395
|
setnamevar :service_description
|
389
|
-
|
396
|
+
end
|
390
397
|
|
391
|
-
|
398
|
+
newtype :servicedependency do
|
392
399
|
auxiliary = true
|
393
400
|
setparameters :host_name, :service_description, :dependent_host_name,
|
394
|
-
|
395
|
-
|
401
|
+
:dependent_service_description, :execution_failure_criteria,
|
402
|
+
:notification_failure_criteria, :hostgroup_name,
|
403
|
+
:dependent_hostgroup_name
|
396
404
|
|
397
405
|
setnamevar :host_name
|
398
|
-
|
406
|
+
end
|
399
407
|
|
400
408
|
newtype :serviceescalation do
|
401
409
|
setparameters :host_name, :service_description, :first_notification,
|
402
|
-
:last_notification, :contact_groups, :notification_interval
|
410
|
+
:last_notification, :contact_groups, :notification_interval, :hostgroup_name
|
403
411
|
|
404
412
|
setnamevar :host_name
|
405
413
|
end
|
406
414
|
|
407
|
-
|
415
|
+
newtype :servicegroup do
|
416
|
+
setparameters :servicegroup_name, :alias
|
417
|
+
|
418
|
+
setnamevar :servicegroup_name
|
419
|
+
end
|
420
|
+
|
421
|
+
newtype :serviceextinfo do
|
408
422
|
auxiliary = true
|
409
423
|
|
410
424
|
setparameters :host_name, :service_description, :icon_image, :icon_image_alt
|
411
425
|
|
412
426
|
setnamevar :host_name
|
413
|
-
|
427
|
+
end
|
414
428
|
|
415
|
-
|
416
|
-
setparameters :timeperiod_name, :alias, :sunday, :monday, :tuesday,
|
417
|
-
|
418
|
-
|
429
|
+
newtype :timeperiod do
|
430
|
+
setparameters :timeperiod_name, :alias, :sunday, :monday, :tuesday,
|
431
|
+
:wednesday, :thursday, :friday, :saturday
|
432
|
+
end
|
419
433
|
end
|
420
434
|
|
421
435
|
# $Id$
|
@@ -12,7 +12,8 @@ module Puppet::FileServing::IndirectionHooks
|
|
12
12
|
PROTOCOL_MAP = {"puppet" => :rest, "file" => :file, "puppetmounts" => :file_server}
|
13
13
|
|
14
14
|
# Pick an appropriate terminus based on the protocol.
|
15
|
-
def select_terminus(
|
15
|
+
def select_terminus(request)
|
16
|
+
full_uri = request.key
|
16
17
|
# Short-circuit to :file if it's a fully-qualified path.
|
17
18
|
return PROTOCOL_MAP["file"] if full_uri =~ /^#{::File::SEPARATOR}/
|
18
19
|
begin
|
@@ -29,11 +30,12 @@ module Puppet::FileServing::IndirectionHooks
|
|
29
30
|
terminus = :file_server
|
30
31
|
end
|
31
32
|
|
33
|
+
# This is the backward-compatible module terminus.
|
32
34
|
if terminus == :file_server and uri.path =~ %r{^/([^/]+)\b}
|
33
35
|
modname = $1
|
34
36
|
if modname == "modules"
|
35
37
|
terminus = :modules
|
36
|
-
elsif terminus(:modules).find_module(modname, options[:node])
|
38
|
+
elsif terminus(:modules).find_module(modname, request.options[:node])
|
37
39
|
Puppet.warning "DEPRECATION NOTICE: Found file '%s' in module without using the 'modules' mount; please prefix path with '/modules'" % uri.path
|
38
40
|
terminus = :modules
|
39
41
|
end
|
@@ -11,15 +11,6 @@ require 'puppet/file_serving/indirection_hooks'
|
|
11
11
|
|
12
12
|
# A class that handles retrieving file metadata.
|
13
13
|
class Puppet::FileServing::Metadata < Puppet::FileServing::FileBase
|
14
|
-
module MetadataHelper
|
15
|
-
include Puppet::FileServing::IndirectionHooks
|
16
|
-
|
17
|
-
def post_find(instance)
|
18
|
-
end
|
19
|
-
|
20
|
-
def post_search(key, options = {})
|
21
|
-
end
|
22
|
-
end
|
23
14
|
|
24
15
|
include Puppet::Util::Checksums
|
25
16
|
|
@@ -8,11 +8,11 @@ require 'puppet/file_serving/fileset'
|
|
8
8
|
# Define some common methods for FileServing termini.
|
9
9
|
module Puppet::FileServing::TerminusHelper
|
10
10
|
# Create model instances for all files in a fileset.
|
11
|
-
def path2instances(
|
12
|
-
args = [:links, :ignore, :recurse].inject({}) { |hash, param| hash[param] = options[param] if options[param]; hash }
|
11
|
+
def path2instances(request, path)
|
12
|
+
args = [:links, :ignore, :recurse].inject({}) { |hash, param| hash[param] = request.options[param] if request.options[param]; hash }
|
13
13
|
Puppet::FileServing::Fileset.new(path, args).files.collect do |file|
|
14
|
-
inst = model.new(File.join(key, file), :path => path, :relative_path => file)
|
15
|
-
inst.links = options[:links] if options[:links]
|
14
|
+
inst = model.new(File.join(request.key, file), :path => path, :relative_path => file)
|
15
|
+
inst.links = request.options[:links] if request.options[:links]
|
16
16
|
inst
|
17
17
|
end
|
18
18
|
end
|
data/lib/puppet/indirector.rb
CHANGED
@@ -9,6 +9,7 @@ module Puppet::Indirector
|
|
9
9
|
|
10
10
|
require 'puppet/indirector/indirection'
|
11
11
|
require 'puppet/indirector/terminus'
|
12
|
+
require 'puppet/indirector/envelope'
|
12
13
|
|
13
14
|
# Declare that the including class indirects its methods to
|
14
15
|
# this terminus. The terminus name must be the name of a Puppet
|
@@ -20,6 +21,7 @@ module Puppet::Indirector
|
|
20
21
|
# populate this class with the various new methods
|
21
22
|
extend ClassMethods
|
22
23
|
include InstanceMethods
|
24
|
+
include Puppet::Indirector::Envelope
|
23
25
|
|
24
26
|
# instantiate the actual Terminus for that type and this name (:ldap, w/ args :node)
|
25
27
|
# & hook the instantiated Terminus into this class (Node: @indirection = terminus)
|
@@ -28,41 +30,37 @@ module Puppet::Indirector
|
|
28
30
|
end
|
29
31
|
|
30
32
|
module ClassMethods
|
31
|
-
|
33
|
+
attr_reader :indirection
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
-
|
35
|
+
def cache_class=(klass)
|
36
|
+
indirection.cache_class = klass
|
37
|
+
end
|
36
38
|
|
37
|
-
|
38
|
-
|
39
|
-
|
39
|
+
def terminus_class=(klass)
|
40
|
+
indirection.terminus_class = klass
|
41
|
+
end
|
40
42
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
# Expire any cached instance.
|
44
|
+
def expire(*args)
|
45
|
+
indirection.expire *args
|
46
|
+
end
|
47
|
+
|
48
|
+
def find(*args)
|
49
|
+
indirection.find *args
|
50
|
+
end
|
48
51
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
+
def destroy(*args)
|
53
|
+
indirection.destroy *args
|
54
|
+
end
|
52
55
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
+
def search(*args)
|
57
|
+
indirection.search *args
|
58
|
+
end
|
56
59
|
end
|
57
60
|
|
58
61
|
module InstanceMethods
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
# these become instance methods
|
64
|
-
def save(*args)
|
65
|
-
self.class.indirection.save(self, *args)
|
66
|
-
end
|
62
|
+
def save(*args)
|
63
|
+
self.class.indirection.save self, *args
|
64
|
+
end
|
67
65
|
end
|
68
66
|
end
|
@@ -13,15 +13,13 @@ class Puppet::Node::Catalog::Compiler < Puppet::Indirector::Code
|
|
13
13
|
attr_accessor :code
|
14
14
|
|
15
15
|
# Compile a node's catalog.
|
16
|
-
def find(
|
17
|
-
|
18
|
-
node
|
19
|
-
else
|
20
|
-
node = find_node(key)
|
16
|
+
def find(request)
|
17
|
+
unless node = request.options[:use_node] || find_node(request.key)
|
18
|
+
raise ArgumentError, "Could not find node '%s'; cannot compile" % request.key
|
21
19
|
end
|
22
20
|
|
23
21
|
if catalog = compile(node)
|
24
|
-
return catalog
|
22
|
+
return catalog
|
25
23
|
else
|
26
24
|
# This shouldn't actually happen; we should either return
|
27
25
|
# a config or raise an exception.
|
@@ -46,22 +44,6 @@ class Puppet::Node::Catalog::Compiler < Puppet::Indirector::Code
|
|
46
44
|
$0 =~ /puppetmasterd/
|
47
45
|
end
|
48
46
|
|
49
|
-
# Return the catalog version. Here we're returning the
|
50
|
-
# latest of the node, fact, or parse date. These are the
|
51
|
-
# three things that go into compiling a client catalog,
|
52
|
-
# so changes in any of them result in changes.
|
53
|
-
# LAK:FIXME Note that this only works when all three sources
|
54
|
-
# use timestamps; once one of them moves to using real versions,
|
55
|
-
# the comparison stops working.
|
56
|
-
def version(key)
|
57
|
-
if node = Puppet::Node.find_by_any_name(key)
|
58
|
-
return [Puppet::Node.version(key).to_f, Puppet::Node::Facts.version(key).to_f, interpreter.catalog_version(node).to_f].sort[-1]
|
59
|
-
else
|
60
|
-
# This is the standard for "got nothing for ya".
|
61
|
-
0
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
47
|
private
|
66
48
|
|
67
49
|
# Add any extra data necessary to the node.
|
@@ -102,16 +84,12 @@ class Puppet::Node::Catalog::Compiler < Puppet::Indirector::Code
|
|
102
84
|
def find_node(key)
|
103
85
|
# If we want to use the cert name as our key
|
104
86
|
# LAK:FIXME This needs to be figured out somehow, but it requires the routing.
|
87
|
+
# This should be able to use the request, yay.
|
105
88
|
#if Puppet[:node_name] == 'cert' and client
|
106
89
|
# key = client
|
107
90
|
#end
|
108
91
|
|
109
|
-
|
110
|
-
# know about the node, or they should be using the ``null`` node source, which
|
111
|
-
# will always return data.
|
112
|
-
unless node = Puppet::Node.find_by_any_name(key)
|
113
|
-
raise Puppet::Error, "Could not find node '%s'" % key
|
114
|
-
end
|
92
|
+
return nil unless node = Puppet::Node.find(key)
|
115
93
|
|
116
94
|
# Add any external data to the node.
|
117
95
|
add_node_data(node)
|
@@ -18,8 +18,8 @@ class Puppet::Checksum::File < Puppet::Indirector::File
|
|
18
18
|
path.join(File::SEPARATOR)
|
19
19
|
end
|
20
20
|
|
21
|
-
def save(
|
22
|
-
path = File.dirname(path(
|
21
|
+
def save(request)
|
22
|
+
path = File.dirname(path(request.key))
|
23
23
|
|
24
24
|
# Make the directories if necessary.
|
25
25
|
unless FileTest.directory?(path)
|
@@ -11,17 +11,17 @@ class Puppet::Indirector::DirectFileServer < Puppet::Indirector::Terminus
|
|
11
11
|
include Puppet::Util::URIHelper
|
12
12
|
include Puppet::FileServing::TerminusHelper
|
13
13
|
|
14
|
-
def find(
|
15
|
-
uri = key2uri(key)
|
14
|
+
def find(request)
|
15
|
+
uri = key2uri(request.key)
|
16
16
|
return nil unless FileTest.exists?(uri.path)
|
17
|
-
instance = model.new(key, :path => uri.path)
|
18
|
-
instance.links = options[:links] if options[:links]
|
17
|
+
instance = model.new(request.key, :path => uri.path)
|
18
|
+
instance.links = request.options[:links] if request.options[:links]
|
19
19
|
return instance
|
20
20
|
end
|
21
21
|
|
22
|
-
def search(
|
23
|
-
uri = key2uri(key)
|
22
|
+
def search(request)
|
23
|
+
uri = key2uri(request.key)
|
24
24
|
return nil unless FileTest.exists?(uri.path)
|
25
|
-
path2instances(
|
25
|
+
path2instances(request, uri.path)
|
26
26
|
end
|
27
27
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'puppet/indirector'
|
2
|
+
|
3
|
+
# Provide any attributes or functionality needed for indirected
|
4
|
+
# instances.
|
5
|
+
module Puppet::Indirector::Envelope
|
6
|
+
attr_accessor :expiration
|
7
|
+
|
8
|
+
def expired?
|
9
|
+
return false unless expiration
|
10
|
+
return false if expiration >= Time.now
|
11
|
+
return true
|
12
|
+
end
|
13
|
+
end
|
@@ -3,9 +3,9 @@ require 'puppet/util'
|
|
3
3
|
|
4
4
|
class Puppet::Indirector::Exec < Puppet::Indirector::Terminus
|
5
5
|
# Look for external node definitions.
|
6
|
-
def find(
|
6
|
+
def find(request)
|
7
7
|
# Run the command.
|
8
|
-
unless output = query(
|
8
|
+
unless output = query(request.key)
|
9
9
|
return nil
|
10
10
|
end
|
11
11
|
|
@@ -56,8 +56,8 @@ class Puppet::Node::Facts::Facter < Puppet::Indirector::Code
|
|
56
56
|
end
|
57
57
|
|
58
58
|
# Look a host's facts up in Facter.
|
59
|
-
def find(
|
60
|
-
Puppet::Node::Facts.new(key, Facter.to_hash)
|
59
|
+
def find(request)
|
60
|
+
Puppet::Node::Facts.new(request.key, Facter.to_hash)
|
61
61
|
end
|
62
62
|
|
63
63
|
def save(facts)
|