summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHunter Haugen <hunter@puppet.com>2017-07-21 14:46:19 -0700
committerHunter Haugen <hunter@puppet.com>2017-07-21 14:46:19 -0700
commit4a658957db669efef666feb61b5d5c1406d105e9 (patch)
tree3d77a55c797847e63ca50995e943b62f54395c00
parent539ba5d8a78f0f41736d605e0027ef61113ed515 (diff)
parent32a6fb29b05d0df233a83982d48b7448d97f48eb (diff)
Merge pull request #797 from reidmv/fact_function
Update README for fact() function
-rw-r--r--README.md25
1 files changed, 25 insertions, 0 deletions
diff --git a/README.md b/README.md
index b92c226..2b1e005 100644
--- a/README.md
+++ b/README.md
@@ -895,6 +895,31 @@ userlist:
ensure_resources('user', hiera_hash('userlist'), {'ensure' => 'present'})
```
+#### `fact`
+
+Return the value of a given fact. Supports the use of dot-notation for referring to structured facts. If a fact requested does not exist, returns Undef.
+
+Example usage:
+
+```puppet
+fact('kernel')
+fact('osfamily')
+fact('os.architecture')
+```
+
+Array indexing:
+
+```puppet
+$first_processor = fact('processors.models.0')
+$second_processor = fact('processors.models.1')
+```
+
+Fact containing a "." in the fact name:
+
+```puppet
+fact('vmware."VRA.version"')
+```
+
#### `flatten`
Flattens deeply nested arrays and returns a single flat array as a result.