Apologies, I didn't spot the extra quotes (or read properly what you said
about them).... I clearly need more coffee... Yes, that does work...
---
"foo.bar.tango": bar
$bar = lookup("'foo.bar.tango'")
notify { $bar: }
Notice: /Stage[main]/Main/Notify[bar]/message: defined 'message' as 'bar'
On Fri, Oct 6, 2017 at 9:35 AM, Craig Dunn <[email protected]> wrote:
>
>
> On Thu, Oct 5, 2017 at 6:44 PM, Henrik Lindberg <
> [email protected]> wrote:
>
>> On 04/10/17 08:54, John Baird wrote:
>>
>>>
>>> Something like "lookup('/path/to/somefile.txt', scope=false)"... In
>>> this manner, the user and more specifically, each lookup call can determine
>>> whether or not to include the dotted key.
>>>
>>>
>> You get what you want if you quote the entire key.
>>
>> lookup("'/path/to/somefile.txt'")
>>
>> Note the quotes inside of the string. In lookup any quoted part is taken
>> verbatim and will not be subject to interpretation as a 'dig' into the
>> value being looked up.
>>
>> - henrik
>>
>>
> Hi Henrik.
>
> This is not the behaviour that I see. The fact that interpolated strings
> still dig is actually useful for dynamically digging into hashes, that
> doesn't help the OP though.....
>
> [root@puppet hieradata]# cat common.yaml
> ---
>
> foo:
> bar:
> tango: delta
>
> [root@puppet hieradata]# puppet apply -e 'notify {
> *lookup("foo.bar.tango")*: }'
> ...
> Notice: delta
> Notice: /Stage[main]/Main/Notify[delta]/message: defined 'message' as
> 'delta'
>
> Regards
> Craig
>
>
>
--
Enviatics | Automation and Configuration Management
Puppet Labs Service Delivery Partner & Certified Consultant
http://www.enviatics.com | @Enviatics | [email protected]
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/CACxdKhEmHhf7aYAe37wUYCxesrBSCka84ARQSHyX73PAtrn%3DGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.