Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Rocky Linux configuration #430

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dependencies: []
galaxy_info:
role_name: php
author: geerlingguy
description: PHP for RedHat/CentOS/Fedora/Debian/Ubuntu.
description: PHP for RedHat/CentOS/Fedora/Debian/Ubuntu/Rocky.
company: "Midwestern Mac, LLC"
license: "license (BSD, MIT)"
min_ansible_version: 2.10
Expand All @@ -18,6 +18,9 @@ galaxy_info:
- name: Ubuntu
versions:
- all
- name: Rocky
versions:
- 9
galaxy_tags:
- development
- web
Expand Down
10 changes: 10 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
__php_packages: "{{ __php_packages + [__php_json_package_debian] }}"
when: __php_json_package_debian is defined and __php_json_package_debian not in __php_packages

- name: Set the default PHP version for Rocky-based OSes.
set_fact:
php_default_version_rocky: "{{ __php_default_version_rocky }}"
when: php_default_version_rocky is not defined and ansible_os_family == 'Rocky'

- name: Define php_packages.
set_fact:
php_packages: "{{ __php_packages | list }}"
Expand Down Expand Up @@ -76,6 +81,11 @@
- not php_install_from_source
- ansible_os_family == 'Debian'

- include_tasks: setup-Rocky.yml
when:
- not php_install_from_source
- ansible_os_family == 'Rocky'

# Install PHP from source when php_install_from_source is true.
- include_tasks: install-from-source.yml
when: php_install_from_source
Expand Down
8 changes: 8 additions & 0 deletions tasks/setup-Rocky.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

- name: Ensure PHP packages are installed.
ansible.builtin.dnf:
name: "{{ php_packages + php_packages_extra }}"
state: "{{ php_packages_state }}"
enablerepo: "{{ php_enablerepo | default(omit, true) }}"
notify: restart webserver
37 changes: 37 additions & 0 deletions vars/Rocky.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
__php_packages:
- php
- php-cli
- php-common
- php-devel
- php-fpm
- php-gd
- php-ldap
- php-mbstring
- php-opcache
- php-pdo
- php-pear
- php-pecl-apcu
- php-xml
__php_default_version_rocky: "8.2"

__php_webserver_daemon: "httpd"

__php_conf_paths:
- /etc/php/{{ php_default_version_rocky }}/fpm
- /etc/php/{{ php_default_version_rocky }}/httpd
- /etc/php/{{ php_default_version_rocky }}/cli

__php_extension_conf_paths:
- /etc/php/{{ php_default_version_rocky }}/fpm/conf.d
- /etc/php/{{ php_default_version_rocky }}/httpd/conf.d
- /etc/php/{{ php_default_version_rocky }}/cli/conf.d

__php_apc_conf_filename: 20-apcu.ini
__php_opcache_conf_filename: 10-opcache.ini
__php_fpm_daemon: php-fpm
__php_fpm_conf_path: "/etc/php/{{ php_default_version_rocky }}/fpm"
__php_fpm_pool_conf_path: "{{ __php_fpm_conf_path }}/pool.d/www.conf"

__php_fpm_pool_user: apache
__php_fpm_pool_group: apache