New container lcx php82 in bookworm
All checks were successful
Ansible Lint |Total|New|Outstanding|Fixed|Trend |:-:|:-:|:-:|:-:|:-: |2626|0|2626|0|:zzz:
gitea/ansible-roles/pipeline/head This commit looks good

This commit is contained in:
Eric Morino 2023-08-24 15:23:32 +02:00
parent 53aab6f405
commit 8c72a7de8e
4 changed files with 30 additions and 51 deletions

View file

@ -21,7 +21,7 @@ lxc_php_container_releases:
php74: "bullseye"
php80: "bullseye"
php81: "bullseye"
php82: "bullseye"
php82: "bookworm"
lxc_php_services:
php56: 'php5-fpm.service'

View file

@ -1,46 +1,23 @@
---
- name: set APT keyring (Debian <12)
ansible.builtin.set_fact:
lxc_apt_keyring_dir: /etc/apt/trusted.gpg.d
when: ansible_distribution_major_version is version('12', '<')
- name: set APT keyring (Debian >=12)
ansible.builtin.set_fact:
lxc_apt_keyring_dir: /etc/apt/keyrings
when: ansible_distribution_major_version is version('12', '>=')
- name: "{{ lxc_php_version }} - Install dependency packages"
- name: "{{ lxc_php_version }} - Install PHP packages"
community.general.lxc_container:
name: "{{ lxc_php_version }}"
container_command: "DEBIAN_FRONTEND=noninteractive apt install -y wget apt-transport-https gnupg"
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"
- name: "{{ lxc_php_version }} - fix bullseye repository"
ansible.builtin.replace:
dest: "{{ lxc_rootfs }}/etc/apt/sources.list"
regexp: 'bullseye/updates'
replace: 'bullseye-security'
- name: "{{ lxc_php_version }} - Add sury repo (Debian >=12)"
- name: "{{ lxc_php_version }} - system bookworm repository"
ansible.builtin.template:
src: sury.sources.j2
dest: /etc/apt/sources.list.d/sury.sources
mode: "0644"
src: bookworm_basics.sources.j2
dest: "{{ lxc_rootfs }}/etc/apt/sources.list.d/system.sources"
force: true
mode: "0644"
- name: "{{ lxc_php_version }} - security bookworm repository"
ansible.builtin.template:
src: bookworm_security.sources.j2
dest: "{{ lxc_rootfs }}/etc/apt/sources.list.d/security.sources"
force: true
register: sury_sources
when: ansible_distribution_major_version is version('12', '>=')
- name: "{{ lxc_php_version }} - Add sury repo (Debian <12)"
ansible.builtin.lineinfile:
dest: "{{ lxc_rootfs }}/etc/apt/sources.list.d/sury.list"
line: "{{ item }}"
state: present
create: yes
mode: "0644"
loop:
- "deb [signed-by={{ apt_keyring_dir }}/sury.gpg] https://packages.sury.org/php/ bullseye main"
- "deb [signed-by={{ apt_keyring_dir }}/pub_evolix.asc] http://pub.evolix.org/evolix bullseye-php82 main"
when: ansible_distribution_major_version is version('12', '<')
- name: "Ensure {{ lxc_rootfs }}{{ apt_keyring_dir }} directory exists"
file:
@ -53,16 +30,7 @@
- name: copy pub.evolix.org GPG key
ansible.builtin.copy:
src: pub_evolix.asc
dest: /var/lib/lxc/{{ lxc_php_version }}/rootfs{{ apt_keyring_dir }}/pub_evolix.asc
mode: "0644"
owner: root
group: root
when: ansible_distribution_major_version is version('12', '<')
- name: copy packages.sury.org GPG Key
ansible.builtin.copy:
src: sury.gpg
dest: /var/lib/lxc/{{ lxc_php_version }}/rootfs{{ apt_keyring_dir }}/sury.gpg
dest: "{{ lxc_rootfs }}{{ lxc_apt_keyring_dir }}/pub_evolix.asc"
mode: "0644"
owner: root
group: root
@ -72,11 +40,6 @@
name: "{{ lxc_php_version }}"
container_command: "DEBIAN_FRONTEND=noninteractive apt update"
- name: "{{ lxc_php_version }} - Install PHP packages"
community.general.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"
- name: "{{ lxc_php_version }} - Copy evolinux PHP configuration"
ansible.builtin.template:
src: z-evolinux-defaults.ini.j2

View file

@ -0,0 +1,8 @@
# {{ ansible_managed }}
Types: deb
URIs: http://mirror.evolix.org/debian
Suites: bookworm bookworm-updates
Components: {{ apt_basics_components | mandatory }}
Enabled: yes
Signed-By: /usr/share/keyrings/debian-archive-bookworm-automatic.gpg

View file

@ -0,0 +1,8 @@
# {{ ansible_managed }}
Types: deb
URIs: https://security.debian.org/debian-security
Suites: bookworm-security
Components: {{ apt_basics_components | mandatory }}
Enabled: yes
Signed-By: /usr/share/keyrings/debian-archive-bookworm-security-automatic.gpg