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

Confine fact to specific command existance

$
0
0
Is it possible to confine a custom fact to the existence of a specific command? Please consider the question as it is laid down and ignore the fact that I used bash in the example. Facter.add("bash_version") do # fact only runs if command (bash in this case) 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>