Quantcast
Channel: Ask Puppet: Puppet DevOps Q&A Community - RSS feed
Viewing all articles
Browse latest Browse all 6104

Creating custom facts: how to access the 'trusted' hash?

$
0
0
I'm setting up some custom facts in the modules/facts/lib/facter directory and I want to access the 'trusted' hash that contains the trusted/verified node data. However I can't seem to find a way to access that variable..is it available in that scope? Here's what I'm trying to do: Facter.add("mpenvironment2") do setcode do mpenv = trusted['certname'].split("-").last case mpenv when /qa/ "qa" when "prod" "prod" when "dev" "dev" when "stg" "stg" else mpenv end end end but I get this error: Error: Facter: error while resolving custom fact "mpenvironment2": undefined local variable or method `trusted' for # I'm using puppet-agent-1.2.5 and puppetserver-2.1.1

Viewing all articles
Browse latest Browse all 6104

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>