Created
December 1, 2017 17:02
-
-
Save jamesbeedy/b784bfd8779fca668b536332a10be5c1 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 python3 | |
import yaml | |
PRIVATE_IP = "100.100.100.100" | |
WEB_PORT = 9000 | |
API_PORT = 9001 | |
services = [{'service_name': "mytestservice", | |
'service_host': "0.0.0.0", | |
'service_port': 80, | |
'service_options': ["mode http", "acl api path_beg -i /api", "use_backend api if api"], | |
'servers': [["mytestservice", PRIVATE_IP, WEB_PORT, "option httpchk GET / HTTP/1.0"]], | |
'backends': {'backend_name': "api", | |
'servers': [["mytestservice-api", PRIVATE_IP, API_PORT, "option httpchk GET /api HTTP/1.0"]]}}] | |
print(yaml.dump(services)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment