summaryrefslogtreecommitdiff
path: root/6/bgp.py
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2023-11-14 14:19:55 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2023-11-14 14:19:55 +0100
commit4d471f0b706733624a845143cafb6dd8add90eed (patch)
tree417efc58964f8b43007dcbecf77e6b05a0bd6fa3 /6/bgp.py
parent6dca28918be80a3ef0c2959a99067337f59f5972 (diff)
downloadprolog-firewall-4d471f0b706733624a845143cafb6dd8add90eed.tar.gz
prolog-firewall-4d471f0b706733624a845143cafb6dd8add90eed.tar.bz2
prolog-firewall-4d471f0b706733624a845143cafb6dd8add90eed.tar.xz
prolog-firewall-4d471f0b706733624a845143cafb6dd8add90eed.zip
wip
Diffstat (limited to '6/bgp.py')
-rwxr-xr-x6/bgp.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/6/bgp.py b/6/bgp.py
index 5096b67..995a0c8 100755
--- a/6/bgp.py
+++ b/6/bgp.py
@@ -4,10 +4,9 @@ from swiplserver import PrologMQI, PrologThread
import yaml
import os
-def to_ansible(kind, objs):
- for o in objs:
- host = o['host']
- print(f"k={host}")
+def to_ansible(kind, hosts):
+ for host, o in hosts.items():
+ print(f"host={host}")
os.makedirs(f"group_vars/{host}", exist_ok=True)
with open(f"group_vars/{host}/{kind}.yaml", "w") as f:
f.write(yaml.dump(o))