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

Is it appropriate to have commands in your params.pp class

$
0
0
Hello, I have a puppet module that ensures that an rpm is installed. If it is not installed it will install it in a default location (prefix). If it is installed it will make sure that the rpm is installed correctly with all correct files in either the default directory or the directory that was specified with the relocate option when the rpm was installed. I need to be able to check where the rpm was installed in my module. In my params.pp class I am running a command to identify the location of the install $cmd1 = "rpm -qa --queryformat '%{FILENAMES}' anf_jvmtop" $specified_install_path = inline_template("<%= %x{$cmd1} %>") if $specified_install_path == '' { $base = "/path" } else { $base = $specified_install_path } This basically returns the $base which is the prefix of the install like 'usr/bin' or wherever the user installed it. Is this an appropriate usage of params.pp? I am rather new to puppet and every params.pp class I see has simple facts displayed. I thought about using an external fact but I don't want to have to put those on the puppet master and I think there is a simpler solution. thanks,

Viewing all articles
Browse latest Browse all 6104

Trending Articles



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