1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/postfix/tasks/main.yml
Evangelos Foutras 578b781966
Capitalize the handler name in handler invocations
Fixes: 26f289b72bfb ("Capitalize the first letter of all task names")
2022-08-29 21:46:39 +03:00

77 lines
2.1 KiB
YAML

- name: Install postfix
pacman: name=postfix,postfix-pcre state=present
- name: Install template configs
template: src={{ item }}.j2 dest=/etc/postfix/{{ item }} owner=root group=root mode=0644
with_items:
- main.cf
- master.cf
- transport
- transport.pcre
- aliases
- users.pcre
notify:
- Restart postfix
- Postmap additional files
- Update aliases db
- name: Install additional files
copy: src={{ item }} dest=/etc/postfix/{{ item }} owner=root group=root mode=0644
with_items:
- access_client
- access_sender
- access_sender-post-filter
- access_helo
- access_recipient
- body_checks
- header_checks
- relocated
- domains
- msa_header_checks
notify:
- Postmap additional files
- name: Create dhparam 2048
command: openssl dhparam -out /etc/postfix/dh2048.pem 2048 creates=/etc/postfix/dh2048.pem
notify:
- Reload postfix
- name: Create ssl cert
include_role:
name: certificate
vars:
domains: ["{{ mail_domain }}"]
- name: Install postfix cert renewal hook
template: src=letsencrypt.hook.d.j2 dest=/etc/letsencrypt/hook.d/postfix owner=root group=root mode=0755
- name: Install bouncehandler config
template: src=wiki-bouncehandler.conf.j2 dest={{ postfix_wiki_bounce_config }} owner={{ postfix_wiki_bounce_user }} group=root mode=0600
- name: Install packages for bounce handler
pacman: name=perl-mediawiki-api,perl-config-simple state=present
- name: Install bouncehandler script
copy: src=bouncehandler.pl dest={{ postfix_wiki_bounce_mail_handler }} owner=root group=root mode=0755
- name: Make bouncehandler user
user: name={{ postfix_wiki_bounce_user }} shell=/bin/false skeleton=/var/empty state=present
- name: Start and enable postfix
service: name=postfix enabled=yes state=started
- name: Remove old files
file: path={{ item }} state=absent
with_items:
- compat_maps
- compat_maps.db
- name: Open firewall holes
ansible.posix.firewalld: service={{ item }} permanent=true state=enabled immediate=yes
with_items:
- smtp
- smtps
when: configure_firewall
tags:
- firewall