Last active
February 17, 2018 07:54
-
-
Save gmillerd/681e44e5d7f5c0e7c37d7ece6d0b54f8 to your computer and use it in GitHub Desktop.
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
| # misc variables used in clustering node names | |
| # ip address as a long | |
| default['iplong'] = "#{node['ipaddress'].split('.').inject(0) {|t,v| (t << 8 ) + v.to_i} }" | |
| # 255.255.255.255 - ipaddr as long | |
| default['255min'] = "#{4294967295 - (node['ipaddress'].split('.').inject(0) {|t,v| (t << 8 ) + v.to_i}) }" | |
| # ip last octet | |
| default['oct4'] = "#{node['ipaddress'].split('.')[-1] }" | |
| # 255 - ip last octet | |
| default['255oct4'] = "#{255 - (node['ipaddress'].split('.')[-1].to_i) }" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment