(change) lxc-php: refactor tasks for better maintainability (again)
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing

This commit is contained in:
Ludovic Poujol 2020-04-08 17:58:42 +02:00
parent 93c043c8e0
commit bd201e8791
6 changed files with 26 additions and 10 deletions

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: template:
src: smtpd.conf.j2 src: smtpd.conf.j2
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/smtpd.conf" dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/smtpd.conf"

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: template:
src: ssmtp.conf.j2 src: ssmtp.conf.j2
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/ssmtp/ssmtp.conf" dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/ssmtp/ssmtp.conf"

View file

@ -1,19 +1,25 @@
--- ---
- name: Configure timezone for the container - name: "{{ lxc_php_version }} - Configure timezone for the container"
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 container's root directory is 755 - name: "{{ lxc_php_version }} - 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 - name: "{{ lxc_php_version }} - Configure mailname for the container"
copy: copy:
content: "{{ evolinux_hostname }}.{{ evolinux_domain }}\n" content: "{{ evolinux_hostname }}.{{ evolinux_domain }}\n"
dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/mailname" dest: "/var/lib/lxc/{{ lxc_php_version }}/rootfs/etc/mailname"
notify: "Restart opensmtpd" 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"

View file

@ -3,7 +3,7 @@
- name: "{{ lxc_php_version }} - Install PHP packages" - name: "{{ lxc_php_version }} - Install PHP packages"
lxc_container: lxc_container:
name: "{{ lxc_php_version }}" 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" - name: "{{ lxc_php_version }} - Copy evolinux PHP configuration"
template: template:

View file

@ -3,7 +3,7 @@
- name: "{{ lxc_php_version }} - Install PHP packages" - name: "{{ lxc_php_version }} - Install PHP packages"
lxc_container: lxc_container:
name: "{{ lxc_php_version }}" 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" - name: "{{ lxc_php_version }} - Copy evolinux PHP configuration"
template: template:
@ -17,4 +17,4 @@
loop_control: loop_control:
loop_var: line_item loop_var: line_item
- include: "mail_opensmtd.yml" - include: "mail_opensmtpd.yml"

View file

@ -3,7 +3,7 @@
- name: "{{ lxc_php_version }} - Install PHP packages" - name: "{{ lxc_php_version }} - Install PHP packages"
lxc_container: lxc_container:
name: "{{ lxc_php_version }}" 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" - name: "{{ lxc_php_version }} - Copy evolinux PHP configuration"
template: template:
@ -17,4 +17,4 @@
loop_control: loop_control:
loop_var: line_item loop_var: line_item
- include: "mail_opensmtd.yml" - include: "mail_opensmtpd.yml"