debian 12

This commit is contained in:
ROTTLER Tamas 2023-06-24 01:30:17 +02:00
parent fd33efd0cb
commit c4197a5111
3 changed files with 84 additions and 30 deletions

View File

@ -87,9 +87,19 @@
create: yes create: yes
when: when:
- ansible_distribution == "Debian" - ansible_distribution == "Debian"
- ansible_distribution_major_version|int() >= 11 - ansible_distribution_major_version|int() == 11
- name: apt update, bullseye - name: sury repo in sources list, bookworm
tags: apt
lineinfile:
dest: /etc/apt/sources.list.d/php-sury.list
line: 'deb https://packages.sury.org/php/ bookworm main'
create: yes
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version|int() >= 12
- name: apt update, bullseye+
tags: apt tags: apt
apt: apt:
update_cache: yes update_cache: yes
@ -97,30 +107,59 @@
- ansible_distribution == "Debian" - ansible_distribution == "Debian"
- ansible_distribution_major_version|int() >= 11 - ansible_distribution_major_version|int() >= 11
- name: install packages, bullseye - name: set phpver for debian bullseye
set_fact:
phpver: "7.4"
when:
- (ansible_distribution == "Debian" and ansible_distribution_major_version|int() == 11) or
(ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20)
- name: set phpver for debian bookworm+
set_fact:
phpver: "8.2"
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version|int() >= 12
- name: install packages, bullseye+
tags: apt tags: apt
apt: apt:
name: name:
- apache2 - apache2
- mariadb-client - mariadb-client
- php7.4-cli - "php{{ phpver }}-cli"
- php7.4-fpm - "php{{ phpver }}-fpm"
- php7.4-bcmath - "php{{ phpver }}-bcmath"
- php7.4-curl - "php{{ phpver }}-curl"
- php7.4-gd - "php{{ phpver }}-gd"
- php7.4-json - "php{{ phpver }}-ldap"
- php7.4-ldap - "php{{ phpver }}-mbstring"
- php7.4-mbstring - "php{{ phpver }}-mysql"
- php7.4-mysql - "php{{ phpver }}-opcache"
- php7.4-opcache - "php{{ phpver }}-readline"
- php7.4-readline - "php{{ phpver }}-soap"
- php7.4-soap - "php{{ phpver }}-xml"
- php7.4-xml - "php{{ phpver }}-zip"
- php7.4-zip
state: present state: present
when: when:
- (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or - phpver is defined
(ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20)
- name: install packages, bullseye+
tags: apt
apt:
name:
- "php{{ phpver }}-json"
state: present
when:
- phpver is defined
- phpver == "7.4"
- name: php fpm/pool.d/www.conf, bullseye+
template:
src: pool_www.conf
dest: "/etc/php/{{ phpver }}/fpm/pool.d/www.conf"
when:
- phpver is defined
- name: conf-available - name: conf-available
copy: copy:
@ -151,9 +190,9 @@
- ansible_distribution == "Debian" - ansible_distribution == "Debian"
- ansible_distribution_major_version|int() < 11 - ansible_distribution_major_version|int() < 11
- name: virtualhost config, bullseye - name: virtualhost config, bullseye+
copy: template:
src: 000-default_fpm7.4.conf src: 000-default_fpm.conf
dest: /etc/apache2/sites-available/000-default.conf dest: /etc/apache2/sites-available/000-default.conf
when: when:
- (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or
@ -195,13 +234,13 @@
- ansible_distribution == "Debian" - ansible_distribution == "Debian"
- ansible_distribution_major_version == "10" - ansible_distribution_major_version == "10"
- name: php config, bullseye #- name: php config, bullseye
copy: # copy:
src: hws.php.ini.fpm # src: hws.php.ini.fpm
dest: /etc/php/7.4/hws.php.ini # dest: /etc/php/7.4/hws.php.ini
when: # when:
- (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or # - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() == 11) or
(ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) # (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20)
- name: php config symlinks, stretch - name: php config symlinks, stretch
file: file:

View File

@ -9,7 +9,7 @@
Require all granted Require all granted
</Directory> </Directory>
<Files "*.php"> <Files "*.php">
SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost" SetHandler "proxy:unix:/run/php/php{{ phpver }}-fpm.sock|fcgi://localhost"
</Files> </Files>
</VirtualHost> </VirtualHost>

15
templates/pool_www.conf Normal file
View File

@ -0,0 +1,15 @@
[www]
user = www-data
group = www-data
listen = /run/php/php{{ phpver }}-fpm.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
php_admin_value[user_ini.filename] = .php.ini
php_admin_value[user_ini.cache_ttl] = 60