FAQ
Hi guys,

I am trying to understand fact precedence and pluginsync.
Documentation says, by default, the weight of a fact is the number of
confines for that fact, so that more specific facts are evaluated first.

1. I made a module "core" which adds a facter "test" and has filename
test.rb. (in location modules/core/lib/facter/test/test.rb). Note that
facter is in "test" folder.
2. This above module "core" is included in all nodes.
3. Another module "newmod" also adds the facter "test" & has the
filename test.rb but this time, location is modules/core/lib/facter/test.rb.

In all the nodes, first "include core" comes and then "include newmod"
comes. When I see the facter value, the newmod's file is run. Why?

Pluginsync syncs both files and one exists in root of
"/var/lib/puppet/lib/facter" while the other exists in
"/var/lib/puppet/lib/facter/test" folder. Running strace reveals that
facter command opens both test.rbs but somehow selects the correct one.

The behaviour that's happening is expected but I am trying to understand
why is this happening. Please note that nowhere in the code of adding
facts, I am using has_weight.

--
Cheers,
Abhijeet R
http://blog.abhijeetr.com

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

  • Abhijeet R at Nov 6, 2012 at 9:23 am
    Sorry guys. Forgot about adding some info.

    The "test.rb" file (which got served by newmod module) in
    "/var/lib/puppet/lib/facter" is run and test.rb file in
    "/var/lib/puppet/lib/facter/test" is never run. Why?
    Also, I didn't understand the meaning of "number of confines for that
    fact". If I don't add any confine statements in ruby code, how is this
    confines thing calculated?

    On 11/06/2012 01:02 PM, Abhijeet R wrote:
    Hi guys,

    I am trying to understand fact precedence and pluginsync.
    Documentation says, by default, the weight of a fact is the number of
    confines for that fact, so that more specific facts are evaluated first.

    1. I made a module "core" which adds a facter "test" and has filename
    test.rb. (in location modules/core/lib/facter/test/test.rb). Note that
    facter is in "test" folder.
    2. This above module "core" is included in all nodes.
    3. Another module "newmod" also adds the facter "test" & has the
    filename test.rb but this time, location is
    modules/core/lib/facter/test.rb.

    In all the nodes, first "include core" comes and then "include newmod"
    comes. When I see the facter value, the newmod's file is run. Why?

    Pluginsync syncs both files and one exists in root of
    "/var/lib/puppet/lib/facter" while the other exists in
    "/var/lib/puppet/lib/facter/test" folder. Running strace reveals that
    facter command opens both test.rbs but somehow selects the correct one.

    The behaviour that's happening is expected but I am trying to
    understand why is this happening. Please note that nowhere in the
    code of adding facts, I am using has_weight.
    --
    Cheers,
    Abhijeet R
    http://blog.abhijeetr.com

    --
    You received this message because you are subscribed to the Google Groups "Puppet Users" group.
    To post to this group, send email to puppet-users@googlegroups.com.
    To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedNov 6, '12 at 7:31a
activeNov 6, '12 at 9:23a
posts2
users1
websitepuppetlabs.com

1 user in discussion

Abhijeet R: 2 posts

People

Translate

site design / logo © 2022 Grokbase