From 4d471f0b706733624a845143cafb6dd8add90eed Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Tue, 14 Nov 2023 14:19:55 +0100 Subject: wip --- 6/bgp.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to '6/bgp.py') 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)) -- cgit v1.2.3