This script generates the HCL files containing vCloud Director Provider configuration files. It comprises DNAT, SNAT and Firewall section. For proper work, script needs a valid CSV files with rules should be created. It can be useful during the Edge migration or deployment with the big amount of rules.
chmod +x hcl_edge_gen.py
python hcl_edge_gen.py -d dnatfile.csv --snat=snatfile.csv
Script needs at least Python 2.7. It was not tested with the earlier version. You can check Travis CI output for more information about tested environments.
There are three different CSV files needed by the script:
- datadnat.csv with DNAT rules
- datasnat.csv with SNAT rules
- datafw.csv with Firewall rules
Files can have another names (you can specify them with the script arguments), but must have the following fieldnames and order:
DNAT CSV Edge_Name, External_IP, Port, Internal_IP, Translated Port
SNAT CSV Edge_Name, External_IP, Internal_IP
Firewall CSV Edge_Name, Description, Policy, Protocol, Destination_port, destination_IP, Source_port, Source_ip
You can find more information in this post.