From 354f8a9b82bdc1dfb04b82549e164698a9bef4c0 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Fri, 10 Mar 2023 00:08:09 +0100 Subject: [PATCH] updated opendkim state --- states/opendkim/map.jinja | 11 +++++------ states/opendkim/templates/TrustedHosts.j2 | 12 ++++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/states/opendkim/map.jinja b/states/opendkim/map.jinja index 24009c3..830edd8 100644 --- a/states/opendkim/map.jinja +++ b/states/opendkim/map.jinja @@ -1,8 +1,7 @@ {%- import_yaml "opendkim/defaults.yaml" as defaults %} -{%- set opendkim = salt['pillar.get']( - 'opendkim', - default=defaults.opendkim, - merge=True - ) --%} \ No newline at end of file +{%- set opendkim = salt['pillar.get']('opendkim', default=defaults.opendkim, merge=True)-%} + +{%- set net = salt['pillar.get']('net', default=defaults, merge=True) -%} + +{%- set hostnames = salt['pillar.get']('mail:hostnames', default=defaults) -%} diff --git a/states/opendkim/templates/TrustedHosts.j2 b/states/opendkim/templates/TrustedHosts.j2 index 17c0b6f..8ca2ba7 100644 --- a/states/opendkim/templates/TrustedHosts.j2 +++ b/states/opendkim/templates/TrustedHosts.j2 @@ -1,9 +1,9 @@ -{%- for key, value in salt['pillar.get']('net:ipv4_networks').items() %} -{{ value.ip }}/{{ value.mask }} +{%- from "opendkim/map.jinja" import opendkim with context %} +{%- from "opendkim/map.jinja" import net with context %} +{%- from "opendkim/map.jinja" import hostnames with context %} +{%- for network in net.ip_networks %} +{{ network }} {%- endfor %} -{%- for key, value in salt['pillar.get']('net:ipv6_networks').items() %} -{{ value.ip }}/{{ value.mask }} -{%- endfor %} -{%- for hostname in salt['pillar.get']('mail:hostnames') %} +{%- for hostname in hostnames %} {{ hostname }} {%- endfor %}