Puppet Function: simp_version
- Defined in:
- lib/puppet/parser/functions/simp_version.rb
- Function type:
- Ruby 3.x API
Overview
Return the version of SIMP that this server is running
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/puppet/parser/functions/simp_version.rb', line 2 newfunction(:simp_version, :type => :rvalue, :doc => <<-EOM) do |args| retval = "unknown\n" Return the version of SIMP that this server is running @return [String] EOM begin retval = File.read('/etc/simp/simp.version').gsub('simp-','') rescue tmpval = %x{PATH='/usr/local/bin:/usr/bin:/bin'; rpm -q --qf '%{VERSION}-%{RELEASE}\n' simp} $?.success? and retval = tmpval end retval end |