postfix: Lint fixes
This commit is contained in:
parent
9a2cd1e646
commit
e117fa23c5
1 changed files with 68 additions and 68 deletions
|
@ -43,86 +43,86 @@
|
||||||
- mail_server is defined
|
- mail_server is defined
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: install stunnel
|
- name: install stunnel
|
||||||
package:
|
package:
|
||||||
name: stunnel
|
name: stunnel
|
||||||
state: installed
|
state: installed
|
||||||
|
|
||||||
- name: create group smtps
|
- name: create group smtps
|
||||||
group:
|
group:
|
||||||
name: smtps
|
name: smtps
|
||||||
system: true
|
system: true
|
||||||
|
|
||||||
- name: create user smtps
|
- name: create user smtps
|
||||||
user:
|
user:
|
||||||
name: smtps
|
name: smtps
|
||||||
comment: Service Stunnel-SMTPS
|
comment: Service Stunnel-SMTPS
|
||||||
createhome: false
|
createhome: false
|
||||||
group: smtps
|
group: smtps
|
||||||
home: /var/empty
|
home: /var/empty
|
||||||
shell: /sbin/nologin
|
shell: /sbin/nologin
|
||||||
system: true
|
system: true
|
||||||
|
|
||||||
- name: create stunnel config
|
|
||||||
template:
|
|
||||||
src: stunnel.conf.j2
|
|
||||||
dest: /etc/stunnel/smtps.conf
|
|
||||||
mode: 0644
|
|
||||||
owner: root
|
|
||||||
group: "{{ ansible_wheel }}"
|
|
||||||
notify: restart stunnel-smtps
|
|
||||||
|
|
||||||
- name: create stunnel systemd service
|
- name: create stunnel config
|
||||||
copy:
|
template:
|
||||||
src: stunnel-smtps.service
|
src: stunnel.conf.j2
|
||||||
dest: /etc/systemd/system/stunnel-smtps.service
|
dest: /etc/stunnel/smtps.conf
|
||||||
mode: 0644
|
mode: 0644
|
||||||
owner: root
|
owner: root
|
||||||
group: "{{ ansible_wheel }}"
|
group: "{{ ansible_wheel }}"
|
||||||
notify: restart stunnel-smtps
|
notify: restart stunnel-smtps
|
||||||
|
|
||||||
- name: enable stunnel service
|
- name: create stunnel systemd service
|
||||||
service:
|
copy:
|
||||||
name: stunnel-smtps
|
src: stunnel-smtps.service
|
||||||
state: started
|
dest: /etc/systemd/system/stunnel-smtps.service
|
||||||
enabled: true
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: "{{ ansible_wheel }}"
|
||||||
|
notify: restart stunnel-smtps
|
||||||
|
|
||||||
- name: configure relayhost
|
- name: enable stunnel service
|
||||||
lineinfile:
|
service:
|
||||||
path: /etc/postfix/main.cf
|
name: stunnel-smtps
|
||||||
regexp: '^relayhost\s*='
|
state: started
|
||||||
insertafter: '^#relayhost\s*='
|
enabled: true
|
||||||
line: "relayhost = [localhost]:2525"
|
|
||||||
notify: restart postfix
|
- name: configure relayhost
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/postfix/main.cf
|
||||||
|
regexp: '^relayhost\s*='
|
||||||
|
insertafter: '^#relayhost\s*='
|
||||||
|
line: "relayhost = [localhost]:2525"
|
||||||
|
notify: restart postfix
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- ansible_distribution_major_version|int < 8
|
- ansible_distribution_major_version|int < 8
|
||||||
- mail_server is defined
|
- mail_server is defined
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: configure relayhost
|
- name: configure relayhost
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/postfix/main.cf
|
path: /etc/postfix/main.cf
|
||||||
regexp: '^relayhost\s*='
|
regexp: '^relayhost\s*='
|
||||||
insertafter: '^#relayhost\s*='
|
insertafter: '^#relayhost\s*='
|
||||||
line: "relayhost = [{{ mail_server }}]:465"
|
line: "relayhost = [{{ mail_server }}]:465"
|
||||||
notify: restart postfix
|
notify: restart postfix
|
||||||
|
|
||||||
- name: configure smtp_tls_security_level
|
|
||||||
lineinfile:
|
|
||||||
path: /etc/postfix/main.cf
|
|
||||||
regexp: '^smtp_tls_security_level\s*='
|
|
||||||
insertafter: '^#?relayhost\s*='
|
|
||||||
line: "smtp_tls_security_level = encrypt"
|
|
||||||
notify: restart postfix
|
|
||||||
|
|
||||||
- name: configure smtp_tls_wrappermode
|
- name: configure smtp_tls_security_level
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /etc/postfix/main.cf
|
path: /etc/postfix/main.cf
|
||||||
regexp: '^smtp_tls_wrappermode\s*='
|
regexp: '^smtp_tls_security_level\s*='
|
||||||
insertafter: '^#?relayhost\s*='
|
insertafter: '^#?relayhost\s*='
|
||||||
line: "smtp_tls_wrappermode = yes"
|
line: "smtp_tls_security_level = encrypt"
|
||||||
notify: restart postfix
|
notify: restart postfix
|
||||||
|
|
||||||
|
- name: configure smtp_tls_wrappermode
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/postfix/main.cf
|
||||||
|
regexp: '^smtp_tls_wrappermode\s*='
|
||||||
|
insertafter: '^#?relayhost\s*='
|
||||||
|
line: "smtp_tls_wrappermode = yes"
|
||||||
|
notify: restart postfix
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- ansible_distribution_major_version|int >= 8
|
- ansible_distribution_major_version|int >= 8
|
||||||
|
|
Loading…
Add table
Reference in a new issue