summaryrefslogtreecommitdiff
path: root/3 Resources/Puppet/Declaring classes.md
diff options
context:
space:
mode:
Diffstat (limited to '3 Resources/Puppet/Declaring classes.md')
-rw-r--r--3 Resources/Puppet/Declaring classes.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/3 Resources/Puppet/Declaring classes.md b/3 Resources/Puppet/Declaring classes.md
new file mode 100644
index 0000000..793d4b3
--- /dev/null
+++ b/3 Resources/Puppet/Declaring classes.md
@@ -0,0 +1,27 @@
+---
+tags:
+ - puppet
+references:
+ - https://www.puppet.com/docs/puppet/7/lang_classes#lang_class_declare
+---
+Prefer include over resource-like; more flexible and idempotent. Resource-like to pass args without needing to use hieradata.
+
+> Mixing declaration types for the same class can lead to compilation errors.
+
+# Include-like <- preferred
+Relies on external data, e.g hieradata, and defaults.
+Idempotent: it is only added to the catalog once.
+
+### `include`
+Accepts: single class, class reference (`Class[..]`), comma-seperated list of those or an array of them.
+
+## `require`
+Same as above - but the class becomes a dependency of the container. #clarify dependency.
+
+## `contain`
+Adheres to same rules as above. Relationships of the containing class extend to the contained class.
+See [[Containment]].
+
+# Resource-like
+Can be declared only once.
+Must be unique to avoid conflicting parameter values. \ No newline at end of file