Facts are autoloaded from all modules and distributed to all agents,
because that step occurs before the DSL is parsed for manifests (as it
should be, because the DSL can be (is) impacted by facts).
It is up to the custom fact to case itself out of execution for certain
operating systems. For instance, from the postgresql pupmod comes this
snippet from the customer fact about default versions:
Facter.add("postgres_default_version") do
setcode do
result =
case Facter.value('osfamily')
when 'RedHat'
get_redhatfamily_postgres_version()
when 'Linux'
get_redhatfamily_postgres_version()
when 'Debian'
get_debianfamily_postgres_version()
else
nil
end
Jeff
On 12/18/2013 09:29 AM, Andreas Dvorak wrote:
Dear all
I have a module spacewalk with a custom fact to define if the server
has been registered to spacewalk.
The module should only run on RedHat server
class profiles::base {
...
case $::osfamily {
redhat:{
include spacewalk
include logrotate
include postfix
}
solaris:{
include sendmail
}
default:{
fail("Unsupported platform: ${::osfamily}")
}
}
}
but the fact of the module spacewalk is run on Solaris.
bash-3.00# /opt/csw/bin/facter osfamily
Solaris
bash-3.00# /opt/csw/bin/puppet agent --test
Info: Retrieving plugin
Notice: /File[/var/opt/csw/puppet/lib/facter/spacewalk.rb]/ensure:
defined content as '{md5}9aea0fbd79bc329b3685b7cfd22a5809'
I have another custom fact that should only run on certain server but
it is installed on every server.
Can you please help me?
Are facts always installed on every server even if the module of the
fact in only installed on certain server?
Best regards,
Andreas
--
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/95b66593-0ff9-4ffe-b54c-963bb84f7010%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
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/52B1C08F.80800%40bericotechnologies.com.
For more options, visit https://groups.google.com/groups/opt_out.