Browse Source

(change) lxc-php: refactor tasks for better maintainability (again)

lpoujol/better-multiphp
Ludovic Poujol 1 month ago
parent
commit
bd201e8791
6 changed files with 26 additions and 10 deletions
  1. +6
    -1
      lxc-php/tasks/mail_opensmtpd.yml
  2. +6
    -1
      lxc-php/tasks/mail_ssmtp.yml
  3. +9
    -3
      lxc-php/tasks/misc.yml
  4. +1
    -1
      lxc-php/tasks/php56.yml
  5. +2
    -2
      lxc-php/tasks/php70.yml
  6. +2
    -2
      lxc-php/tasks/php73.yml

+ 6
- 1
lxc-php/tasks/mail_opensmtpd.yml View File

@@ -1,6 +1,11 @@
---

- name: Configure opensmtpd (in the container)
- name: "{{ lxc_php_version }} - Install opensmtpd"
lxc_container:
name: "{{ lxc_php_version }}"
container_command: "DEBIAN_FRONTEND=noninteractive apt install -y ssmtp"

- name: "{{ lxc_php_version }} - Configure opensmtpd (in the container)"
template:
src: smtpd.conf.j2
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/smtpd.conf"


+ 6
- 1
lxc-php/tasks/mail_ssmtp.yml View File

@@ -1,6 +1,11 @@
---

- name: Configure ssmtp (in the container)
- name: "{{ lxc_php_version }} - Install ssmtp"
lxc_container:
name: "{{ lxc_php_version }}"
container_command: "DEBIAN_FRONTEND=noninteractive apt install -y ssmtp"

- name: "{{ lxc_php_version }} - Configure ssmtp"
template:
src: ssmtp.conf.j2
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/ssmtp/ssmtp.conf"


+ 9
- 3
lxc-php/tasks/misc.yml View File

@@ -1,19 +1,25 @@
---

- name: Configure timezone for the container
- name: "{{ lxc_php_version }} - Configure timezone for the container"
copy:
remote_src: yes
src: "/etc/timezone"
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/timezone"

- name: Ensure container's root directory is 755
- name: "{{ lxc_php_version }} - 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
- name: "{{ lxc_php_version }} - 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"


- name: "{{ lxc_php_version }} - Install misc packages"
lxc_container:
name: "{{ lxc_php_version }}"
container_command: "DEBIAN_FRONTEND=noninteractive apt install -y cron logrotate git zip unzip"

+ 1
- 1
lxc-php/tasks/php56.yml View File

@@ -3,7 +3,7 @@
- name: "{{ lxc_php_version }} - Install PHP packages"
lxc_container:
name: "{{ lxc_php_version }}"
container_command: "DEBIAN_FRONTEND=noninteractive apt install -y php5-fpm php5-cli php5-gd php5-imap php5-ldap php5-mcrypt php5-mysql php5-pgsql php-gettext php5-intl php5-curl php5-ssh2 libphp-phpmailer ssmtp git zip unzip"
container_command: "DEBIAN_FRONTEND=noninteractive apt install -y php5-fpm php5-cli php5-gd php5-imap php5-ldap php5-mcrypt php5-mysql php5-pgsql php-gettext php5-intl php5-curl php5-ssh2 libphp-phpmailer ssmtp"

- name: "{{ lxc_php_version }} - Copy evolinux PHP configuration"
template:


+ 2
- 2
lxc-php/tasks/php70.yml View File

@@ -3,7 +3,7 @@
- name: "{{ lxc_php_version }} - Install PHP packages"
lxc_container:
name: "{{ lxc_php_version }}"
container_command: "DEBIAN_FRONTEND=noninteractive apt install -y php-fpm php-cli php-gd php-intl php-imap php-ldap php-mcrypt php-mysql php-pgsql php-gettext php-curl php-ssh2 php-mbstring composer libphp-phpmailer opensmtpd git zip unzip php-zip"
container_command: "DEBIAN_FRONTEND=noninteractive apt install -y php-fpm php-cli php-gd php-intl php-imap php-ldap php-mcrypt php-mysql php-pgsql php-gettext php-curl php-ssh2 php-zip php-mbstring composer libphp-phpmailer"

- name: "{{ lxc_php_version }} - Copy evolinux PHP configuration"
template:
@@ -17,4 +17,4 @@
loop_control:
loop_var: line_item

- include: "mail_opensmtd.yml"
- include: "mail_opensmtpd.yml"

+ 2
- 2
lxc-php/tasks/php73.yml View File

@@ -3,7 +3,7 @@
- name: "{{ lxc_php_version }} - Install PHP packages"
lxc_container:
name: "{{ lxc_php_version }}"
container_command: "DEBIAN_FRONTEND=noninteractive apt install -y php-fpm php-cli php-gd php-intl php-imap php-ldap php-mysql php-pgsql php-gettext php-curl php-ssh2 php-mbstring composer libphp-phpmailer opensmtpd git zip unzip php-zip"
container_command: "DEBIAN_FRONTEND=noninteractive apt install -y php-fpm php-cli php-gd php-intl php-imap php-ldap php-mysql php-pgsql php-gettext php-curl php-ssh2 php-zip php-mbstring php-zip composer libphp-phpmailer"

- name: "{{ lxc_php_version }} - Copy evolinux PHP configuration"
template:
@@ -17,4 +17,4 @@
loop_control:
loop_var: line_item

- include: "mail_opensmtd.yml"
- include: "mail_opensmtpd.yml"

Loading…
Cancel
Save