Fixes empty metal_query

Due to wrong quote used, json_query returned empty value, which
caused all metal host always recieve ansible_host (as default value)

Change-Id: Ib5d65166cb944ebd6214d891fe1b11a9f1e254f1
This commit is contained in:
Dmitriy Rabotjagov 2019-01-10 22:40:37 +02:00 committed by Jesse Pretorius (odyssey4me)
parent dcf448ec81
commit 09569c30f9

View File

@ -19,7 +19,7 @@
query: "{{ is_metal | ternary(metal_query, non_metal_query) }}" query: "{{ is_metal | ternary(metal_query, non_metal_query) }}"
non_metal_query: "container_networks.{{ network_address }}.address || ansible_host" non_metal_query: "container_networks.{{ network_address }}.address || ansible_host"
find_bridge: "container_networks.{{ network_address }}.bridge" find_bridge: "container_networks.{{ network_address }}.bridge"
metal_query: "'ansible_{{ hostvars[inventory_hostname] | json_query(find_bridge) | replace('-','_') }}'.ipv4.address || {{ non_metal_query }}" metal_query: "\"ansible_{{ hostvars[inventory_hostname] | json_query(find_bridge) | replace('-','_') }}\".ipv4.address || {{ non_metal_query }}"
tags: tags:
- common-address - common-address
- always - always