decorrelation SITE et sous domain
[lhc/ansible.git] / tasks / config_WP.yml
diff --git a/tasks/config_WP.yml b/tasks/config_WP.yml
new file mode 100644 (file)
index 0000000..cee9b66
--- /dev/null
@@ -0,0 +1,38 @@
+- name: Etckeeper commit if necessary
+  ansible.builtin.command: etckeeper commit "commit by ansible because installing {{ DOMAIN }}/{{ SITE }}"
+
+- name: Install required packages
+  ansible.builtin.apt:
+    name:
+      - ghostscript
+      - php
+      - php-mysqli
+      - php-curl
+#      - php-dom
+      - php-exif
+      - php-igbinary
+      - php-mbstring
+      - imagemagick
+      - php-imagick
+      - php-intl
+      - php-openssl
+      - libxml
+      - php-xml
+      - libzip
+      - php-zip
+      - php-redis
+    state: present
+  register: php_install
+
+- name: Enable PHP modules
+  ansible.builtin.command: phpenmod imagick intl
+  when: php_install.changed
+
+
+- name: Recharger PHP et nginx
+  ansible.builtin.service:
+    name: "{{ item }}"
+    state: reloaded
+  loop:
+    - "php{{ php_version }}-fpm"
+    - "nginx"