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..e2aad96 --- /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.in is defined and h.ip.out is defined -%} +{{ caller(h) }} +{%- endif %} +{%- endfor %} +{%- endmacro %} |