Last active
August 29, 2015 14:02
-
-
Save trilitheus/900c7f4b933500ded24d to your computer and use it in GitHub Desktop.
platform case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| case node['platform'] | |
| when 'oracle' | |
| case node['platform_version'].to_i | |
| when '5' | |
| pkg_src = 'http://myrepo/mypkg.OEL5.x86_64.rpm' | |
| when '6' | |
| pkg_src = 'http://myrepo/mypkg.OEL6.x86_64.rpm' | |
| end | |
| when 'redhat', 'centos' | |
| case node['platform_version'].to_i | |
| when '5' | |
| pkg_src = 'http://myrepo/mypkg.RHEL5.x86_64.rpm' | |
| when '6' | |
| pkg_src = 'http://myrepo/mypkg.RHEL6.x86_64.rpm' | |
| end | |
| end | |
| package 'mypkg' do | |
| source pkg_src | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This fails as converting node['platform_version'] to an integer but then the case statement test against a string. Remove the single quotes around 5 and 6 for this to work.