From f70be6d0df6426b9dec318141707bf085ead87fd Mon Sep 17 00:00:00 2001 From: Tristan PILAT Date: Wed, 18 Sep 2019 12:21:02 +0200 Subject: [PATCH] Swith to buster for PHP 7.3 - Amend lxc role default variable examples to include buster - Include opensmtpd configuration to replace ssmtp into the container - Delete Sury related tasks - Change packages names when installing php in the php73 container since we are not using Sury anymore --- lxc-php/handlers/main.yml | 3 +++ lxc-php/tasks/php.yml | 32 ++++++++++++-------------------- lxc/defaults/main.yml | 2 ++ 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/lxc-php/handlers/main.yml b/lxc-php/handlers/main.yml index 365179ea..b20fac7b 100644 --- a/lxc-php/handlers/main.yml +++ b/lxc-php/handlers/main.yml @@ -7,3 +7,6 @@ - name: Reload php73-fpm command: "lxc-attach -n php73 -- systemctl reload php7.3-fpm" + +- name: Restart opensmtpd + command: "lxc-attach -n php73 -- systemctl restart opensmtpd" diff --git a/lxc-php/tasks/php.yml b/lxc-php/tasks/php.yml index 25b72ccd..3dda487c 100644 --- a/lxc-php/tasks/php.yml +++ b/lxc-php/tasks/php.yml @@ -23,27 +23,8 @@ command: "lxc-attach -n {{name}} -- apt-get update" when: name == 'php73' -- name: Install requirements for sury repository - command: "lxc-attach -n {{name}} -- apt-get install -y --no-install-recommends wget apt-transport-https ca-certificates gnupg" - when: name == 'php73' - -- name: Add sury APT repository - copy: - content: "deb https://packages.sury.org/php/ stretch main" - dest: "/var/lib/lxc/{{name}}/rootfs/etc/apt/sources.list.d/sury.list" - mode: "0644" - when: name == 'php73' - -- name: Add sury GPG key - shell: "wget -O- https://packages.sury.org/php/apt.gpg |lxc-attach -n {{name}} -- apt-key add -" - when: name == 'php73' - -- name: Update APT cache - command: "lxc-attach -n {{name}} -- apt-get update" - when: name == 'php73' - - name: Install PHP packages - command: "lxc-attach -n {{name}} -- apt-get install -y php7.3 php7.3-fpm php7.3-cli php7.3-curl php7.3-mysql php7.3-pgsql php7.3-ldap php7.3-imap php7.3-gd php-ssh2 php-gettext composer libphp-phpmailer ssmtp git zip unzip php7.3-zip" + command: "lxc-attach -n {{name}} -- apt-get install -y php-fpm php-cli php-gd php-intl php-imap php-ldap php-mysql php-pgsql php-gettext php-curl php-ssh2 composer libphp-phpmailer opensmtpd git zip unzip php-zip" when: name == 'php73' - name: Copy evolinux PHP 5.6 configuration @@ -90,18 +71,29 @@ name: "/var/lib/lxc/{{name}}/rootfs/etc/ssmtp/ssmtp.conf" regexp: "^mailhub=.*$" replace: "mailhub=127.0.0.1" + when: name != 'php73' - name: Configure ssmtp replace: name: "/var/lib/lxc/{{name}}/rootfs/etc/ssmtp/ssmtp.conf" regexp: "^#FromLineOverride=.*$" replace: "FromLineOverride=YES" + when: name != 'php73' - name: Configure ssmtp replace: name: "/var/lib/lxc/{{name}}/rootfs/etc/ssmtp/ssmtp.conf" regexp: "^hostname=.*" replace: "hostname={{ansible_fqdn}}" + when: name != 'php73' + +- name: Configure opensmtpd + replace: + name: "/var/lib/lxc/{{name}}/rootfs/etc/smtpd.conf" + regexp: "^listen.*" + replace: "#listen on localhost" + notify: "Restart opensmtpd" + when: name == 'php73' - name: Configure timezone copy: diff --git a/lxc/defaults/main.yml b/lxc/defaults/main.yml index e7e1c1ff..0e229953 100644 --- a/lxc/defaults/main.yml +++ b/lxc/defaults/main.yml @@ -15,4 +15,6 @@ lxc_mount_part: "/home" # release: jessie # - name: php70 # release: stretch +# - name: php73 +# release: buster lxc_containers: []