External facts not working

58 views
Skip to first unread message

Predrag Stojanovic

unread,
Jul 11, 2017, 1:49:02 PM7/11/17
to sal-discuss

Hello Graham,


For the life of me, I cannot figure out why your external facts (suddenly) stopped working here.  External facts are suddenly missing from Facter runs.  I have Mac Facts 0.0.4 and Facter 2.4.6  When trying to force Facter to process the folder I get this:

:facts.d pstojanovic$ facter -p --external-dir=/usr/local/sal/facter/ --debug
Could not load Puppet: cannot load such file -- puppet
/usr/local/sal/facter/mac_admin_users.rb: line 3: syntax error near unexpected token `:mac_admin_users'
/usr/local/sal/facter/mac_admin_users.rb: line 3: `Facter.add(:mac_admin_users) do'
Fact file /usr/local/sal/facter/mac_admin_users.rb was parsed but returned an empty data set
/usr/local/sal/facter/mac_battery_charge_percent.rb: line 2: syntax error near unexpected token `:mac_battery_charge_percent'
/usr/local/sal/facter/mac_battery_charge_percent.rb: line 2: `Facter.add(:mac_battery_charge_percent) do'
Fact file /usr/local/sal/facter/mac_battery_charge_percent.rb was parsed but returned an empty data set
/usr/local/sal/facter/mac_battery_charging.rb: line 2: syntax error near unexpected token `:mac_battery_charging'
/usr/local/sal/facter/mac_battery_charging.rb: line 2: `Facter.add(:mac_battery_charging) do'
Fact file /usr/local/sal/facter/mac_battery_charging.rb was parsed but returned an empty data set
/usr/local/sal/facter/mac_battery_cycles.rb: line 2: syntax error near unexpected token `:mac_battery_cycles'
/usr/local/sal/facter/mac_battery_cycles.rb: line 2: `Facter.add(:mac_battery_cycles) do'
Fact file /usr/local/sal/facter/mac_battery_cycles.rb was parsed but returned an empty data set
/usr/local/sal/facter/mac_battery_health.rb: line 2: syntax error near unexpected token `:mac_battery_health'
/usr/local/sal/facter/mac_battery_health.rb: line 2: `Facter.add(:mac_battery_health) do'
Fact file /usr/local/sal/facter/mac_battery_health.rb was parsed but returned an empty data set
/usr/local/sal/facter/mac_current_user.rb: line 2: syntax error near unexpected token `:mac_current_user'
/usr/local/sal/facter/mac_current_user.rb: line 2: `Facter.add(:mac_current_user) do'
Fact file /usr/local/sal/facter/mac_current_user.rb was parsed but returned an empty data set
Fact file /usr/local/sal/facter/mac_encryption_enabled.rb was parsed but returned an empty data set
/usr/local/sal/facter/mac_flash_version.rb: line 2: syntax error near unexpected token `:mac_flash_version'
/usr/local/sal/facter/mac_flash_version.rb: line 2: `Facter.add(:mac_flash_version) do'
Fact file /usr/local/sal/facter/mac_flash_version.rb was parsed but returned an empty data set
/usr/local/sal/facter/mac_has_wireless.rb: line 3: syntax error near unexpected token `:mac_has_wireless'
/usr/local/sal/facter/mac_has_wireless.rb: line 3: `Facter.add(:mac_has_wireless) do'
Fact file /usr/local/sal/facter/mac_has_wireless.rb was parsed but returned an empty data set
/usr/local/sal/facter/mac_java_vendor.rb: line 2: syntax error near unexpected token `:mac_java_vendor'

Thanks in advance,
Predrag

Graham Gilbert

unread,
Jul 11, 2017, 2:05:19 PM7/11/17
to sal-d...@googlegroups.com
How did you install Facter?

Sent from my iPhone

From: sal-d...@googlegroups.com <sal-d...@googlegroups.com> on behalf of Predrag Stojanovic <pstoj...@vcu.edu>
Sent: Tuesday, July 11, 2017 6:49:02 PM
To: sal-discuss
Subject: [sal-discuss] External facts not working
 
--
You received this message because you are subscribed to the Google Groups "sal-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sal-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Predrag Stojanovic

unread,
Jul 11, 2017, 2:28:24 PM7/11/17
to sal-discuss
Standalone Facter package, using Munki and Autopkg

Since I noticed the problem, I also tried installing both Facter and Puppet from https://downloads.puppetlabs.com/mac/

Graham Gilbert

unread,
Jul 11, 2017, 3:11:42 PM7/11/17
to sal-d...@googlegroups.com
The standalone package is deprecated by puppet labs. Does this still happen with the latest all in one puppet agent package?

Sent from my iPhone

From: sal-d...@googlegroups.com <sal-d...@googlegroups.com> on behalf of Predrag Stojanovic <pstoj...@vcu.edu>
Sent: Tuesday, July 11, 2017 7:28:24 PM
To: sal-discuss
Subject: Re: [sal-discuss] External facts not working
 

Predrag Stojanovic

unread,
Jul 11, 2017, 3:28:30 PM7/11/17
to sal-discuss
I have puppet-agent 1.10.4 installed.  Have not tried puppet5

fwiw, when invoking facter, it seems to be running 2.4.6

facts.d pstojanovic$ which facter
/usr/bin/facter
facts.d pstojanovic$ facter -v
2.4.6

Graham Gilbert

unread,
Jul 11, 2017, 4:12:37 PM7/11/17
to sal-d...@googlegroups.com
I honestly haven’t run it in this manner for years. Does Facter work when supplying an external directory for your facts and running manually?

Sent from my iPhone

From: sal-d...@googlegroups.com <sal-d...@googlegroups.com> on behalf of Predrag Stojanovic <pstoj...@vcu.edu>
Sent: Tuesday, July 11, 2017 8:28:30 PM

Predrag Stojanovic

unread,
Jul 12, 2017, 8:18:53 AM7/12/17
to sal-discuss
facts in /etc/facter/facts.d/ only get processed  with --external-dir specified

they used to return data on every run, so this could be a bug (same behavior persists with puppet5)


Graham Gilbert

unread,
Jul 12, 2017, 8:21:12 AM7/12/17
to sal-d...@googlegroups.com
A big with Facter or Sal...?

Sent from my iPhone

From: sal-d...@googlegroups.com <sal-d...@googlegroups.com> on behalf of Predrag Stojanovic <pstoj...@vcu.edu>
Sent: Wednesday, July 12, 2017 1:18:53 PM

Graham Gilbert

unread,
Jul 12, 2017, 8:31:33 AM7/12/17
to sal-d...@googlegroups.com
Or bug even

Sent from my iPhone

From: Graham Gilbert <gra...@grahamgilbert.com>
Sent: Wednesday, July 12, 2017 1:21:07 PM
To: sal-d...@googlegroups.com; sal-discuss

Predrag Stojanovic

unread,
Jul 12, 2017, 10:33:35 AM7/12/17
to sal-discuss
bug with Facter -- testing on a clean OS install next

question - how does Facter know to process the /usr/local/sal/facter directory?

Graham Gilbert

unread,
Jul 12, 2017, 11:18:48 AM7/12/17
to sal-d...@googlegroups.com

To unsubscribe from this group and stop receiving emails from it, send an email to sal-discuss+unsubscribe@googlegroups.com.

Predrag Stojanovic

unread,
Jul 13, 2017, 10:44:41 AM7/13/17
to sal-discuss
All is well - turns out I had butchered the postflight, disabling the env variable.  Thanks for the learning opportunity!

Graham Gilbert

unread,
Jul 13, 2017, 11:05:34 AM7/13/17
to sal-d...@googlegroups.com
Excellent!

Sent from my iPhone

From: sal-d...@googlegroups.com <sal-d...@googlegroups.com> on behalf of Predrag Stojanovic <pstoj...@vcu.edu>
Sent: Thursday, July 13, 2017 3:44:41 PM
Reply all
Reply to author
Forward
0 new messages