Skip to content

Commit

Permalink
Merge pull request #7 from McPcholkin/master
Browse files Browse the repository at this point in the history
No more configs in states
  • Loading branch information
noelmcloughlin authored Sep 18, 2019
2 parents a728f0e + 1f73ebd commit 3d883c4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 13 deletions.
19 changes: 13 additions & 6 deletions exim/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,42 @@ exim_install_packages:
{% set relay_domains = salt['pillar.get']('exim:config:relay_domains', '') %}
{% set relay_nets = salt['pillar.get']('exim:config:relay_nets', '') %}
{% set smarthost = salt['pillar.get']('exim:config:smarthost', '') %}
{% set cfilemode = salt['pillar.get']('exim:config:cfilemode', '644') %}
{{ map.config_dir }}/{{ map.config_file }}:
file.managed:
- contents: |
dc_use_split_config='{{ use_split_config }}'
dc_eximconfig_configtype='{{ configtype }}'
dc_other_hostnames='{{ other_hostnames }}'
dc_local_interfaces='{{ local_interfaces }}'
dc_relay_domains='{{ relay_domains }}'
dc_relay_nets='{{ relay_nets }}'
dc_use_split_config='{{ use_split_config }}'
dc_hide_mailname='{{ hide_mailname }}'
ue4c_keepcomments='{{ ue4c_keepcomments }}'
dc_localdelivery='{{ localdelivery }}'
dc_local_interfaces='{{ local_interfaces }}'
dc_minimaldns='{{ minimaldns }}'
dc_other_hostnames='{{ other_hostnames }}'
dc_readhost='{{ readhost }}'
dc_relay_domains='{{ relay_domains }}'
dc_relay_nets='{{ relay_nets }}'
dc_smarthost='{{ smarthost }}'
CFILEMODE='{{ cfilemode }}'
- watch_in:
- service: {{ map.service }}
{% if salt['pillar.get']('exim:files') %}
{% for dir in map.sub_dirs %}
{% for file in salt['pillar.get']('exim:files:' + dir, {}) %}
{{ map.config_dir }}/conf.d/{{ dir }}/{{ file }}:
file.managed:
- source: salt://exim/{{ file }}
- contents_pillar: exim:files:{{ dir }}:{{ file }}
- watch_in:
- service: {{ map.service }}
{% endfor %}
{% endfor %}
{% endif %}
exim_service:
service.running:
- name: {{ map.service }}
27 changes: 20 additions & 7 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,30 @@ exim:
relay_nets: ''
smarthost: ''
files:
# Name all files which should be put under the corresponding
# split config directory
# Source files must be placed in an exim directory under file_roots
# e.g. /srv/salt/files/exim/
main:
- file1
- file 2
'01_exim4-config_listmacrosdefs': |
exim_path = /usr/sbin/exim4
# Macro defining the main configuration directory.
# We do not use absolute paths.
.ifndef CONFDIR
CONFDIR = /etc/exim4
.endif

'90_exim4-config_log_selector': |
# uncomment this for debugging
# MAIN_LOG_SELECTOR == MAIN_LOG_SELECTOR +all -subject -arguments

.ifdef MAIN_LOG_SELECTOR
log_selector = MAIN_LOG_SELECTOR
.endif

acl:
'00_exim4-config_header': |
begin acl
router:
transport:
retry:
- file3
'file3': |
# some more config
rewrite:
auth:

0 comments on commit 3d883c4

Please sign in to comment.