fuel-plugin-calico/deployment_scripts/get_controller_ip.py

16 lines
299 B
Python
Executable File

#!/usr/bin/env python
import yaml
with open("/etc/compute.yaml", "r") as f:
config = yaml.safe_load(f)
for node in config["nodes"]:
if node["role"] == "primary-controller":
controller_ip = node["internal_address"]
break
else:
controller_ip = None
print controller_ip