summaryrefslogtreecommitdiff
path: root/roles/postfix/simple/tasks/main.yml
blob: 4309c3ac3206cb31b0ce54b2cf8e3cb42da1e974 (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_simple_mydestination | join(', ') }}"
      mynetworks: "{{ postfix_simple_mynetworks | join(', ') }}"
      relayhost: "{{ postfix_simple_relayhost }}"
      inet_interfaces: "{{ postfix_simple_inet_interfaces | join(', ') }}"
      inet_protocols: "{{ postfix_simple_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