ajout support SITE WP
[lhc/ansible.git] / tasks / config_WP.yml
index cee9b66..c328bc0 100644 (file)
@@ -1,33 +1,26 @@
-- 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: Create new app common folder from old version one
+  become_user: "site_{{ SIGLE }}_{{ SITE }}"
+  become: true
+  ansible.builtin.copy:
+    src: "/home/sites/data/wordpress"
+    dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/"
+    remote_src: true # because the copy is from remote host to remote host
+    mode: '754' # or 'u=rwx,g=rx,o=r'
 
+- name: Créer les fichiers spécifiques wp
+  ansible.builtin.template:
+    src: "templates/{{ item.src }}"
+    dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/{{ item.dest }}"
+    owner: "{{ item.owner }}"
+    group: "{{ item.group }}"
+    mode: "{{ item.mode }}"
+  loop:
+    - src: "wp-config.php.j2"
+      dest: "wp-config.php"
+      owner: "php_{{ SIGLE }}_{{ SITE }}"
+      group: "site_{{ SIGLE }}_{{ SITE }}"
+      mode: '640'
 
 - name: Recharger PHP et nginx
   ansible.builtin.service: