Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alex501212 committed Nov 6, 2024
1 parent 7d9ac15 commit edf79d6
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions documentation/hiera.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,10 @@ Running the plan results in an error like this:
```shell
$ bolt plan run my_project::request --targets server
Starting: plan my_project::request
Finished: plan my_project::example in 0.01 sec
{
"kind": "bolt/pal-error",
"msg": "Interpolations are not supported in lookups outside of an apply block: Undefined variable 'trusted' (file: /Users/bolt/.puppetlabs/bolt/hiera.yaml)",
"details": {
}
}
Interpolation failed with 'application', but compilation continuing;
(file & line not available)
Finished: plan my_project::request in 0.01 sec
Function lookup() did not find a value for the name 'api_key'
```

The plan run fails because the lookup takes place outside of an apply block,
Expand Down Expand Up @@ -218,8 +215,9 @@ apply block.

Interpolations are not well supported in the `plan_hierarchy` hierarchy.
Target-level data such as facts are not available to lookups outside of apply blocks,
so the normal hierarchy interpolation does not work. The `lookup()` function
only interpolates based on the variables currently in scope.
so the normal hierarchy interpolation does not work.
However, the `lookup()` function can perform lookups without error by using default
values provided by Puppet and Hiera when the necessary context is not available.

The following example demonstrates interpolating the `$application` variable
into a `plan_hierarchy` hierarchy:
Expand Down

0 comments on commit edf79d6

Please sign in to comment.