Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 257

How to get hiera to output the literal string '%{::fqdn}'?

$
0
0
I would like to know what I would need to have in my yaml file to have hiera output the literal string `%{::fqdn}` instead of outputting the value of the puppet fact `fqdn`. Here is what I have tried. # grep foo::p4 /etc/puppetlabs/code/environments/production/hieradata/bar.yaml foo::p4: 'http://%{hiera(''p1'')}/%{::fqdn}' And this is the result: # hiera foo::p4 '::prefix_fact=bar' '::fqdn=thing.com' environment=production http://test/thing.com What I actually want the output to be is: http://%{hiera('p1')}/%{::fqdn} I guess I could do something goofy like this: p1: 'test' pa: '%{hiera' pb: '("p1")}' pc: '%{::fq' pd: 'dn}' foo::p4: "%{hiera('pa')}%{hiera('pb')}%{hiera('pc')}%{hiera('pd')}" Then the output is what I want: # hiera foo::p4 '::prefix=bar' '::fqdn=thing.com' environment=production %{hiera("p1")}%{::fqdn}

Viewing all articles
Browse latest Browse all 257

Trending Articles