Created
March 25, 2015 00:49
-
-
Save AdamIsrael/7ead3157593f87b98de9 to your computer and use it in GitHub Desktop.
Generate yaml for haproxy charm
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 | |
import json | |
service = [ | |
{ | |
'service_name': 'demo', | |
'service_options': ['mode http', 'balance leastconn', 'option httpchk GET / HTTP/1.0'], | |
'server_options': ['maxconn 100'], | |
'servers': [ | |
[ | |
'demo-1', | |
'${host}', | |
'${port}', | |
'' | |
] | |
] | |
}, | |
] | |
services = json.dumps(foo) | |
services = services.replace('"', "'") | |
print "relation-set \"services=%s\"" % services |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment