Skip to content

Commit 94c17f0

Browse files
Merge pull request #8818 from BobosilaVictor/PUP-10151/update-documentation-lookup
(PUP-10151) Update man page for the puppet lookup command
2 parents 6a2beb8 + 52b830e commit 94c17f0

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/puppet/application/lookup.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ def help
134134
The lookup command is a CLI for Puppet's 'lookup()' function. It searches your
135135
Hiera data and returns a value for the requested lookup key, so you can test and
136136
explore your data. It is a modern replacement for the 'hiera' command.
137-
137+
Lookup uses the setting for global hiera.yaml from puppet's config,
138+
and the environment to find the environment level hiera.yaml as well as the
139+
resulting modulepath for the environment (for hiera.yaml files in modules).
138140
Hiera usually relies on a node's facts to locate the relevant data sources. By
139141
default, 'puppet lookup' uses facts from the node you run the command on, but
140142
you can get data for any other node with the '--node <NAME>' option. If
@@ -183,7 +185,8 @@ def help
183185
* --environment <ENV>
184186
Like with most Puppet commands, you can specify an environment on the command
185187
line. This is important for lookup because different environments can have
186-
different Hiera data.
188+
different Hiera data. This environment will be always be the one used regardless
189+
of any other factors.
187190
188191
* --merge first|unique|hash|deep:
189192
Specify the merge behavior, overriding any merge behavior from the data's
@@ -234,6 +237,13 @@ def help
234237
To look up 'key_name' using the Puppet Server node's facts:
235238
$ puppet lookup key_name
236239
240+
To look up 'key_name' using the Puppet Server node's arbitrary variables from a manifest, and
241+
classify the node if applicable:
242+
$ puppet lookup key_name --compile
243+
244+
To look up 'key_name' using the Puppet Server node's facts, overridden by facts given in a file:
245+
$ puppet lookup key_name --facts fact_file.yaml
246+
237247
To look up 'key_name' with agent.local's facts:
238248
$ puppet lookup --node agent.local key_name
239249

0 commit comments

Comments
 (0)