forked from evolix/ansible-roles
(change) lxc-php: Use OpenSMTPD for Stretch/Buster containers, and ssmtp for Jessie containers
This commit is contained in:
parent
a21fcaf663
commit
135a089341
|
@ -68,6 +68,7 @@ The **patch** part changes incrementally at each release.
|
||||||
* lxc: remove useless loop in apt execution
|
* lxc: remove useless loop in apt execution
|
||||||
* lxc: update our default template to be compatible with Debian 10
|
* lxc: update our default template to be compatible with Debian 10
|
||||||
* lxc-php: refactor tasks for better maintainability
|
* lxc-php: refactor tasks for better maintainability
|
||||||
|
* lxc-php: Use OpenSMTPD for Stretch/Buster containers, and ssmtp for Jessie containers
|
||||||
* lxc-solr: changed default Solr version to 8.4.1
|
* lxc-solr: changed default Solr version to 8.4.1
|
||||||
* minifirewall: better alert5 activation
|
* minifirewall: better alert5 activation
|
||||||
* minifirewall: no http filtering by default
|
* minifirewall: no http filtering by default
|
||||||
|
|
8
lxc-php/tasks/mail_opensmtpd.yml
Normal file
8
lxc-php/tasks/mail_opensmtpd.yml
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: Configure opensmtpd (in the container)
|
||||||
|
template:
|
||||||
|
src: smtpd.conf.j2
|
||||||
|
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/smtpd.conf"
|
||||||
|
mode: "0644"
|
||||||
|
notify: "Restart opensmtpd"
|
7
lxc-php/tasks/mail_ssmtp.yml
Normal file
7
lxc-php/tasks/mail_ssmtp.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: Configure ssmtp (in the container)
|
||||||
|
template:
|
||||||
|
src: ssmtp.conf.j2
|
||||||
|
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/ssmtp/ssmtp.conf"
|
||||||
|
mode: "0644"
|
|
@ -1,26 +1,19 @@
|
||||||
---
|
---
|
||||||
|
|
||||||
- name: Configure opensmtpd
|
- name: Configure timezone for the container
|
||||||
template:
|
|
||||||
src: smtpd.conf.j2
|
|
||||||
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/smtpd.conf"
|
|
||||||
mode: "0644"
|
|
||||||
notify: "Restart opensmtpd"
|
|
||||||
|
|
||||||
- name: Copy using inline content
|
|
||||||
copy:
|
|
||||||
content: "{{ evolinux_hostname }}.{{ evolinux_domain }}\n"
|
|
||||||
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/mailname"
|
|
||||||
notify: "Restart opensmtpd"
|
|
||||||
|
|
||||||
- name: Configure timezone
|
|
||||||
copy:
|
copy:
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
src: "/etc/timezone"
|
src: "/etc/timezone"
|
||||||
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/timezone"
|
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/timezone"
|
||||||
|
|
||||||
- name: Ensure containers root directory is 755
|
- name: Ensure container's root directory is 755
|
||||||
file:
|
file:
|
||||||
path: "/var/lib/lxc/{{ lxc_php_version }}/rootfs"
|
path: "/var/lib/lxc/{{ lxc_php_version }}/rootfs"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Configure mailname for the container
|
||||||
|
copy:
|
||||||
|
content: "{{ evolinux_hostname }}.{{ evolinux_domain }}\n"
|
||||||
|
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/mailname"
|
||||||
|
notify: "Restart opensmtpd"
|
||||||
|
|
|
@ -16,3 +16,5 @@
|
||||||
- "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php5/cli/conf.d/z-evolinux-defaults.ini"
|
- "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php5/cli/conf.d/z-evolinux-defaults.ini"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: line_item
|
loop_var: line_item
|
||||||
|
|
||||||
|
- include: "mail_ssmtp.yml"
|
||||||
|
|
|
@ -16,3 +16,5 @@
|
||||||
- "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.0/cli/conf.d/z-evolinux-defaults.ini"
|
- "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.0/cli/conf.d/z-evolinux-defaults.ini"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: line_item
|
loop_var: line_item
|
||||||
|
|
||||||
|
- include: "mail_opensmtd.yml"
|
||||||
|
|
|
@ -16,3 +16,5 @@
|
||||||
- "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.3/cli/conf.d/z-evolinux-defaults.ini"
|
- "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.3/cli/conf.d/z-evolinux-defaults.ini"
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: line_item
|
loop_var: line_item
|
||||||
|
|
||||||
|
- include: "mail_opensmtd.yml"
|
||||||
|
|
21
lxc-php/templates/ssmtp.conf.j2
Normal file
21
lxc-php/templates/ssmtp.conf.j2
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#
|
||||||
|
# Config file for sSMTP sendmail
|
||||||
|
#
|
||||||
|
# The person who gets all mail for userids < 1000
|
||||||
|
# Make this empty to disable rewriting.
|
||||||
|
root=postmaster
|
||||||
|
|
||||||
|
# The place where the mail goes. The actual machine name is required no
|
||||||
|
# MX records are consulted. Commonly mailhosts are named mail.domain.com
|
||||||
|
mailhub=127.0.0.1
|
||||||
|
|
||||||
|
# Where will the mail seem to come from?
|
||||||
|
#rewriteDomain=
|
||||||
|
|
||||||
|
# The full hostname
|
||||||
|
hostname={{ ansible_fqdn }}
|
||||||
|
|
||||||
|
# Are users allowed to set their own From: address?
|
||||||
|
# YES - Allow the user to specify their own From: address
|
||||||
|
# NO - Use the system generated From: address
|
||||||
|
FromLineOverride=YES
|
Loading…
Reference in a new issue