add optional context variable "colon" to mapping.j2 for aliases file
This commit is contained in:
parent
099d84ab73
commit
d51f60647a
@ -1,3 +0,0 @@
|
||||
# Managed by config management
|
||||
# See man 5 aliases for format
|
||||
{{pillar['postfix']['aliases']['content']}}
|
@ -1,11 +1,14 @@
|
||||
# Managed by config management
|
||||
|
||||
{%- if colon is not defined %}
|
||||
{%- set colon = False %}
|
||||
{%- endif %}
|
||||
{%- macro format_value(key, value) %}
|
||||
{#- Some settings, like virtual_alias_maps can take multiple values. Handle this case. -#}
|
||||
{%- if value is iterable and value is not string -%}
|
||||
{{ key }} {{ value|join(", ") }}
|
||||
{{ key }}{% if colon %}:{% endif %} {{ value|join(", ") }}
|
||||
{%- else -%}
|
||||
{{ key }} {{ value }}
|
||||
{{ key }}{% if colon %}:{% endif %} {{ value }}
|
||||
{%- endif -%}
|
||||
{%- endmacro %}
|
||||
|
||||
|
@ -31,11 +31,14 @@ postfix:
|
||||
postfix_alias_database:
|
||||
file.managed:
|
||||
- name: {{ file_path }}
|
||||
- source: salt://postfix/aliases
|
||||
- source: salt://postfix/files/mapping.j2
|
||||
- user: root
|
||||
- group: {{ postfix.root_grp }}
|
||||
- mode: 644
|
||||
- template: jinja
|
||||
- context:
|
||||
data: {{ salt['pillar.get']('postfix:aliases:present') }}
|
||||
colon: True
|
||||
- require:
|
||||
- pkg: postfix
|
||||
{%- if need_newaliases %}
|
||||
|
Loading…
Reference in New Issue
Block a user