diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/macros.j2 | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/templates/macros.j2 b/templates/macros.j2 new file mode 100644 index 0000000..d3f755a --- /dev/null +++ b/templates/macros.j2 @@ -0,0 +1,15 @@ +{% macro loop_hosts(group) -%} +{% for h in groups[group] -%} +{% set h = dict(hostvars[h]) %} +{{ caller(h) }} +{%- endfor %} +{%- endmacro %} + +{% macro loop_valid_hosts(group) -%} +{% for h in groups[group] -%} +{% set h = dict(hostvars[h]) %} +{% if h.__ip.external is defined and h.__ip.internal is defined -%} +{{ caller(h) }} +{%- endif %} +{%- endfor %} +{%- endmacro %} |