I am converting one of my masterless modules to use Consul. How do I use external facts to pass in the Consul host and Consul token? These change in every environment and are not managed by Puppet. I am using the Puppet module 'lynxman-hiera_consul', '0.1.2'. Note that I had to downgrade my hiera.yaml to version 3 to use it with this module.
Before my Puppet masterless run I export some facts
export FACTER_CONSULHOST=consul-randomid..us-west-2.elb.amazonaws.com
export FACTER_MYTOKEN=some-token
I can test this works with
facter mytoken; puppet facts --debug|grep mytoken
facter consulhost;puppet facts --debug|grep consulhost
My hiera.yaml looks like this Hiera.yaml Gist. This works fine if I replace the fact interpolation with strings.
With the basic issue being with the fact interpolation on line 15
:token: "%{facts.mytoken}"
This is my example manifest for testing this Consul.pp Gist