41 lines
954 B
YAML
Executable File
41 lines
954 B
YAML
Executable File
---
|
|
- name: install requirements for Postfix
|
|
apt:
|
|
update_cache: yes
|
|
state: "{% if hcs_update | bool %}latest{% else %}present{% endif %}"
|
|
install_recommends: yes
|
|
pkg:
|
|
- postfix
|
|
- postfix-pgsql
|
|
- postfix-mysql
|
|
|
|
- name: install Postfix pip requirements with dedicated pip virtualenv
|
|
pip:
|
|
name:
|
|
- psycopg2-binary
|
|
state: "{% if hcs_update | bool %}latest{% else %}present{% endif %}"
|
|
virtualenv: "{{ modoboa_py_venv }}"
|
|
|
|
- name: setup folder for postfix mapping files
|
|
file:
|
|
state: directory
|
|
path: "{{ postfix_mapping_folder }}"
|
|
mode: 0660
|
|
notify: postfix mappings setup
|
|
|
|
- name: setup postfix config
|
|
template:
|
|
src: etc/postfix/main.cf.j2
|
|
dest: "{{ postfix_dir }}/main.cf"
|
|
owner: "root"
|
|
group: "modoboa"
|
|
mode: 0664
|
|
notify: reload postfix
|
|
|
|
- name: enable postfix systemd unit
|
|
systemd:
|
|
name: postfix
|
|
enabled: yes
|
|
daemon_reload: yes
|
|
state: started
|