Postfix Ansible Role

ansible-postfix · email, automation, smtp-server, tls-config, sasl-auth

Complete Ansible role for configuring a full-featured Postfix SMTP server with TLS, SASL authentication, aliases, virtual aliases, transport maps, canonical rewrites, and relay host support. Can be used directly via Ansible Galaxy.

# tasks file
---
- name: facts | set
  tags:
    - configuration
    - postfix
    - postfix-facts
  block:
    - name: facts | set | is_docker_guest
      ansible.builtin.set_fact:
        is_docker_guest: "{{ ansible_facts['virtualization_role'] | default('host') == 'guest' and ansible_facts['virtualization_type'] | default('none') == 'docker' }}"

    - name: facts | set | postfix_relayhosts
      ansible.builtin.set_fact:
        postfix_relayhosts: ["{{ postfix_relayhost }}"]
      when:
        - postfix_relayhosts | length == 0
        - postfix_relayhost is defined

- name: configure debconf
  ansible.builtin.debconf:
    name: "{{ item.name }}"
    question: "{{ item.question }}"
    value: "{{ item.value }}"
    vtype: "{{ item.vtype }}"
  with_items: "{{ postfix_debconf_selectio

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key