Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
---
# Remi's RPM repository
# https://rpms.remirepo.net
#
# Command to install:
# dnf --enablerepo=remi install php70
# Command to install additional packages:
# dnf --enablerepo=remi install php70-php-xxx
- name: Import Remi's RPM repository GPG Keys
rpm_key:
state: present
key: https://rpms.remirepo.net/RPM-GPG-KEY-remi2020
become: true
- name: Install Remi's RPM repository
dnf:
name: http://rpms.remirepo.net/fedora/remi-release-{{ ansible_distribution_version }}.rpm
state: present
become: true
- name: Enable Remi's RPM repository
command: "dnf config-manager --set-enabled remi"
changed_when: false
become: true
- name: Create php session directory
file:
path: "{{ php_session_directory }}"
state: directory
mode: 0755
- name: Install php
dnf:
name:
- "php{{ item }}-php"
- "php{{ item }}-php-apcu"
- "php{{ item }}-php-bcmath"
- "php{{ item }}-php-fpm"
- "php{{ item }}-php-gd"
- "php{{ item }}-php-imagick"
- "php{{ item }}-php-intl"
- "php{{ item }}-php-json"
- "php{{ item }}-php-mbstring"
- "php{{ item }}-php-mysqlnd"
- "php{{ item }}-php-opcache"
- "php{{ item }}-php-pdo"
- "php{{ item }}-php-pgsql"
- "php{{ item }}-php-soap"
- "php{{ item }}-php-sodium"
- "php{{ item }}-php-xdebug"
- "php{{ item }}-php-xml"
- "php{{ item }}-php-zip"
- "php{{ item }}-php-redis"
- "php{{ item }}-php-process"
state: present
notify: "php{{ item }}"
become: true
tags: php
loop: "{{ php_versions|flatten(levels=1) }}"
- name: Install php configuration
template:
src: templates/php/99-local.ini.j2
dest: "/etc/opt/remi/php{{ item }}/php.d/99-local.ini"
mode: 0644
notify: "php{{ item }}"
become: true
tags: php
loop: "{{ php_versions|flatten(levels=1) }}"
- name: Install PHP FPM configuration
vars:
- php_fpm_port: "90{{ item }}"
template:
src: templates/php/www.local.conf.j2
dest: "/etc/opt/remi/php{{ item }}/php-fpm.d/www.local.conf"
mode: 0644
notify: "php{{ item }}"
become: true
tags: php
loop: "{{ php_versions|flatten(levels=1) }}"
- name: Disable default php session.save_path
lineinfile:
path: "/etc/opt/remi/php{{ item }}/php-fpm.d/www.conf"
regexp: '^(php_value\[session\.save_path\].*)'
backrefs: true
line: '; \1'
become: true
notify: "php{{ item }}"
loop: "{{ php_versions|flatten(levels=1) }}"
- name: Start PHP FPM service
systemd:
name: "php{{ item }}-php-fpm"
enabled: true
state: started
become: true
tags: php
loop: "{{ php_versions|flatten(levels=1) }}"
- name: Install composer
dnf:
name: composer
state: present
become: true
tags: php