-
-
Save anonymous/794c5a997c0a89b138c6 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
DC2_CIDR='1.1.1.1.0/22' | |
ORD_CIDR='2.2.2.2/22' | |
EG_CIDR='3.3.3.3/20' | |
SLC_CIDR='4.4.4.4/22' | |
LAS_CIDR='5.5.5.5/22' | |
def datacenter(): | |
datacenter = {} | |
# Some code for logic that sets grains like | |
if __salt__['network.in_subnet'](DC2_CIDR): | |
return {'datacenter':'dc2'} | |
if __salt__['network.in_subnet'](ORD_CIDR): | |
return {'datacenter':'ord'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment