From d067176aabf316addb41e4f240a5c3df0509f474 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Wed, 4 Jan 2023 23:32:42 +0100 Subject: [PATCH] updated opendkim state --- states/opendkim/config.sls | 8 ++++---- states/opendkim/defaults.yaml | 3 +++ states/opendkim/init.sls | 1 - states/opendkim/install.sls | 4 +--- states/opendkim/{ => templates}/TrustedHosts.j2 | 2 +- states/opendkim/{ => templates}/key.j2 | 2 +- states/opendkim/{ => templates}/opendkim.conf.j2 | 2 +- states/opendkim/{ => templates}/service_defaults.j2 | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) rename states/opendkim/{ => templates}/TrustedHosts.j2 (95%) rename states/opendkim/{ => templates}/key.j2 (64%) rename states/opendkim/{ => templates}/opendkim.conf.j2 (93%) rename states/opendkim/{ => templates}/service_defaults.j2 (96%) diff --git a/states/opendkim/config.sls b/states/opendkim/config.sls index 0c05eae..8fad2ee 100644 --- a/states/opendkim/config.sls +++ b/states/opendkim/config.sls @@ -10,7 +10,7 @@ opendkim-config-dir: opendkim-configuration-key: file.managed: - name: {{ opendkim.config.dir }}/{{ opendkim.config.key.name }} - - source: salt://opendkim/key.j2 + - source: salt://opendkim/templates/key.j2 - user: {{ opendkim.config.user }} - group: {{ opendkim.config.group }} - mode: 600 @@ -21,7 +21,7 @@ opendkim-configuration-key: opendkim-trusted-hosts: file.managed: - name: {{ opendkim.config.dir }}/TrustedHosts - - source: salt://opendkim/TrustedHosts.j2 + - source: salt://opendkim/templates/TrustedHosts.j2 - user: {{ opendkim.config.user }} - group: {{ opendkim.config.group }} - mode: 644 @@ -32,7 +32,7 @@ opendkim-trusted-hosts: opendkim-service-defaults: file.managed: - name: {{ opendkim.config.default_file }} - - source: salt://opendkim/service_defaults.j2 + - source: salt://opendkim/templates/service_defaults.j2 - user: {{ opendkim.config.user }} - group: {{ opendkim.config.group }} - mode: 644 @@ -43,7 +43,7 @@ opendkim-service-defaults: opendkim-config-file: file.managed: - name: {{ opendkim.config.file }} - - source: salt://opendkim/opendkim.conf.j2 + - source: salt://opendkim/templates/opendkim.conf.j2 - user: {{ opendkim.config.user }} - group: {{ opendkim.config.group }} - mode: 644 diff --git a/states/opendkim/defaults.yaml b/states/opendkim/defaults.yaml index 2b321d6..ef143c5 100644 --- a/states/opendkim/defaults.yaml +++ b/states/opendkim/defaults.yaml @@ -1,6 +1,9 @@ --- opendkim: enabled: true + pkgs: + - opendkim + - opendkim-tools config: dir: '/etc/opendkim' file: '/etc/opendkim.conf' diff --git a/states/opendkim/init.sls b/states/opendkim/init.sls index 1d21dcb..383c46b 100644 --- a/states/opendkim/init.sls +++ b/states/opendkim/init.sls @@ -1,5 +1,4 @@ --- -{%- from "opendkim/map.jinja" import opendkim with context %} include: - .install - .config diff --git a/states/opendkim/install.sls b/states/opendkim/install.sls index d43338b..13afcaa 100644 --- a/states/opendkim/install.sls +++ b/states/opendkim/install.sls @@ -2,6 +2,4 @@ {%- from "opendkim/map.jinja" import opendkim with context %} opendkim-pkg: pkg.installed: - - pkgs: - - opendkim - - opendkim-tools + - pkgs: {{ opendkim.pkgs }} diff --git a/states/opendkim/TrustedHosts.j2 b/states/opendkim/templates/TrustedHosts.j2 similarity index 95% rename from states/opendkim/TrustedHosts.j2 rename to states/opendkim/templates/TrustedHosts.j2 index 3c2f449..17c0b6f 100644 --- a/states/opendkim/TrustedHosts.j2 +++ b/states/opendkim/templates/TrustedHosts.j2 @@ -6,4 +6,4 @@ {%- endfor %} {%- for hostname in salt['pillar.get']('mail:hostnames') %} {{ hostname }} -{%- endfor %} \ No newline at end of file +{%- endfor %} diff --git a/states/opendkim/key.j2 b/states/opendkim/templates/key.j2 similarity index 64% rename from states/opendkim/key.j2 rename to states/opendkim/templates/key.j2 index 4aabaa5..cba0c77 100644 --- a/states/opendkim/key.j2 +++ b/states/opendkim/templates/key.j2 @@ -1,2 +1,2 @@ {%- from "opendkim/map.jinja" import opendkim with context -%} -{{ opendkim.config.key.content }} \ No newline at end of file +{{ opendkim.config.key.content }} diff --git a/states/opendkim/opendkim.conf.j2 b/states/opendkim/templates/opendkim.conf.j2 similarity index 93% rename from states/opendkim/opendkim.conf.j2 rename to states/opendkim/templates/opendkim.conf.j2 index f713606..e0d0ff5 100644 --- a/states/opendkim/opendkim.conf.j2 +++ b/states/opendkim/templates/opendkim.conf.j2 @@ -20,4 +20,4 @@ PidFile {{ opendkim.config.pid_file }} Socket inet:{{ opendkim.config.port }}@{{ opendkim.config.host }} ReportAddress {{ opendkim.config.notify_addr }} -SendReports {{ opendkim.config.notify_report }} \ No newline at end of file +SendReports {{ opendkim.config.notify_report }} diff --git a/states/opendkim/service_defaults.j2 b/states/opendkim/templates/service_defaults.j2 similarity index 96% rename from states/opendkim/service_defaults.j2 rename to states/opendkim/templates/service_defaults.j2 index 3af85d3..a178151 100644 --- a/states/opendkim/service_defaults.j2 +++ b/states/opendkim/templates/service_defaults.j2 @@ -1,2 +1,2 @@ {%- from "opendkim/map.jinja" import opendkim with context %} -SOCKET="inet:{{ opendkim.config.port }}@{{ opendkim.config.host }}" \ No newline at end of file +SOCKET="inet:{{ opendkim.config.port }}@{{ opendkim.config.host }}"