Dear all,
I'm having this issue and running out of ideas. 
I have this two external facts (defined in 
/etc/facter/facts.d/extn_git_facts.txt):


root@p19-d-pmaster-001:~# facter|grep ks_git
ks_git_puppet-hiera => master                         
ks_git_puppet-master => develop

I want to use these two facts in a template. Here is my pseudo code:

<%-
    git_repos = ['puppet-hiera', 'puppet-master']
    git_repos.each do |g_repo|
        git_branch = "ks_git_#{g_repo}"
        git_br_name = Facter.value("ks_git_#{g_repo}")
-%>
GIT_BRANCH      :: <%= git_branch %>
GIT_BRANCH_NAME :: <%= git_br_name %>
<%-
    end
-%>

and I don't get anything returned by `git_br_name` at all. If I use the 
same code in irb console, it works just fine:

 irb(main):012:0> require 'facter'
 => true
 irb(main):013:0> git_repos = ['puppet-hiera', 'puppet-master']
 => ["puppet-hiera", "puppet-master"]
 irb(main):014:0> git_repos.each do |g_repo|
 irb(main):015:1* p Facter.value("ks_git_#{g_repo}")
 irb(main):016:1> end
 "master"
 "develop"
 => ["puppet-hiera", "puppet-master"]


What am I doing wrong in the template? if I use some other built-in facts 
instead, e.g. `Facter.value(:hostname)` - it works just okay. Does mean the 
external facts cannot be used in template? Thanks in advance.

Best,
Santanu

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/cba5d7f3-e9f8-4077-ae9f-b34ea5d0d41a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to