task name javitasok, phpver

This commit is contained in:
ROTTLER Tamas 2024-12-17 22:04:02 +01:00
parent c4197a5111
commit cb557bc52e

View File

@ -31,7 +31,7 @@
- name: www index.html
shell: "test -e /var/www/def/public/index.html || hostname > /var/www/def/public/index.html"
- name: install packages, jessie
- name: install packages, debian8
tags: apt
apt:
name:
@ -49,7 +49,7 @@
- ansible_distribution == "Debian"
- ansible_distribution_major_version == "8"
- name: install packages, stretch-buster
- name: install packages, debian9-10
tags: apt
apt:
name:
@ -72,14 +72,14 @@
- ansible_distribution == "Debian"
- ansible_distribution_major_version|int() == 9 or ansible_distribution_major_version|int() == 10
- name: sury repo pgp key, bullseye+
- name: sury repo pgp key, debian11-99
tags: apt
shell: "curl {{ (proxy is defined) | ternary('--proxy '+ proxy|default(''), '')}} -o /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg"
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version|int() >= 11
- name: sury repo in sources list, bullseye
- name: sury repo in sources list, debian11
tags: apt
lineinfile:
dest: /etc/apt/sources.list.d/php-sury.list
@ -89,7 +89,7 @@
- ansible_distribution == "Debian"
- ansible_distribution_major_version|int() == 11
- name: sury repo in sources list, bookworm
- name: sury repo in sources list, debian12
tags: apt
lineinfile:
dest: /etc/apt/sources.list.d/php-sury.list
@ -97,9 +97,9 @@
create: yes
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version|int() >= 12
- ansible_distribution_major_version|int() == 12
- name: apt update, bullseye+
- name: apt update, debian11-99
tags: apt
apt:
update_cache: yes
@ -107,21 +107,38 @@
- ansible_distribution == "Debian"
- ansible_distribution_major_version|int() >= 11
- name: set phpver for debian bullseye
- name: set phpver for debian11 ubuntu20
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)
- ansible_distribution == "Debian"
- ansible_distribution_major_version|int() == 12
- name: set phpver for debian bookworm+
- name: set phpver for debian debian12
set_fact:
phpver: "8.2"
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version|int() >= 12
- ansible_distribution_major_version|int() == 12
- name: install packages, bullseye+
- name: set phpver for ubuntu20
set_fact:
phpver: "7.4"
# default, ubuntuba nem teszunk sury repot
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_major_version|int() == 20
- name: set phpver for debian ubuntu22
set_fact:
phpver: "8.1"
# default, ubuntuba nem teszunk sury repot
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_major_version|int() == 22
- name: install packages [phpver]
tags: apt
apt:
name:
@ -134,6 +151,7 @@
- "php{{ phpver }}-gd"
- "php{{ phpver }}-ldap"
- "php{{ phpver }}-mbstring"
- "php{{ phpver }}-mongodb"
- "php{{ phpver }}-mysql"
- "php{{ phpver }}-opcache"
- "php{{ phpver }}-readline"
@ -144,7 +162,7 @@
when:
- phpver is defined
- name: install packages, bullseye+
- name: install json for php7.4 [phpver]
tags: apt
apt:
name:
@ -154,7 +172,7 @@
- phpver is defined
- phpver == "7.4"
- name: php fpm/pool.d/www.conf, bullseye+
- name: php fpm/pool.d/www.conf [phpver]
template:
src: pool_www.conf
dest: "/etc/php/{{ phpver }}/fpm/pool.d/www.conf"
@ -170,19 +188,19 @@
- charset.conf
- log-detailed.conf
- name: enable confs / modules, -buster
- name: enable confs / modules, debian0-10
shell: "a2enconf charset log-detailed && a2enmod rewrite"
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version|int() < 11
- name: enable confs / modules, bullseye+
- name: enable confs / modules, debian11-99 ubuntu20-99
shell: "a2enconf charset log-detailed && a2enmod rewrite headers proxy_fcgi"
when:
- (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or
(ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20)
- name: virtualhost config, -buster
- name: virtualhost config, debian0-10
copy:
src: 000-default_modphp.conf
dest: /etc/apache2/sites-available/000-default.conf
@ -190,7 +208,7 @@
- ansible_distribution == "Debian"
- ansible_distribution_major_version|int() < 11
- name: virtualhost config, bullseye+
- name: virtualhost config, debian11-99 ubuntu20-99
template:
src: 000-default_fpm.conf
dest: /etc/apache2/sites-available/000-default.conf
@ -198,7 +216,7 @@
- (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or
(ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20)
- name: php config, jessie
- name: php config, debian8
copy:
src: hws.php.ini.modphp
dest: /etc/php5
@ -206,7 +224,7 @@
- ansible_distribution == "Debian"
- ansible_distribution_major_version == "8"
- name: php config symlinks, jessie
- name: php config symlinks, debian8
file:
state: link
src: /etc/php5/hws.php.ini
@ -218,7 +236,7 @@
- ansible_distribution == "Debian"
- ansible_distribution_major_version == "8"
- name: php config, stretch
- name: php config, debian9
copy:
src: hws.php.ini.modphp
dest: /etc/php/7.0/hws.php.ini
@ -226,7 +244,7 @@
- ansible_distribution == "Debian"
- ansible_distribution_major_version == "9"
- name: php config, buster
- name: php config, debian10
copy:
src: hws.php.ini.modphp
dest: /etc/php/7.3/hws.php.ini
@ -242,7 +260,7 @@
# - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() == 11) or
# (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20)
- name: php config symlinks, stretch
- name: php config symlinks, debian9
file:
state: link
src: /etc/php/7.0/hws.php.ini
@ -254,7 +272,7 @@
- ansible_distribution == "Debian"
- ansible_distribution_major_version == "9"
- name: php config symlinks, buster
- name: php config symlinks, debian10
file:
state: link
src: /etc/php/7.3/hws.php.ini
@ -284,7 +302,7 @@
src: logrotate.conf
dest: /etc/logrotate.d/php
- name: security.conf ServerTokens, bullseye+
- name: security.conf ServerTokens, debian11-99 ubuntu20-99
tags: apt
lineinfile:
dest: /etc/apache2/conf-available/security.conf
@ -295,7 +313,7 @@
(ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20)
- name: security.conf ServerSignature, bullseye+
- name: security.conf ServerSignature, debian11-99 ubuntu20-99
tags: apt
lineinfile:
dest: /etc/apache2/conf-available/security.conf