aboutsummaryrefslogtreecommitdiffstats
path: root/roles/php/tasks
diff options
context:
space:
mode:
authorStonewall Jackson <stonewall@sacredheartsc.com>2023-02-04 01:23:43 -0500
committerStonewall Jackson <stonewall@sacredheartsc.com>2023-02-04 01:52:13 -0500
commit0261e875679f1bf63c8d689da7fc7e014597885d (patch)
tree3f19cd74a0c1070944f75437f30b098d6ef2ffcb /roles/php/tasks
downloadselfhosted-0261e875679f1bf63c8d689da7fc7e014597885d.tar.gz
selfhosted-0261e875679f1bf63c8d689da7fc7e014597885d.zip
initial commit
Diffstat (limited to 'roles/php/tasks')
-rw-r--r--roles/php/tasks/main.yml32
1 files changed, 32 insertions, 0 deletions
diff --git a/roles/php/tasks/main.yml b/roles/php/tasks/main.yml
new file mode 100644
index 0000000..6505ec0
--- /dev/null
+++ b/roles/php/tasks/main.yml
@@ -0,0 +1,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