MEschenbacher's Wireguard Saltstack Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

22 rindas
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 -%}