File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1
1
{%- set tplroot = tpldir.split(' /' )[0 ] %}
2
- {%- from tplroot ~ ' /map.jinja' import nginx with context % }
2
+ {%- from tplroot ~ ' /map.jinja' import nginx, pillar_namespace with context % }
3
3
4
4
include:
5
5
- {{ tplroot }}.service
@@ -14,7 +14,7 @@ prepare_certificates_path_dir:
14
14
create_nginx_dhparam_{{ dh_param }}_key:
15
15
file .managed:
16
16
- name: {{ nginx.certificates_path }}/ {{ dh_param }}
17
- - contents_pillar: nginx :dh_param:{{ dh_param }}
17
+ - contents_pillar: {{ pillar_namespace }} :dh_param:{{ dh_param }}
18
18
- makedirs: True
19
19
- require:
20
20
- file : prepare_certificates_path_dir
@@ -44,7 +44,7 @@ nginx_{{ domain }}_ssl_certificate:
44
44
{% if domain in nginx.certificates and ' public_cert_pillar' in nginx.certificates[domain] % }
45
45
- contents_pillar: {{ nginx.certificates[domain].public_cert_pillar }}
46
46
{% else % }
47
- - contents_pillar: nginx :certificates:{{ domain }}:public_cert
47
+ - contents_pillar: {{ pillar_namespace }} :certificates:{{ domain }}:public_cert
48
48
{% endif % }
49
49
- watch_in:
50
50
- service: nginx_service
@@ -58,7 +58,7 @@ nginx_{{ domain }}_ssl_key:
58
58
{% if ' private_key_pillar' in nginx.certificates[domain] % }
59
59
- contents_pillar: {{ nginx.certificates[domain].private_key_pillar }}
60
60
{% else % }
61
- - contents_pillar: nginx :certificates:{{ domain }}:private_key
61
+ - contents_pillar: {{ pillar_namespace }} :certificates:{{ domain }}:private_key
62
62
{% endif % }
63
63
- watch_in:
64
64
- service: nginx_service
Original file line number Diff line number Diff line change 4
4
{% endfor %}
5
5
{% endmacro %}
6
6
7
- {% set nginx = salt ['pillar.get' ]('nginx' , {
7
+ {% - set tplroot = tpldir .split ('/' )[0] %}
8
+ {% set pillar_namespace = salt ['pillar.get' ]('{}:pillar:namespace' .format (tplroot ), tplroot ) %}
9
+ {% set nginx = salt ['pillar.get' ](pillar_namespace , {
8
10
'lookup' : salt ['grains.filter_by' ]({
9
11
'Debian' : {
10
12
'package' : 'nginx' ,
Original file line number Diff line number Diff line change @@ -357,3 +357,7 @@ nginx:
357
357
- alt_nginx.service
358
358
nginx_snippet_file_managed :
359
359
- alt_server.conf
360
+
361
+ # Configure formula pillar namespace
362
+ pillar :
363
+ namespace : nginx
You can’t perform that action at this time.
0 commit comments