Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/adblockplus/manifests/host/example.pp

Issue 29338046: Issue 3638 - Introduce type adblockplus::host (Closed)
Patch Set: Created March 9, 2016, 11:57 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « modules/adblockplus/manifests/host.pp ('k') | modules/adblockplus/manifests/init.pp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/adblockplus/manifests/host/example.pp
diff --git a/modules/adblockplus/manifests/host/example.pp b/modules/adblockplus/manifests/host/example.pp
new file mode 100644
index 0000000000000000000000000000000000000000..284a9599a5868d9a1ec25c07f5c0b79d3f673d82
--- /dev/null
+++ b/modules/adblockplus/manifests/host/example.pp
@@ -0,0 +1,25 @@
+# == Type: adblockplus::host::example
+#
+# An example on how to apply resource definitions that are specific to the
+# current node's $::role, but need to recognize or correspond to a subset of
+# all hosts within the same environment. One can introduce another manifest
+# corresponding to the adblockplus::host::$::role pattern when integrating
+# resources that are set up based on individual host information.
+#
+# This workaround is required due to the circumstance that module adblockplus
+# must still remain Puppet 2.7 compatible, which does not feature sophisticated
+# iteration over i.e. resource definitions or collectors, hence makes it very
+# difficult to re-use information whilst maintaining clear abstraction.
+#
+# See type adblockplus::host for more information.
+#
+define adblockplus::host::example {
+
+ # Puppetlab's stdlib allows for accessing host parameters
+ $fqdn = getparam(Adblockplus::Host[$title], 'fqdn')
+
+ # Examplary resource without side-effects
+ notify {"$fqdn#example":
+ message => "Place definitions requiring information about host $fqdn here",
+ }
+}
« no previous file with comments | « modules/adblockplus/manifests/host.pp ('k') | modules/adblockplus/manifests/init.pp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld