Skip to content

Commit 637387e

Browse files
committed
fix(macros): use openvpn/macros.jinja
1 parent 2fff1ee commit 637387e

File tree

5 files changed

+16
-17
lines changed

5 files changed

+16
-17
lines changed

openvpn/config.sls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% from "openvpn/map.jinja" import map with context %}
2-
{% from "openvpn/map.jinja" import multipart_param with context %}
2+
{% from "openvpn/macros.jinja" import multipart_param with context %}
33
44
include:
55
- openvpn

openvpn/files/common_opts.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% from "openvpn/map.jinja" import multipart_param with context %}
1+
{% from "openvpn/macros.jinja" import multipart_param with context %}
22

33
{%- if config.daemon is defined and config.daemon == True %}
44
daemon

openvpn/macros.jinja

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{%- macro multipart_param(value, index=None) %}
2+
{%- if value is string %}
3+
{%- set value = value.split() %}
4+
{%- endif %}
5+
{%- if not index is none -%}
6+
{{ value[index] }}
7+
{%- else -%}
8+
{%- for item in value -%}
9+
{%- if not loop.first %} {% endif -%}
10+
{{ item }}
11+
{%- endfor %}
12+
{%- endif %}
13+
{%- endmacro -%}

openvpn/map.jinja

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,3 @@
2222
),
2323
base='openvpn')
2424
%}
25-
26-
{%- macro multipart_param(value, index=None) %}
27-
{%- if value is string %}
28-
{%- set value = value.split() %}
29-
{%- endif %}
30-
{%- if not index is none -%}
31-
{{ value[index] }}
32-
{%- else -%}
33-
{%- for item in value -%}
34-
{%- if not loop.first %} {% endif -%}
35-
{{ item }}
36-
{%- endfor %}
37-
{%- endif %}
38-
{%- endmacro -%}

openvpn/network_manager_networks/files/connection.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{%- from "openvpn/map.jinja" import multipart_param with context -%}
1+
{%- from "openvpn/macros.jinja" import multipart_param with context -%}
22
{%- set config = salt['pillar.get']('openvpn:network_manager:networks:'+network_name, {}) -%}
33
{%- macro pairs(data) -%}
44
{%- for key, value in data|dictsort -%}

0 commit comments

Comments
 (0)