search for: redhat_version_file

Displaying 1 result from an estimated 1 matches for "redhat_version_file".

2011 Aug 08
5
Run command based on OS version
...write a script that runs command based on version of Redhat OS. For example, if the RHEL version is 6.0, it will run command. I was able to write file read script in ruby that would read file and execute but it didn''t seem to work in puppet script. Has anyone done something like this? $redhat_version_file = "/etc/redhat-release" $redhat_version = "File.read($redhat_version_file)" if ($redhat_version =~ /6.0/) { command } or $redhat_version_file = "/etc/redhat-release" if ( File.open($redhat_version_file).read().include? "6.0") {command} -- You received thi...