From 451980fdeaadbf17bee1b1f4d27c9b12ffb0b5b5 Mon Sep 17 00:00:00 2001 From: Markus Katharina Brechtel Date: Thu, 12 Oct 2017 18:55:45 +0000 Subject: [PATCH] host_vars template improvement --- templates/host_vars.yml.j2 | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/templates/host_vars.yml.j2 b/templates/host_vars.yml.j2 index 88e52a5..78bf958 100644 --- a/templates/host_vars.yml.j2 +++ b/templates/host_vars.yml.j2 @@ -1,5 +1 @@ -{% if ("host_vars/"+inventory_hostname+'/'+_host_vars_filename+'.yml') | is_file %} -{{ _host_vars_default | combine( lookup('file','host_vars/'+inventory_hostname+'/'+_host_vars_filename+'.yml') | from_yaml ) | combine( _host_vars ) | to_nice_yaml }} -{% else %} -{{ _host_vars_default | combine( _host_vars ) | to_nice_yaml }} -{% endif %} +{% if ("host_vars/"+inventory_hostname+'/'+_host_vars_filename+'.yml') | is_file %}{{ _host_vars_default | combine( lookup('file','host_vars/'+inventory_hostname+'/'+_host_vars_filename+'.yml') | from_yaml ) | combine( _host_vars | to_json | from_json ) | to_nice_yaml }}{% else %}{{ _host_vars_default | combine( _host_vars | to_json | from_json ) | to_nice_yaml }}{% endif %}