lxc-php: prepare php82

This commit is contained in:
Jérémy Lecour 2023-03-19 11:52:09 +01:00 committed by Jérémy Lecour
parent 1d03e73a62
commit f8f5bec8b5
3 changed files with 47 additions and 10 deletions

View file

@ -21,6 +21,7 @@ lxc_php_container_releases:
php74: "bullseye"
php80: "bullseye"
php81: "bullseye"
# php82: "bookworm"
lxc_php_services:
php56: 'php5-fpm.service'
@ -29,5 +30,6 @@ lxc_php_services:
php74: 'php7.4-fpm.service'
php80: 'php8.0-fpm.service'
php81: 'php8.1-fpm.service'
# php82: 'php8.2-fpm.service'
apt_keyring_dir: "{{ ansible_distribution_major_version is version('12', '<') | ternary('/etc/apt/trusted.gpg.d', '/etc/apt/keyrings') }}"

View file

@ -1,6 +1,6 @@
---
- name: "Ensure that lxc_php_version is defined"
fail:
ansible.builtin.fail:
msg: Please configure var lxc_php_version
when: lxc_php_version is none
@ -17,28 +17,31 @@
lxc_rootfs: "/var/lib/lxc/{{ lxc_php_version }}/rootfs"
- name: "Update APT cache in container {{ lxc_php_version }}"
lxc_container:
community.general.lxc_container:
name: "{{ lxc_php_version }}"
container_command: "apt-get update"
- include: "php56.yml"
- ansible.builtin.import_tasks: "php56.yml"
when: lxc_php_version == "php56"
- include: "php70.yml"
- ansible.builtin.import_tasks: "php70.yml"
when: lxc_php_version == "php70"
- include: "php73.yml"
- ansible.builtin.import_tasks: "php73.yml"
when: lxc_php_version == "php73"
- include: "php74.yml"
- ansible.builtin.import_tasks: "php74.yml"
when: lxc_php_version == "php74"
- include: "php80.yml"
- ansible.builtin.import_tasks: "php80.yml"
when: lxc_php_version == "php80"
- include: "php81.yml"
- ansible.builtin.import_tasks: "php81.yml"
when: lxc_php_version == "php81"
- include: "umask.yml"
# - ansible.builtin.import_tasks: "php82.yml"
# when: lxc_php_version == "php82"
- include: "misc.yml"
- ansible.builtin.import_tasks: "umask.yml"
- ansible.builtin.import_tasks: "misc.yml"

32
lxc-php/tasks/php82.yml Normal file
View file

@ -0,0 +1,32 @@
---
- name: set APT keyring
ansible.builtin.set_fact:
lxc_apt_keyring_dir: /etc/apt/keyrings
- 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-sqlite3 php-curl php-zip php-mbstring php-xml php-zip composer libphp-phpmailer"
# TODO : adapt to Bookworm and deb822 format
- name: "{{ lxc_php_version }} - fix bookworm repository"
replace:
dest: "{{ lxc_rootfs }}/etc/apt/sources.list"
regexp: 'bullseye/updates'
replace: 'bullseye-security'
- name: "{{ lxc_php_version }} - Copy evolinux PHP configuration"
template:
src: z-evolinux-defaults.ini.j2
dest: "{{ line_item }}"
mode: "0644"
notify: "Reload {{ lxc_php_version }}-fpm"
loop:
- "{{ lxc_rootfs }}/etc/php/8.2/fpm/conf.d/z-evolinux-defaults.ini"
- "{{ lxc_rootfs }}/etc/php/8.2/cli/conf.d/z-evolinux-defaults.ini"
loop_control:
loop_var: line_item
- include: "mail_opensmtpd.yml"