ansible/roles/php/tasks/main.yml

28 lines
931 B
YAML

- name: install php-fpm
pacman: name=php-fpm state=present
- name: php-fpm.ini
template: src=php-fpm.conf.j2 dest=/etc/php/php-fpm.conf mode=0644 backup=yes
notify: stop php-fpm
- name: php.ini
template: src=php.ini.j2 dest=/etc/php/php.ini mode=0644 backup=yes
notify: stop php-fpm
- copy: src={{ item }} dest=/etc/systemd/system/{{ item }} mode=0644
with_items:
- php-fpm.service
- php-fpm.socket
- php-fpm-stop.timer
- php-fpm-stop.service
notify: Reload systemd
- copy: src=stop-php-fpm dest=/usr/local/bin/stop-php-fpm mode=0755
- shell: /usr/bin/systemctl --quiet is-active php-fpm.socket
register: fpm_socket_started
ignore_errors: True
- name: Stop php-fpm
service: name=php-fpm.service state=stopped
when: fpm_socket_started.rc != 0
- name: Start php-fpm socket activation
service: name={{item}} state=started enabled=yes
with_items:
- php-fpm.socket
- php-fpm-stop.timer