Created
May 8, 2015 18:29
-
-
Save morgajel/a88ff6c08559e4dcc4c5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
[global] | |
blah blah blah | |
more stuff | |
[serverA] | |
host = 192.168.2.59 | |
port = 1433 | |
dump file = /tmp/freetds.log | |
[serverB] | |
host = 192.168.2.33 | |
port = 1599 | |
dump file = /tmp/freetds.log | |
[serverSee] | |
host = 192.168.6.99 | |
port = 20019 | |
dump file = /tmp/freetds.log |
presuming my host_vars hostfile has the following datastructures:
freetds:
servers:
- {name: serverA, host: 192.168.2.59, port: 1433}
- {name: serverB, host: 192.168.2.33, port: 1599}
could I do something like:
{% for server in freetds.servers %}
[{{server.name}}]
host = {{server.host}}
port = {{server.port}}
dump file = /tmp/freetds.log
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd like to put the hostname, ip and port in the vault and generate this file from a jinja template. I suspect a list and loop are required, but I don't know the best way to store the variables to do that.