|
1 | | -# This is the main state file for configuring exim, |
2 | | - |
3 | | -{% from "exim/map.jinja" import map with context %} |
4 | | -
|
5 | | -exim_install_packages: |
6 | | - pkg.installed: |
7 | | - - pkgs: |
8 | | - {% for pkg in map.pkgs %} |
9 | | - - {{ pkg }} |
10 | | - {% endfor %} |
11 | | -
|
12 | | -{% set use_split_config = salt['pillar.get']('exim:config:use_split_config', 'true') %} |
13 | | -{% set configtype = salt['pillar.get']('exim:config:configtype', 'satellite') %} |
14 | | -{% set hide_mailname = salt['pillar.get']('exim:config:hide_mailname', 'true') %} |
15 | | -{% set ue4c_keepcomments = salt['pillar.get']('exim:config:ue4c_keepcomments', 'true') %} |
16 | | -{% set localdelivery = salt['pillar.get']('exim:config:localdelivery', 'mail_spool') %} |
17 | | -{% set local_interfaces = salt['pillar.get']('exim:config:local_interfaces', '') %} |
18 | | -{% set minimaldns = salt['pillar.get']('exim:config:minimaldns', 'false') %} |
19 | | -{% set other_hostnames = salt['pillar.get']('exim:config:other_hostnames', '') %} |
20 | | -{% set readhost = salt['pillar.get']('exim:config:readhost', '') %} |
21 | | -{% set relay_domains = salt['pillar.get']('exim:config:relay_domains', '') %} |
22 | | -{% set relay_nets = salt['pillar.get']('exim:config:relay_nets', '') %} |
23 | | -{% set smarthost = salt['pillar.get']('exim:config:smarthost', '') %} |
24 | | -{% set cfilemode = salt['pillar.get']('exim:config:cfilemode', '644') %} |
25 | | -
|
26 | | -{{ map.config_dir }}/{{ map.config_file }}: |
27 | | - file.managed: |
28 | | - - contents: | |
29 | | - dc_eximconfig_configtype='{{ configtype }}' |
30 | | - dc_other_hostnames='{{ other_hostnames }}' |
31 | | - dc_local_interfaces='{{ local_interfaces }}' |
32 | | - dc_relay_domains='{{ relay_domains }}' |
33 | | - dc_relay_nets='{{ relay_nets }}' |
34 | | - dc_use_split_config='{{ use_split_config }}' |
35 | | - dc_hide_mailname='{{ hide_mailname }}' |
36 | | - ue4c_keepcomments='{{ ue4c_keepcomments }}' |
37 | | - dc_localdelivery='{{ localdelivery }}' |
38 | | - dc_minimaldns='{{ minimaldns }}' |
39 | | - dc_readhost='{{ readhost }}' |
40 | | - dc_smarthost='{{ smarthost }}' |
41 | | - CFILEMODE='{{ cfilemode }}' |
42 | | - - watch_in: |
43 | | - - service: {{ map.service }} |
44 | | -
|
45 | | -{% if salt['pillar.get']('exim:files') %} |
46 | | -{% for dir in map.sub_dirs %} |
47 | | - {% for file in salt['pillar.get']('exim:files:' + dir, {}) %} |
48 | | -{{ map.config_dir }}/conf.d/{{ dir }}/{{ file }}: |
49 | | - file.managed: |
50 | | - - contents_pillar: exim:files:{{ dir }}:{{ file }} |
51 | | - - watch_in: |
52 | | - - service: {{ map.service }} |
53 | | - {% endfor %} |
54 | | -{% endfor %} |
55 | | -{% endif %} |
56 | | -
|
57 | | -
|
58 | | -exim_service: |
59 | | - service.running: |
60 | | - - name: {{ map.service }} |
61 | | -
|
| 1 | +# -*- coding: utf-8 -*- |
| 2 | +# vim: ft=sls |
62 | 3 |
|
| 4 | +include: |
| 5 | + - .package |
| 6 | + - .config |
| 7 | + - .service |
0 commit comments