hi,
since the stock 'networking' fact does not find the correct "primary"
network interface in my case (there is another interface with the default
route), i want to change the related 'networking.ip', 'networking.primary'
values of this stuctured fact by writing a custom fact in Ruby. Its
straight-forward to replace the whole fact but how could i keep the stock
values of the other items? As soon as i obtain the stock value of the fact
with
stock_fact = Facter.value(:networking)
the fact is resolved and there seems to be no way of modifying it
afterwards. Basically its a chicken-and-egg problem but if there was the
possibility to force a re-evaluate of the fact or define resolutions just
for single items of a fact ...
here is the complete example:
# get the stock value of the fact
networking_fact = Facter.value(:networking)
# add a resolution for the fact but this has no impact on the final value
of the fact since Facter does not evaluate the fact again
Facter.add(:networking, { :value => "networking" }) do
has_weight 200
setcode do
"does not matter what goes here"
end
end
--
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/b59af634-1851-44ac-8e1d-60a0dfe45615%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.