This applies to facter version 1.7 and above. See docs:
http://docs.puppetlabs.com/guides/custom_facts.html#external-facts
You can create a file like this (the name does not matter):
/etc/facter/facts.d/myfacts.txt:
hostname=value
Then when you run 'facter hostname', "value" will be returned.
❧ Brian Mathis
On Tue, May 6, 2014 at 7:43 AM, Jakov Sosic <[email protected]> wrote:
> On 05/06/2014 12:29 AM, Brian Mathis wrote:
>
>> The problem is that your variable names are being returned from the
>> $(cat...) after bash has already evaluated the environment, so it's
>> taking it as a literal string and trying to execute the command.
>>
>> To get bash to interpret it as a variable, use 'eval':
>> eval $(cat test_values | tr '\n' ' ' ) puppet apply --noop -e
>> 'notice("${fqdn}")'
>>
>> Also, on modern versions of facter you can place facts in
>> /etc/facter/facts.d and they will override the detected versions.
>>
>
> Can you show an example how to override facter value with file in
> /etc/facter/facts.d/ ? For example, how to override hostname?
>
>
> --
> 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/5368CAD9.1030302%40gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.
>
--
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/CALKwpEwyEaGx_AtpXxc%2B8%3DCxa1Nh0M8y78zq6P4ArebZp1P3Eg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.