hi,

thanks for the reply :-) 

I added a custom fact via modules/role/lib/facter/role.rb

Facter.add(:role) do
   setcode do
     host = Facter.value(:fqdn)
     declared_role = Facter.value(host)
     declared_role.nil? ? 'base' : declared_role
   end
end

I copied that piece of code and it works, if I change "base" to 
"mysql_server". In the end, I can execute on the mon.example.com "facter -p 
role" and I get "mysql_server" back. So far so good. I saw many examples 
how to set the fact, but mostly I dislike them (e.g. create file 
/etc/system_role ... hardcoded in the Facter.add .... ). What I miss: how 
can I set the fact (role in my case) via hiera, or via node manifest ?


cu denny

-- 
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/2840db66-1c91-43c9-8e96-47f52b38f7e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to