From 28b1c3ffe53a814f0f699b2f215431fc5a142438 Mon Sep 17 00:00:00 2001 From: tleduc Date: Tue, 22 Oct 2024 14:18:47 +0200 Subject: [PATCH 1/3] Add Rocky Linux configuration --- tasks/main.yml | 10 ++++++++++ tasks/setup-Rocky.yml | 8 ++++++++ vars/Rocky.yml | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 tasks/setup-Rocky.yml create mode 100644 vars/Rocky.yml diff --git a/tasks/main.yml b/tasks/main.yml index 9d04cfca..a02205ce 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 }}" @@ -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 diff --git a/tasks/setup-Rocky.yml b/tasks/setup-Rocky.yml new file mode 100644 index 00000000..c82ed1ec --- /dev/null +++ b/tasks/setup-Rocky.yml @@ -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 diff --git a/vars/Rocky.yml b/vars/Rocky.yml new file mode 100644 index 00000000..2ed2caf2 --- /dev/null +++ b/vars/Rocky.yml @@ -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 From a2d4db6068b203d46ca5b930a85ca3a67091b4ce Mon Sep 17 00:00:00 2001 From: tleduc Date: Tue, 22 Oct 2024 16:06:44 +0200 Subject: [PATCH 2/3] Add Galaxy meta information --- meta/main.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/meta/main.yml b/meta/main.yml index 9ed6d9ed..417da129 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -18,6 +18,9 @@ galaxy_info: - name: Ubuntu versions: - all + - name: Rocky + versions: + - 9 galaxy_tags: - development - web From 8cb6195ae0ecac338e3504c3bd44c69675f9a180 Mon Sep 17 00:00:00 2001 From: tleduc Date: Tue, 22 Oct 2024 16:47:57 +0200 Subject: [PATCH 3/3] Update galaxy meta information --- meta/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/main.yml b/meta/main.yml index 417da129..4b1c19b3 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -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