summaryrefslogtreecommitdiff
path: root/roles/postfix/base/tasks/main.yml
blob: 8cb55fe011ffc65f57caa6b7ce018489473c8fee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
- name: install postfix package
  apt:
    name: postfix
    state: present

- name: basic postfix options
  vars:
    postfix_options:
      mydestination: "{{ postfix_base_mydestination | join(', ') }}"
      mynetworks: "{{ postfix_base_mynetworks | join(', ') }}"
      relayhost: "{{ postfix_base_relayhost }}"
      inet_interfaces: "{{ postfix_base_inet_interfaces | join(', ') }}"
      inet_protocols: "{{ postfix_base_inet_protocols | join(', ') }}"
  loop: "{{ postfix_options | dict2items }}"
  loop_control:
    label: "{{ item.key }} = {{ item.value }}"
  lineinfile:
    regexp: "^#?\\s*{{ item.key }}\\s*="
    line: "{{ item.key }} = {{ item.value }}"
    dest: /etc/postfix/main.cf
  notify: restart postfix