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

Confine fact to command existance

$
0
0
How do I make sure the fact only runs in case a specific command exists? Please consider the questions as it is laid down and ignore the fact I used bash in the example. Facter.add("bash_ver") do # only run fact if command exists confine :true.which("bash") setcode do %x{bash --version | grep -E 'bash.*version' | cut -d ' ' -f 4 | cut -d '-' -f 1}.chomp end end

Viewing all articles
Browse latest Browse all 6104

Trending Articles



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