facter: unordered hashes lead to changes

71 views
Skip to first unread message

Guy Matz

unread,
Apr 7, 2015, 1:56:49 PM4/7/15
to puppet...@googlegroups.com
Hi!  I'm seeing the following at the end of my puppet run:

Notice: /Stage[main]/Mcollective::Server::Config::Factsource::Yaml/File[/etc/mcollective/facts.yaml]/content: 
--- /etc/mcollective/facts.yaml 2015-04-07 15:51:25.243758139 +0000
+++ /tmp/puppet-file20150407-6557-wl0qx7-0      2015-04-07 17:51:34.770285890 +0000
@@ -57,15 +57,15 @@
   operatingsystem: CentOS
   operatingsystemmajrelease: "6"
   operatingsystemrelease: "6.6"
-  os: familyRedHatreleasemajor6full6.6minor6nameCentOS
+  os: familyRedHatnameCentOSreleasefull6.6major6minor6
   osfamily: RedHat
-  partitions: sda1uuidced0932e-4636-4d8f-9c63-ea32b0dccf89size1024000filesystemext4mount/bootsda2size66082816filesystemLVM2_member
+  partitions: sda1mount/bootuuidced0932e-4636-4d8f-9c63-ea32b0dccf89size1024000filesystemext4sda2size66082816filesystemLVM2_member

os, partitions and a few others change each run . . .  checking a single fact shows that facter is returning an unordered has which changes on each invocation:
$ facter os
{"name"=>"CentOS", "family"=>"RedHat", "release"=>{"full"=>"6.6", "minor"=>"6", "major"=>"6"}}
$ facter os
{"family"=>"RedHat", "name"=>"CentOS", "release"=>{"full"=>"6.6", "major"=>"6", "minor"=>"6"}}

I don't remember this ever happening before . . .  what's up with that!?  Anyone know, off the top of their head, what might be causing this?

Thanks!
Guy

Christopher Wood

unread,
Apr 7, 2015, 2:08:37 PM4/7/15
to puppet...@googlegroups.com
Sounds like this is set to true (over here I set it to false everywhere to take advantage of the non-string facts):

https://docs.puppetlabs.com/references/latest/configuration.html#stringifyfacts
> --
> 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 [1]puppet-users...@googlegroups.com.
> To view this discussion on the web visit
> [2]https://groups.google.com/d/msgid/puppet-users/CABnTgtXOGN4tM-DNYoVK5zSwGWBgZFLC48Y%3Dw6HjA2KViKm49A%40mail.gmail.com.
> For more options, visit [3]https://groups.google.com/d/optout.
>
> References
>
> Visible links
> 1. mailto:puppet-users...@googlegroups.com
> 2. https://groups.google.com/d/msgid/puppet-users/CABnTgtXOGN4tM-DNYoVK5zSwGWBgZFLC48Y%3Dw6HjA2KViKm49A%40mail.gmail.com?utm_medium=email&utm_source=footer
> 3. https://groups.google.com/d/optout

Guy Matz

unread,
Apr 7, 2015, 3:53:38 PM4/7/15
to puppet...@googlegroups.com
Ahhh!!   The version of facter on my new servers is 2.4 . .   old servers have 1.7 . . .    anyone know how to get facter 2.x to stringify facts?  I've tried adding 'stringify_facts = true' to my puppet.conf, but that did not change behaviour . . .

To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/20150407180816.GA9555%40iniquitous.heresiarch.ca.
For more options, visit https://groups.google.com/d/optout.

jcbollinger

unread,
Apr 8, 2015, 8:57:24 AM4/8/15
to puppet...@googlegroups.com


On Tuesday, April 7, 2015 at 2:53:38 PM UTC-5, Guy Matz wrote:
Ahhh!!   The version of facter on my new servers is 2.4 . .   old servers have 1.7 . . .    anyone know how to get facter 2.x to stringify facts?  I've tried adding 'stringify_facts = true' to my puppet.conf, but that did not change behaviour . .


You have misunderstood.  The stringify_facts parameter (of Puppet) defaults to true, so if you were not configuring it explicitly then it was already true.  Christopher was suggesting that you set it to false.  This is an eminently reasonable thing to do even if you were not otherwise having any trouble, because this configuration parameter will be removed in Puppet 4 (the new behavior being to never stringify facts).


John

Guy Matz

unread,
Apr 8, 2015, 11:15:04 AM4/8/15
to puppet...@googlegroups.com
I *did* misunderstand!  Thanks for pointing that out!  Much better now!

--
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 puppet-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages