(change) lxc-php: Use OpenSMTPD for Stretch/Buster containers, and ssmtp for Jessie containers
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/pr Build is failing Details

This commit is contained in:
Ludovic Poujol 2020-04-01 15:56:32 +02:00
parent a21fcaf663
commit 135a089341
8 changed files with 51 additions and 15 deletions

View File

@ -68,6 +68,7 @@ The **patch** part changes incrementally at each release.
* lxc: remove useless loop in apt execution
* lxc: update our default template to be compatible with Debian 10
* 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
* minifirewall: better alert5 activation
* minifirewall: no http filtering by default

View 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"

View 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"

View File

@ -1,26 +1,19 @@
---
- name: Configure opensmtpd
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
- name: Configure timezone for the container
copy:
remote_src: yes
src: "/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:
path: "/var/lib/lxc/{{ lxc_php_version }}/rootfs"
state: directory
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"

View File

@ -16,3 +16,5 @@
- "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php5/cli/conf.d/z-evolinux-defaults.ini"
loop_control:
loop_var: line_item
- include: "mail_ssmtp.yml"

View File

@ -16,3 +16,5 @@
- "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.0/cli/conf.d/z-evolinux-defaults.ini"
loop_control:
loop_var: line_item
- include: "mail_opensmtd.yml"

View File

@ -16,3 +16,5 @@
- "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/php/7.3/cli/conf.d/z-evolinux-defaults.ini"
loop_control:
loop_var: line_item
- include: "mail_opensmtd.yml"

View 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