MEschenbacher's Wireguard Saltstack Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
461B

  1. {%- macro output(key, value) -%}
  2. {%- if value is string -%}
  3. {{key}} = {{value}}
  4. {%- elif value is iterable -%}
  5. {%- for item in value %}
  6. {{key}} = {{item}}
  7. {%- endfor -%}
  8. {%- else -%}
  9. {{key}} = {{value}}
  10. {%- endif -%}
  11. {%- endmacro -%}
  12. [Interface]
  13. {% for key, value in interface.items() -%}
  14. {{ output(key, value) }}
  15. {% endfor -%}
  16. {%- for peer in peers -%}
  17. [Peer]
  18. {% for key, value in peer.items() -%}
  19. {{ output(key, value) }}
  20. {% endfor -%}
  21. {%- endfor -%}