feat: adapt smtprelay role for external use
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
---
|
||||
- name: Include stunnel on condition
|
||||
ansible.builtin.include_tasks:
|
||||
file: stunnel.yml
|
||||
when: smtprelay_port not in [587]
|
||||
|
||||
- name: Install postfix smtp server
|
||||
ansible.builtin.package:
|
||||
|
21
roles/smtprelay/tasks/stunnel.yml
Normal file
21
roles/smtprelay/tasks/stunnel.yml
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
|
||||
- name: Install stunnel
|
||||
package:
|
||||
name: stunnel4
|
||||
state: present
|
||||
|
||||
- name: SMTP wrapper
|
||||
template:
|
||||
src: smtp-wrapper.conf.j2
|
||||
dest: /etc/stunnel/smtp-wrapper.conf
|
||||
mode: 0644
|
||||
notify: Restart stunnel4
|
||||
|
||||
- name: Rewrite var smtprelay_host
|
||||
set_fact:
|
||||
smtprelay_host: "localhost"
|
||||
|
||||
- name: Rewrite var smtprelay_port
|
||||
set_fact:
|
||||
smtprelay_port: "2{{ smtprelay_port }}"
|
Reference in New Issue
Block a user