Page MenuHomeDevCentral

exim.sls
No OneTemporary

exim.sls

# -------------------------------------------------------------
# Salt — Provision Docker engine
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2018-11-10
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
{% set has_selinux = salt['grains.get']('selinux:enabled', False) %}
{% for instance, container in pillar['docker_containers']['exim'].items() %}
# -------------------------------------------------------------
# Data directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
/srv/exim/{{ instance }}:
file.directory:
- user: 101
- group: 101
- makedirs: True
{% for subdir in ['spool', 'log'] %}
/srv/exim/{{ instance }}/{{ subdir }}:
file.directory:
- user: 101
- group: 101
{% endfor %}
{% if 'mailname' in container %}
/srv/exim/{{ instance }}/mailname:
file.managed:
- contents: {{ container['mailname'] }}
{% endif %}
{% if has_selinux %}
selinux_context_{{ instance }}_exim_data:
selinux.fcontext_policy_present:
- name: /srv/exim/{{ instance }}
- sel_type: container_file_t
selinux_context_{{ instance }}_exim_data_applied:
selinux.fcontext_policy_applied:
- name: /srv/exim/{{ instance }}
{% endif %}
# -------------------------------------------------------------
# Container
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{{ instance }}:
docker_container.running:
- detach: True
- interactive: True
- image: tianon/exim4
- binds:
{% if 'mailname' in container %}
- /srv/exim/{{ instance }}/mailname:/etc/mailname:ro
{% endif %}
- /srv/exim/{{ instance }}/spool:/var/spool/exim4
- /srv/exim/{{ instance }}/log:/var/log/exim4
{% if 'host' in container %}
- hostname: {{ container['mailname'] }}
{% endif %}
{% if 'network' in container %}
- networks:
- {{ container['network'] }}
{% endif %}
{% endfor %}

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 16:47 (22 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260590
Default Alt Text
exim.sls (1 KB)

Event Timeline