Skip to content

Instantly share code, notes, and snippets.

Created August 4, 2016 10:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c952bcb47acbc99e585b8a4badbaaaa5 to your computer and use it in GitHub Desktop.
Save anonymous/c952bcb47acbc99e585b8a4badbaaaa5 to your computer and use it in GitHub Desktop.
module Environment
DC1_PROD = IPAddr.new('172.28.8.0/18')
DC1_NONPROD = IPAddr.new('172.28.64.0/20')
DC2_PROD = IPAddr.new('172.28.136.0/18')
DC2_NONPROD = IPAddr.new('172.28.192.0/20')
def self.get_dc(node_ipaddress)
case node_ip_address
when DC1_PROD, DC1_NONPROD then :DC1
when DC2_PROD, DC2_NONPROD then :DC2
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment