saltstack/salt-cloud — pull request #451 by boltronics (2013-03-18 09:02:19+00:00)
Title: Openstack ignore configured cidr for private addresses

My company has an internal OpenStack install for development purposes and what not. Each instance we launch with salt-cloud has two IP addresses - one on our main internal network accessible by employees (where our salt master currently is located) which uses a floating IP address range, and the other is a flat network IP which is not visible to the salt master.

Unfortunately salt-cloud usually tries to execute the bootstrap script by connecting on the wrong IP, and there appears to be no way to prevent this... until now. The pull request here allows something like OPENSTACK.ignore_cidr: 192.168.40.0/24 to be set so we can now have our backend flat network ignored and the correct IP is always chosen.

As simple as it is, probably the Salt devs could do a nicer job of this code than I, so please do clean it up if/where appropriate. I'm not a huge fan of bringing in another Python dependency (python-netaddr), but I'm not sure if there's a better way. Thanks!!