aboutsummaryrefslogtreecommitdiffstats
path: root/roles/php/tasks/main.yml
blob: 6505ec037a9b0a6ef93eab72d666bbcad65882a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
- name: install php
  dnf:
    name: '{{ php_packages[ansible_distribution_major_version] }}'
    state: present

# TODO: we should support multiple pools
- name: generate php configuration
  template:
    src: '{{ item[1:] }}.j2'
    dest: '{{ item }}'
  loop:
    - /etc/php.ini
    - /etc/php-fpm.conf
    - /etc/php-fpm.d/www.conf
  notify: restart php-fpm

- name: create systemd override directory
  file:
    path: /etc/systemd/system/php-fpm.service.d
    state: directory

- name: create systemd override file
  copy:
    src: etc/systemd/system/php-fpm.service.d/override.conf
    dest: /etc/systemd/system/php-fpm.service.d/override.conf
  notify: restart php-fpm
  register: php_fpm_systemd_unit

- name: reload systemd daemon
  systemd:
    daemon_reload: yes
  when: php_fpm_systemd_unit.changed