From f6a2a910ff267e186fc94637ea68cd5ad7e41845 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Sun, 18 Feb 2024 15:24:30 -0500 Subject: [PATCH] Fixing hetzner consul ips. --- ansible/roles/consul/tasks/get_consul_manager_ip.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ansible/roles/consul/tasks/get_consul_manager_ip.py b/ansible/roles/consul/tasks/get_consul_manager_ip.py index 16e8f183a..e98eb6b3f 100755 --- a/ansible/roles/consul/tasks/get_consul_manager_ip.py +++ b/ansible/roles/consul/tasks/get_consul_manager_ip.py @@ -6,7 +6,7 @@ import subprocess import digitalocean -def get_host_ips_from_group(group_name, inventory_base_path='/srv/newsblur/ansible/inventories/'): +def get_host_ips_from_group(group_name): """ Fetches IP addresses of hosts from a specified group using ansible-inventory command across combined inventory. @@ -14,7 +14,7 @@ def get_host_ips_from_group(group_name, inventory_base_path='/srv/newsblur/ansib :param inventory_base_path: Base path to the inventory directories. Defaults to the path in ansible.cfg. :return: A list of IP addresses belonging to the specified group. """ - cmd = ['ansible-inventory', '--list'] + cmd = ['ansible-inventory', '-i', '/srv/newsblur/ansible/inventories/hetzner.ini', '-i', '/srv/newsblur/ansible/inventories/hetzner.yml', '--list'] try: # Execute the ansible-inventory command