Skip to content

Commit

Permalink
🐛 Fix failing to render template config when empty param
Browse files Browse the repository at this point in the history
  • Loading branch information
fairglen committed Oct 31, 2023
1 parent ca2af19 commit 5129709
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ nomad_meta: {}
nomad_bootstrap_expect: "{{ nomad_servers | count or 3 }}"
nomad_chroot_env: false
nomad_plugins: {}
nomad_template_config: {}

### Addresses
nomad_bind_address: "{{ hostvars[inventory_hostname]['ansible_'+ nomad_iface ]['ipv4']['address'] }}"
Expand Down
4 changes: 2 additions & 2 deletions templates/client.hcl.j2
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ client {
{% endfor %}
{% endmacro %}

{% if nomad_template_config is defined %}
{% if nomad_template_config|length >0 %}
template {
{{ template_config(nomad_template_config) | replace('\'', '\"') -}}
{{ template_config(nomad_template_config) | replace('\'', '\"') }}
}
{% endif %}
}
Expand Down

0 comments on commit 5129709

Please sign in to comment.