redhat/almalinux

This commit is contained in:
ROTTLER Tamas 2025-11-16 16:12:36 +01:00
parent 726b6dc279
commit 37f4e28f8b
4 changed files with 44 additions and 13 deletions

View File

@ -14,13 +14,13 @@
setype: httpd_sys_rw_content_t setype: httpd_sys_rw_content_t
target: "/var/www/.*" target: "/var/www/.*"
when: when:
- ansible_distribution == "RedHat" - ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux"
- ansible_selinux.status == 'enabled' - ansible_selinux.status == 'enabled'
- name: /var/www restorecon - name: /var/www restorecon
command: "restorecon -r /var/www" command: "restorecon -r /var/www"
when: when:
- ansible_distribution == "RedHat" - ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux"
- ansible_selinux.status == 'enabled' - ansible_selinux.status == 'enabled'
- name: www subdirs - name: www subdirs
@ -40,7 +40,7 @@
- name: include redhat specific - name: include redhat specific
include_tasks: redhat.yml include_tasks: redhat.yml
when: ansible_distribution == "RedHat" when: ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux"
- name: conf-available templates - name: conf-available templates
template: template:
@ -84,7 +84,9 @@
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) or (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) or
ansible_distribution == "RedHat" ansible_distribution == "RedHat" or
ansible_distribution == "AlmaLinux"
# vim: set tabstop=2 shiftwidth=2 expandtab smarttab: # vim: set tabstop=2 shiftwidth=2 expandtab smarttab:

View File

@ -1,15 +1,14 @@
--- ---
- name: set phpver for rhel9 - name: set phpver for rhel9-99
set_fact: set_fact:
phpver: "84" phpver: "84"
when: when:
- ansible_distribution == "RedHat" - ansible_distribution_major_version|int() >= 9
- ansible_distribution_major_version|int() == 9
- name: install remi repo - name: install remi repo
tags: dnf tags: dnf
dnf: dnf:
name: "https://rpms.remirepo.net/enterprise/remi-release-9.rpm" name: "https://rpms.remirepo.net/enterprise/remi-release-{{ ansible_distribution_major_version }}.rpm"
disable_gpg_check: yes disable_gpg_check: yes
#- name: dnf module php [phpver] #- name: dnf module php [phpver]
@ -24,8 +23,29 @@
name: name:
- httpd - httpd
- mod_ssl - mod_ssl
- mysql
- name: install packages, rhel9
tags: dnf
dnf:
name:
- redis - redis
- mysql
when:
- ansible_distribution_major_version|int() == 9
- name: install packages, rhel10-99
tags: dnf
dnf:
name:
- valkey
- mysql8.4
when:
- ansible_distribution_major_version|int() >= 10
- name: install php packages
tags: dnf
dnf:
name:
- "php{{ phpver }}-php-fpm" - "php{{ phpver }}-php-fpm"
- "php{{ phpver }}-php-cli" - "php{{ phpver }}-php-cli"
- "php{{ phpver }}-php-bcmath" - "php{{ phpver }}-php-bcmath"
@ -52,6 +72,15 @@
systemd_service: systemd_service:
name: redis name: redis
enabled: true enabled: true
when:
- ansible_distribution_major_version|int() == 9
- name: enable valkey service
systemd_service:
name: valkey
enabled: true
when:
- ansible_distribution_major_version|int() >= 10
- name: enable php-fpm service [phpver] - name: enable php-fpm service [phpver]
systemd_service: systemd_service:

View File

@ -1,5 +1,5 @@
#<VirtualHost *:80> #<VirtualHost *:80>
{% if ansible_distribution == "RedHat" %} {% if ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux" %}
# ErrorLog /var/log/httpd/notls.log # ErrorLog /var/log/httpd/notls.log
# CustomLog /var/log/httpd/notls.log detailed # CustomLog /var/log/httpd/notls.log detailed
{% else %} {% else %}
@ -20,7 +20,7 @@
<VirtualHost *:80> <VirtualHost *:80>
DocumentRoot /var/www/def/public DocumentRoot /var/www/def/public
{% if ansible_distribution == "RedHat" %} {% if ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux" %}
ErrorLog /var/log/httpd/error.log ErrorLog /var/log/httpd/error.log
CustomLog /var/log/httpd/access.log detailed CustomLog /var/log/httpd/access.log detailed
{% else %} {% else %}
@ -33,7 +33,7 @@
Require all granted Require all granted
</Directory> </Directory>
<Files "*.php"> <Files "*.php">
{% if ansible_distribution == "RedHat" %} {% if ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux" %}
SetHandler "proxy:unix:/var/opt/remi/php{{ phpver }}/run/php-fpm/www.sock|fcgi://localhost" SetHandler "proxy:unix:/var/opt/remi/php{{ phpver }}/run/php-fpm/www.sock|fcgi://localhost"
{% else %} {% else %}
SetHandler "proxy:unix:/run/php/php{{ phpver }}-fpm.sock|fcgi://localhost" SetHandler "proxy:unix:/run/php/php{{ phpver }}-fpm.sock|fcgi://localhost"

View File

@ -1,6 +1,6 @@
# Define an access log for VirtualHosts that don't define their own logfile # Define an access log for VirtualHosts that don't define their own logfile
#CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined #CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log vhost_combined
{% if ansible_distribution == "RedHat" %} {% if ansible_distribution == "RedHat" or ansible_distribution == "AlmaLinux" %}
CustomLog /var/log/httpd/other_vhosts_access.log detailed CustomLog /var/log/httpd/other_vhosts_access.log detailed
{% else %} {% else %}
CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log detailed CustomLog ${APACHE_LOG_DIR}/other_vhosts_access.log detailed