Jira (FACT-2665) Investigate external fact execution

12 views
Skip to first unread message

Bogdan Irimie (Jira)

unread,
Jun 17, 2020, 3:21:02 AM6/17/20
to puppe...@googlegroups.com
Bogdan Irimie created an issue
 
Facter / Task FACT-2665
Investigate external fact execution
Issue Type: Task Task
Assignee: Unassigned
Created: 2020/06/17 12:20 AM
Priority: Normal Normal
Reporter: Bogdan Irimie
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Bogdan Irimie (Jira)

unread,
Jun 17, 2020, 3:21:03 AM6/17/20
to puppe...@googlegroups.com
Bogdan Irimie assigned an issue to Bogdan Irimie
Change By: Bogdan Irimie
Assignee: Bogdan Irimie

Bogdan Irimie (Jira)

unread,
Jun 17, 2020, 3:22:03 AM6/17/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Investigate when external facts are resolved in Facter 2, 3 and 4.

Bogdan Irimie (Jira)

unread,
Jun 17, 2020, 3:25:02 AM6/17/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Investigate when external facts are resolved in Facter 2, 3 and 4.


 
External fact example from [~josh]

External fact directory:
{code}
/opt/puppetlabs/facter/facts.d/slow.rb
{code}

External fact code:
{code}
#!/opt/puppetlabs/puppet/bin/ruby
$stderr.puts "SLOW FACT"
sleep 5
puts "slow=true"
{code}
 

Bogdan Irimie (Jira)

unread,
Jun 17, 2020, 3:29:03 AM6/17/20
to puppe...@googlegroups.com
Bogdan Irimie commented on Task FACT-2665
 
Re: Investigate external fact execution

On Facter 2

facter -v
2.5.7

 

  • List all facts
    • loads external facts (including the slow fact)

facter --external-dir /opt/puppetlabs/facter/facts.d
SLOW FACT
...
slow => true
...

 

On Facter 3

 

 

On Facter 4

 

Bogdan Irimie (Jira)

unread,
Jun 17, 2020, 4:01:03 AM6/17/20
to puppe...@googlegroups.com

If we use the Ruby API:

Facter.to_hash and Facter.value('fact_name'), both load external facts on all versions of Facter (2, 3, 4)

Bogdan Irimie (Jira)

unread,
Jun 17, 2020, 9:09:03 AM6/17/20
to puppe...@googlegroups.com
Bogdan Irimie updated an issue
Change By: Bogdan Irimie
Sprint: ghost - 2020-06-17 , ghost - 2020-06-18
Reply all
Reply to author
Forward
0 new messages