Parcourir la source

Correction droits et ajouts modules PHP

Benoît Hubert il y a 1 an
Parent
commit
f7475a9b5c

+ 1 - 0
lemp--legacy/README-todo.md

@@ -72,6 +72,7 @@ Mis en commentaire le bloc vars
 
 ```
 ansible-playbook -i ../ansible-initial-debian-setup/inventory.ini playbooks/install_php_mysql_debian.yml -bkK --limit debian-112 -e @vars-debian-112.yml
+ansible-playbook -i ../ansible-initial-debian-setup/inventory.ini playbooks/install_php_mysql_debian.yml -bkK --limit debian-113 -e @vars-debian-113.yml
 ```
 
 **Désinstaller tout**

+ 20 - 11
lemp-wordpress/playbooks/install_php_mysql_debian.yml

@@ -15,11 +15,16 @@
         name:
           - php8.2
           - php8.2-fpm
-          - php8.2-iconv # for WordPress
-          - php8.2-mysqli # for WordPress/MySQL
           - php8.2-phar # for wp-cli
           - php8.2-curl # for wp-cli
-          - php8.2-gd # WordPress needs this in order to generate thumbnails
+          - php8.2-mysqli # for WordPress/MySQL
+          - php8.2-iconv # for WordPress
+          - php8.2-gd # for WordPress
+          - php8.2-imagick
+          - php8.2-intl
+          - php8.2-mbstring
+          - php8.2-zip
+          - php8.2-dom
         state: present
 
     - name: Install curl
@@ -50,9 +55,13 @@
       when: wordpress_dir.stat.exists == False
 
     # Unzip WordPress only if /var/www/wordpress doesn't exist
-    - name: Unzip WordPress
-      # ansible.builtin.unarchive:
-      command: tar -xzf /tmp/wordpress.tar.gz -C /var/www
+    - name: Installer WordPress
+      ansible.builtin.unarchive:
+        src: /tmp/wordpress.tar.gz
+        dest: /var/www
+        remote_src: yes
+        owner: www-data
+        group: www-data
       when: wordpress_dir.stat.exists == False
 
     - name: Install MariaDB Server & Client
@@ -113,9 +122,9 @@
       ansible.builtin.template:
         src: templates/wp-config-sample.php.j2
         dest: /var/www/wordpress/wp-config.php
-        owner: root
-        group: root
-        mode: 0644
+        owner: www-data
+        group: www-data
+        mode: '0440'
       when: wp_config.stat.exists == False
 
     # Overwrite default vhost config with our own
@@ -170,13 +179,13 @@
 
     # Check if WordPress is installed
     - name: Check if WordPress is installed
-      command: sudo -u debian wp core is-installed --path=/var/www/wordpress
+      command: sudo -u www-data wp core is-installed --path=/var/www/wordpress
       register: wp_installed
       ignore_errors: yes
 
     # WP core install (cwd: /var/www/wordpress)
     - name: Install WordPress
-      command: sudo -u debian wp core install --url={{ site_url }} --title=My\ Blog --admin_user=admin --admin_password=admin --admin_email=benoithubert@gmail.com
+      command: sudo -u www-data wp core install --url={{ site_url }} --title=My\ Blog --admin_user=admin --admin_password=admin --admin_email=benoithubert@gmail.com
       # WP-CLI complains if we run it as root, so we become a regular user
       become: no
       # Shou