modif creation dossier common app nextcloud master
authorrominique <romain.legoff@heureux-cyclage.org>
Tue, 18 Jun 2024 13:09:07 +0000 (15:09 +0200)
committerrominique <romain.legoff@heureux-cyclage.org>
Tue, 18 Jun 2024 13:09:07 +0000 (15:09 +0200)
29 files changed:
creation_nouveau_site.yml
tasks/backup_nextcloud.yml
tasks/config_WP.yml
tasks/config_backup.yml
tasks/config_mariadb.yml
tasks/config_nginx.yml
tasks/config_nuage.yml
tasks/config_options_www.yml
tasks/config_paheko.yml
tasks/config_pool_php.yml
tasks/config_postgres.yml
tasks/config_sftp.yml
tasks/config_www.yml
tasks/download_nextcloud_source.yml
tasks/verif_installation_nextcloud.yml
templates/nextcloud_install_config.j2
templates/nextcloud_sigle_config.j2
templates/nginx_WP_server.j2
templates/nginx_http_server.j2
templates/nginx_nuage_server.j2
templates/nginx_paheko_common.j2
templates/nginx_paheko_server.j2
templates/nginx_www_common.j2
templates/nginx_www_server.j2
templates/php_WP_conf.j2
templates/php_gestion_conf.j2
templates/php_paheko_conf.j2
templates/wp-config.php.j2
update_nuage_instance.yml

index c5ca22c..b9029e0 100644 (file)
@@ -1,7 +1,7 @@
 # commande pour lancer le playbook: ansible-playbook creation_nouveau_site.yml
 # attention - Par défaut ce scipt se lancer vers ligatures
 
-# pour ne jouer que la partie permettant de générer le certificat SSL pour le HTTPS lancer la commance ci-dessous:
+# pour ne jouer que la partie permettant de générer le certificat SSL pour le HTTPS lancer la commance ci-dessous (attention il faut recharger nginx manuellement à la fin):
 # ansible-playbook creation_nouveau_site.yml --tags "https"
 
 - name: Promp pour définir les variables du nouveau ite
 
   tasks:
 
-    - name: Inclure la configuration d'un site web basique
-      ansible.builtin.include_tasks: tasks/config_www.yml
-
     - name: Inclure les configurations optionnelles d'un site www
       ansible.builtin.include_tasks: tasks/config_options_www.yml
-      when: SITE != 'nuage'
+      tags: https
+
+    - name: Inclure la configuration d'un site web basique
+      ansible.builtin.include_tasks: tasks/config_www.yml
 
     - name: Inclure la configuration nginx
       ansible.builtin.include_tasks: tasks/config_nginx.yml
       when: config_php == 'oui' or SITE == 'paheko' or SITE == 'WP' or SITE == 'nuage'
 
     - name: Inclure la configuration d'une bdd postgres
-      ansible.builtin.include_tasks: tasks/config_bdd_postgres.yml
+      ansible.builtin.include_tasks: tasks/config_postgres.yml
       when: config_bdd == 'postgres' or SITE == 'nuage'
 
     - name: Inclure la configuration d'une bdd mariadb
-      ansible.builtin.include_tasks: tasks/config_bdd_mariadb.yml
+      ansible.builtin.include_tasks: tasks/config_mariadb.yml
       when: config_bdd == 'mariadb' or SITE == 'WP'
 
     - name: Inclure la configuration nextcloud si besoin
       when: SITE == 'paheko'
 
     - name: Inclure la configuration WP si besoin
-      ansible.builtin.include_tasks: tasks/config_wp.yml
+      ansible.builtin.include_tasks: tasks/config_WP.yml
       when: SITE == 'WP'
 
     - name: Inclure le configuration du backup
 
     - name: Inclure le configuration SFTP
       ansible.builtin.include_tasks: tasks/config_sftp.yml
-      when: sftp_key =! '' and sftp_key =! 'non'
+      when: sftp_key != '' and sftp_key != 'non'
index dd20660..c126cb9 100644 (file)
@@ -8,7 +8,7 @@
 - name: Create a dump of the postgreSQL database # noqa : command-instead-of-module
   become: true
   become_user: "{{ nextcloud_php_user }}"
-  ansible.builtin.command: "pg_dump -f /tmp/{{ nextcloud_db_name }}.pgc -F c -O -b {{ nextcloud_db_name }}"
+  ansible.builtin.command: "pg_dump -f {{ nextcloud_webroot }}/{{ nextcloud_db_name }}.pgc -F c -O -b {{ nextcloud_db_name }}"
   args:
     chdir: "{{ nextcloud_webroot }}"
 
index c328bc0..684d161 100644 (file)
@@ -1,25 +1,24 @@
-
-- name: Create new app common folder from old version one
-  become_user: "site_{{ SIGLE }}_{{ SITE }}"
-  become: true
+- name: Copie des fichiers sources WP dans le home du nouveau site
   ansible.builtin.copy:
-    src: "/home/sites/data/wordpress"
-    dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/"
+    src: "/home/sites/data/wordpress/"
+    dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/"
     remote_src: true # because the copy is from remote host to remote host
     mode: '754' # or 'u=rwx,g=rx,o=r'
+    owner: "php_{{ SIGLE }}_{{ config_ss_domain }}"
+    group: "site_{{ SIGLE }}_{{ config_ss_domain }}"
 
 - name: Créer les fichiers spécifiques wp
   ansible.builtin.template:
     src: "templates/{{ item.src }}"
-    dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/{{ item.dest }}"
+    dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/{{ 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 }}"
+      owner: "php_{{ SIGLE }}_{{ config_ss_domain }}"
+      group: "site_{{ SIGLE }}_{{ config_ss_domain }}"
       mode: '640'
 
 - name: Recharger PHP et nginx
index da885b2..03b2970 100644 (file)
@@ -8,8 +8,8 @@
     backup: true
   register: presence_sigle
   loop:
-    - "    - /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/config"
-    - "    - /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/data"
+    - "    - /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/config"
+    - "    - /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/data"
   when: SITE == 'nuage'
 
 - name: Mise à jour de la conf de borgmatic pour le backup d'un site non nuage
@@ -22,5 +22,5 @@
     backup: true
   register: presence_sigle
   loop:
-    - "    - /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
+    - "    - /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}"
   when: SITE != 'nuage'
index 3816d0c..c2efe44 100644 (file)
@@ -1,22 +1,31 @@
+- name: Etckeeper commit if necessary
+  ansible.builtin.command: etckeeper commit "commit by ansible because installing {{ DOMAIN }}/{{ config_ss_domain }}"
+  ignore_errors: true
+
+- name: Install ansible mysql required packages
+  ansible.builtin.apt:
+    name:
+      - python3-pymysql
+
 - name: Boucle d'ajout du user php dans plusieurs groupe
   ansible.builtin.user:
-    name: "php_{{ SIGLE }}_{{ SITE }}"
+    name: "php_{{ SIGLE }}_{{ config_ss_domain }}"
     groups: "{{ item }}"
     append: true
   loop:
     - mysql
-    - "site_{{ SIGLE }}_{{ SITE }}"
+    - "site_{{ SIGLE }}_{{ config_ss_domain }}"
 
 - name: Création de la nouvelle bdd Mariadb
   community.mysql.mysql_db:
-    name: "php_{{ SIGLE }}_{{ SITE }}"
+    name: "php_{{ SIGLE }}_{{ config_ss_domain }}"
     state: present
     login_unix_socket: /run/mysqld/mysqld.sock
     encoding: utf8mb4  # pour WP
 
 - name: Créer le user mysql
-  mysql_user:
-    name: "php_{{ SIGLE }}_{{ SITE }}"
-    priv: "php_{{ SIGLE }}_{{ SITE }}.*:ALL"
+  community.mysql.mysql_user:
+    name: "php_{{ SIGLE }}_{{ config_ss_domain }}"
+    priv: "php_{{ SIGLE }}_{{ config_ss_domain }}.*:ALL"
     state: present
-    login_unix_socket: /run/mysqld/mysqld.sock
\ No newline at end of file
+    login_unix_socket: /run/mysqld/mysqld.sock
index f932ac8..3f74047 100644 (file)
@@ -8,7 +8,7 @@
   loop_control:
     label: "{{ item.path }}"
   loop:
-    - path: "/etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
+    - path: "/etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}"
       state: directory
       owner: 'root'
       group: 'root'
@@ -18,7 +18,7 @@
       owner: 'log_sites'
       group: 'log_sites'
       mode: '755'
-    - path: "/home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
+    - path: "/home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}"
       state: directory
       owner: 'log_sites'
       group: 'log_sites'
@@ -27,7 +27,7 @@
 - name: Création de la conf server nginx
   ansible.builtin.template:
     src: "templates/nginx_{{ template_site }}_server.j2"
-    dest: "/etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/server.conf"
+    dest: "/etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/server.conf"
     owner: "root"
     group: "root"
     mode: '640' # or u=rwx,g=r,o=
 - name: Création de la conf common nginx
   ansible.builtin.template:
     src: "templates/nginx_{{ template_site }}_common.j2"
-    dest: "/etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/common.conf"
+    dest: "/etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/common.conf"
     owner: "root"
     group: "root"
     mode: '640' # or u=rwx,g=r,o=
-  when: SITE != 'nuage' and template_site != 'http'
+  when: SITE != 'nuage' and template_site != 'http' and SITE != 'WP'
 
 - name: Recharger le service nginx
   ansible.builtin.service:
index f0678ec..ffb8ab7 100644 (file)
@@ -1,5 +1,5 @@
 - name: Etckeeper commit if necessary
-  ansible.builtin.command: etckeeper commit "commit by ansible because installing {{ DOMAIN }}/{{ SITE }}"
+  ansible.builtin.command: etckeeper commit "commit by ansible because installing {{ DOMAIN }}/{{ config_ss_domain }}"
   ignore_errors: true
 
 - name: Install required packages
 
 - name: Boucle d'ajout du user php dans plusieurs groupe
   ansible.builtin.user:
-    name: "php_{{ SIGLE }}_{{ SITE }}"
+    name: "php_{{ SIGLE }}_{{ config_ss_domain }}"
     groups: "{{ item }}"
     append: true
   loop:
     - nextcloud
     - postgres-data
     - redis
-    - "site_{{ SIGLE }}_{{ SITE }}"
+    - "site_{{ SIGLE }}_{{ config_ss_domain }}"
 
 - name: Bloc nouvelle version nextcloud
   when: nouvelle_version is undefined
   community.postgresql.postgresql_pg_hba:
     dest: "/etc/postgresql/{{ postgres_version }}/main/pg_hba.conf"
     contype: local
-    users: "php_{{ SIGLE }}_{{ SITE }}"
-    databases: "php_{{ SIGLE }}_{{ SITE }}"
+    users: "php_{{ SIGLE }}_{{ config_ss_domain }}"
+    databases: "php_{{ SIGLE }}_{{ config_ss_domain }}"
     method: peer
     keep_comments_at_rules: true
-    comment: "autoriser le user php_{{ SIGLE }}_{{ SITE }} à se connecter à la bdd du meme nom"
+    comment: "autoriser le user php_{{ SIGLE }}_{{ config_ss_domain }} à se connecter à la bdd du meme nom"
 
 - name: Boucle création des répertoires app, config et data nextcloud
   ansible.builtin.file:
   ansible.builtin.command: >
           ./console maintenance:install
           --database='pgsql'
-          --database-name="php_{{ SIGLE }}_{{ SITE }}"
-          --database-user="php_{{ SIGLE }}_{{ SITE }}"
+          --database-name="php_{{ SIGLE }}_{{ config_ss_domain }}"
+          --database-user="php_{{ SIGLE }}_{{ config_ss_domain }}"
           --database-host="/var/run/postgresql/"
           --database-pass=""
           --admin-user='admin'
           --admin-pass='ckoideja'
-          --data-dir="/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/data/"
+          --data-dir="/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/data/"
   args:
     chdir: "{{ nextcloud_webroot }}"
   register: install_result
 
 - name: Creation d'un fichier cron pour /etc/cron.d
   ansible.builtin.cron:
-    name: "nextcloud {{ SIGLE }}_{{ SITE }} taches d'arriere plan toutes les 5 mins"
+    name: "nextcloud {{ SIGLE }}_{{ config_ss_domain }} taches d'arriere plan toutes les 5 mins"
     minute: "*/5"
-    user: "php_{{ SIGLE }}_{{ SITE }}"
+    user: "php_{{ SIGLE }}_{{ config_ss_domain }}"
     job: "{{ nextcloud_webroot }}/cron"
 
 - name: Recharger plusieurs services
index b55a387..93fdb51 100644 (file)
@@ -1,4 +1,5 @@
 - name: Bloc demande sous-domaine
+  tags: https
   block:
 
     - name: Demande sous-domaine
@@ -12,7 +13,7 @@
         config_ss_domain: "{{ config_ss_domain_promp.user_input | default(SITE) }}"
 
 - name: Bloc demande des autres options
-  when: SITE != 'paheko' # and SITE != 'WP'
+  when: SITE != 'paheko' or SITE != 'nuage' # and SITE != 'WP'
   block:
 
     - name: Demande php
index 2c5748d..efc748b 100644 (file)
@@ -1,5 +1,5 @@
 - name: Etckeeper commit if necessary
-  ansible.builtin.command: etckeeper commit "commit by ansible because installing {{ DOMAIN }}/{{ SITE }}"
+  ansible.builtin.command: etckeeper commit "commit by ansible because installing {{ DOMAIN }}/{{ config_ss_domain }}"
 
 - name: Install required packages
   ansible.builtin.apt:
 
 - name: Copie la source paheko vers le home du site
   become: true
-#  become_user: "php_{{ SIGLE }}_{{ SITE }}"
+#  become_user: "php_{{ SIGLE }}_{{ config_ss_domain }}"
   ansible.builtin.copy:
     src: "/home/sites/data/paheko/{{ paheko_version }}/"
-    dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
+    dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}"
     remote_src: true # because the config file is already in the nextcloud_tmp_path
     mode: '2750'
 
 - name: Modification du propriétaire group et droits du dossier
   ansible.builtin.file:
-    path: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/"
+    path: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/"
     state: directory
-    owner: "php_{{ SIGLE }}_{{ SITE }}"
-    group: "site_{{ SIGLE }}_{{ SITE }}"
+    owner: "php_{{ SIGLE }}_{{ config_ss_domain }}"
+    group: "site_{{ SIGLE }}_{{ config_ss_domain }}"
     mode: '2750'
     recurse: true
 
index 970a039..23173eb 100644 (file)
@@ -1,17 +1,17 @@
 - name: Ajout de l'utilisateur php_SIGLE_SITE
   ansible.builtin.user:
-    name: "php_{{ SIGLE }}_{{ SITE }}"
-    home: "/etc/php/{{ php_version }}/fpm/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
+    name: "php_{{ SIGLE }}_{{ config_ss_domain }}"
+    home: "/etc/php/{{ php_version }}/fpm/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}"
     shell: /bin/false
     system: true
     append: true
     create_home: false
     password: '!'
-#    group: "php_{{ SIGLE }}_{{ SITE }}"
+#    group: "php_{{ SIGLE }}_{{ config_ss_domain }}"
 
 - name: Boucle d'ajout du user php dans plusieurs groupe
   ansible.builtin.user:
-    name: "php_{{ SIGLE }}_{{ SITE }}"
+    name: "php_{{ SIGLE }}_{{ config_ss_domain }}"
     groups: "{{ item }}"
     append: true
   loop:
       mode: '1751'
     - path: "/home/sites/log/php/fpm/{{ TLD }}/{{ DOMAIN }}"
       state: directory
-      owner: "php_{{ SIGLE }}_{{ SITE }}"
-      group: "php_{{ SIGLE }}_{{ SITE }}"
+      owner: "php_{{ SIGLE }}_{{ config_ss_domain }}"
+      group: "php_{{ SIGLE }}_{{ config_ss_domain }}"
       mode: '1751'
-    - path: "/home/sites/log/php/fpm/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
+    - path: "/home/sites/log/php/fpm/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}"
       state: directory
-      owner: "php_{{ SIGLE }}_{{ SITE }}"
-      group: "php_{{ SIGLE }}_{{ SITE }}"
+      owner: "php_{{ SIGLE }}_{{ config_ss_domain }}"
+      group: "php_{{ SIGLE }}_{{ config_ss_domain }}"
       mode: '750'
 
 - name: Boucle création ou modifications des répertoires config d'un pool php
@@ -53,7 +53,7 @@
   loop_control:
     label: "{{ item.path }}"
   loop:
-    - path: "/etc/php/{{ php_version }}/fpm/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
+    - path: "/etc/php/{{ php_version }}/fpm/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}"
       state: directory # If directory, all intermediate subdirectories will be created if they do not exist.
       owner: 'root'
       group: 'root'
@@ -67,7 +67,7 @@
 - name: Création de la conf du pool php
   ansible.builtin.template:
     src: "templates/php_{{ SITE }}_conf.j2"
-    dest: "/etc/php/{{ php_version }}/fpm/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/php-fpm.conf"
+    dest: "/etc/php/{{ php_version }}/fpm/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/php-fpm.conf"
     owner: "root"
     group: "root"
     mode: '640' # or u=rwx,g=r,o=
@@ -76,4 +76,4 @@
 - name: ATTENTION la config php n'a pas été créer
   ansible.builtin.debug:
     msg: "Il n'y a pas de templates php pour votre site, il faudra le créer manuellement"
-  when: SITE != 'nuage' and SITE != 'paheko' or SITE != 'WP'
+  when: SITE != 'nuage' and SITE != 'paheko' and SITE != 'WP'
index 06652ce..fe6a511 100644 (file)
@@ -1,5 +1,5 @@
 - name: Etckeeper commit if necessary
-  ansible.builtin.command: etckeeper commit "commit by ansible because installing {{ DOMAIN }}/{{ SITE }}"
+  ansible.builtin.command: etckeeper commit "commit by ansible because installing {{ DOMAIN }}/{{ config_ss_domain }}"
   ignore_errors: true
 
 - name: Install required packages
 
 - name: Boucle d'ajout du user php dans plusieurs groupe
   ansible.builtin.user:
-    name: "php_{{ SIGLE }}_{{ SITE }}"
+    name: "php_{{ SIGLE }}_{{ config_ss_domain }}"
     groups: "{{ item }}"
     append: true
   loop:
     - nextcloud
     - postgres-data
     - redis
-    - "site_{{ SIGLE }}_{{ SITE }}"
+    - "site_{{ SIGLE }}_{{ config_ss_domain }}"
 
 - name: Bloc nouvelle version nextcloud
   when: nouvelle_version is undefined
   community.postgresql.postgresql_pg_hba:
     dest: "/etc/postgresql/{{ postgres_version }}/main/pg_hba.conf"
     contype: local
-    users: "php_{{ SIGLE }}_{{ SITE }}"
-    databases: "php_{{ SIGLE }}_{{ SITE }}"
+    users: "php_{{ SIGLE }}_{{ config_ss_domain }}"
+    databases: "php_{{ SIGLE }}_{{ config_ss_domain }}"
     method: peer
     keep_comments_at_rules: true
-    comment: "autoriser le user php_{{ SIGLE }}_{{ SITE }} à se connecter à la bdd du meme nom"
+    comment: "autoriser le user php_{{ SIGLE }}_{{ config_ss_domain }} à se connecter à la bdd du meme nom"
 
 - name: Boucle création des répertoires app, config et data nextcloud
   ansible.builtin.file:
   ansible.builtin.command: >
           ./console maintenance:install
           --database='pgsql'
-          --database-name="php_{{ SIGLE }}_{{ SITE }}"
-          --database-user="php_{{ SIGLE }}_{{ SITE }}"
+          --database-name="php_{{ SIGLE }}_{{ config_ss_domain }}"
+          --database-user="php_{{ SIGLE }}_{{ config_ss_domain }}"
           --database-host="/var/run/postgresql/"
           --database-pass=""
           --admin-user='admin'
           --admin-pass='ckoideja'
-          --data-dir="/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/data/"
+          --data-dir="/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/data/"
   args:
     chdir: "{{ nextcloud_webroot }}"
   register: install_result
 
 - name: Creation d'un fichier cron pour /etc/cron.d
   ansible.builtin.cron:
-    name: "nextcloud {{ SIGLE }}_{{ SITE }} taches d'arriere plan toutes les 5 mins"
+    name: "nextcloud {{ SIGLE }}_{{ config_ss_domain }} taches d'arriere plan toutes les 5 mins"
     minute: "*/5"
-    user: "php_{{ SIGLE }}_{{ SITE }}"
+    user: "php_{{ SIGLE }}_{{ config_ss_domain }}"
     job: "{{ nextcloud_webroot }}/cron"
 
 - name: Recharger plusieurs services
index 2b8c446..ea023c0 100644 (file)
@@ -1,6 +1,6 @@
 - name: Ajout de l'utilisateur site_SIGLE_SITE dans le group sftponly et modification du home
   ansible.builtin.user:
-    name: "site_{{ SIGLE }}_{{ SITE }}"
+    name: "site_{{ SIGLE }}_{{ config_ss_domain }}"
     home: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}"
     shell: /bin/false
     groups: sftponly
       mode: '2751'
     - path: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/.ssh"
       state: directory
-      owner: "site_{{ SIGLE }}_{{ SITE }}"
-      group: "site_{{ SIGLE }}_{{ SITE }}"
+      owner: "site_{{ SIGLE }}_{{ config_ss_domain }}"
+      group: "site_{{ SIGLE }}_{{ config_ss_domain }}"
       mode: '2700'
 
 - name: Création du fichier authorized_keys
   ansible.builtin.template:
     src: "templates/authorized_keys.j2"
     dest: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/.ssh/authorized_keys"
-    owner: "site_{{ SIGLE }}_{{ SITE }}"
-    group: "site_{{ SIGLE }}_{{ SITE }}"
+    owner: "site_{{ SIGLE }}_{{ config_ss_domain }}"
+    group: "site_{{ SIGLE }}_{{ config_ss_domain }}"
     mode: '600'
 
 # verif le serveur openssh est bien config et sinon le faire? + reload
index d01c9bf..b5ac3f4 100644 (file)
@@ -1,7 +1,7 @@
 - name: Ajout de l'utilisateur site_SIGLE_SITE
   ansible.builtin.user:
-    name: "site_{{ SIGLE }}_{{ SITE }}"
-    home: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
+    name: "site_{{ SIGLE }}_{{ config_ss_domain }}"
+    home: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}"
     shell: /bin/false
     groups: www-data
     system: true
@@ -12,7 +12,7 @@
 - name: Boucle d'ajout d'user dans le groupe site_SIGLE_SITE
   ansible.builtin.user:
     name: "{{ item }}"
-    groups: "site_{{ SIGLE }}_{{ SITE }}"
+    groups: "site_{{ SIGLE }}_{{ config_ss_domain }}"
     append: true
   loop:
     - 'www-data'
@@ -25,6 +25,8 @@
     owner: "{{ item.owner }}"
     group: "{{ item.group }}"
     mode: "{{ item.mode }}"
+  vars:
+    concat: "site_{{ SIGLE }}_{{ config_ss_domain }}"
   loop_control:
     label: "{{ item.path }}"
   loop:
@@ -38,8 +40,8 @@
       owner: 'root'
       group: 'www-data'
       mode: '2751'
-    - path: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
+    - path: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}"
       state: directory
-      owner: 'root'
-      group: "site_{{ SIGLE }}_{{ SITE }}"
+      owner: "{{ ( SITE in ['www','WP'] ) | ternary ( concat , 'root' ) }}"
+      group: "site_{{ SIGLE }}_{{ config_ss_domain }}"
       mode: '2750'
index 77a46c6..4c79f2b 100644 (file)
@@ -7,10 +7,10 @@
     mode: '755' # or u=rwx,g=rx,o=rx
     checksum: "md5:{{ nextcloud_repo_url }}/nextcloud-{{ nouvelle_version }}.tar.bz2.md5"
 
-- name: create nextcloud source dir 
+- name: Create nextcloud source dir
   become: true
   become_user: nextcloud
-  ansible.builtin.file: 
+  ansible.builtin.file:
     path: "{{ nextcloud_sources_files_path }}/nextcloud-{{ nouvelle_version }}"
     state: directory
     mode: '755' # or u=rwx,g=rx,o=rx
     src: "{{ nextcloud_sources_files_path }}/nextcloud-{{ nouvelle_version }}.tar.bz2"
     dest: "{{ nextcloud_sources_files_path }}/"
 #    mode: '755' # or u=rwx,g=rx,o=rx
-    remote_src: yes
+    remote_src: true
 
-- name: "rename nextloud dir to nextcloud-{{ nouvelle_version }}"
+- name: Rename nextloud dir to nextcloud-nouvelle_version
   become: true
   become_user: nextcloud
-  ansible.builtin.copy: 
+  ansible.builtin.copy:
     src: "{{ nextcloud_sources_files_path }}/nextcloud/"
     dest: "{{ nextcloud_sources_files_path }}/nextcloud-{{ nouvelle_version }}"
-    remote_src: yes # because the config file is already in the nextcloud_tmp_path
+    remote_src: true # because the config file is already in the nextcloud_tmp_path
 
-- name: deleted downloaded nextcloud files
+- name: Deleted downloaded nextcloud files
   become: true
   become_user: nextcloud
   ansible.builtin.file:
@@ -40,4 +40,4 @@
     state: absent
   loop:
     - "{{ nextcloud_sources_files_path }}/nextcloud-{{ nouvelle_version }}.tar.bz2"
-    - "{{ nextcloud_sources_files_path }}/nextcloud"
\ No newline at end of file
+    - "{{ nextcloud_sources_files_path }}/nextcloud"
index bb679e4..508c5fd 100644 (file)
@@ -25,4 +25,4 @@
     dest: "{{ nextcloud_common_files_path }}/nextcloud-{{ nouvelle_version }}"
     remote_src: true # because the copy is from remote host to remote host
     mode: '754' # or 'u=rwx,g=rx,o=r'
-  when: not new_nextcloud_common.stat.exists
\ No newline at end of file
+  when: not new_nextcloud_common.stat.exists
index 40dcc52..06e3555 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-$SITE = '{{ SITE }}';
+$SITE = '{{ config_ss_domain }}';
 $DOMAIN = '{{ DOMAIN }}';
 $TLD = '{{ TLD }}';
 $SIGLE = '{{ SIGLE }}';
index 1554b62..258f247 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-$SITE = '{{ SITE }}';
+$SITE = '{{ config_ss_domain }}';
 $DOMAIN = '{{ DOMAIN }}';
 $TLD = '{{ TLD }}';
 $SIGLE = '{{ SIGLE }}';
index a501e6d..0589c9a 100644 (file)
@@ -1,21 +1,21 @@
 server {
        listen 80;
        server_name {{ DOMAIN }}.{{ TLD }} {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
-       root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/;
-       access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
-       error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
+       root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/;
+       access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log main buffer=32k;
+       error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/error.log warn;
 {% if ssl_ready is defined and ssl_ready %}
     return 301 https://$server_name$request_uri;
  }
 server {
        listen 443;
-    ssl_certificate /etc/letsencrypt/live/{{ SITE }}.{{ DOMAIN }}.{{ TLD }}/fullchain.pem;
-    ssl_certificate_key /etc/letsencrypt/live/{{ SITE }}.{{ DOMAIN }}.{{ TLD }}/privkey.pem;
-    access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
-    error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
+    ssl_certificate /etc/letsencrypt/live/{{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }}/fullchain.pem;
+    ssl_certificate_key /etc/letsencrypt/live/{{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }}/privkey.pem;
+    access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log main buffer=32k;
+    error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/error.log warn;
+    root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/;
+    server_name {{ DOMAIN }}.{{ TLD }} {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
 {% endif %}
-       server_name {{ DOMAIN }}.{{ TLD }} {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
-       root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/;
        index  index.php index.html index.htm;
     client_max_body_size 500M;
     location / {
@@ -36,7 +36,7 @@ server {
     }
     location ~ \.php$ {
          include snippets/fastcgi-php.conf;
-         fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
+         fastcgi_pass unix:/run/php{{ php_version }}/fpm/php_{{ SIGLE }}_{{ config_ss_domain }};
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          include fastcgi_params;
     }
index 67c6aaf..3a39aa5 100644 (file)
@@ -2,7 +2,7 @@ server {
        listen 80;
        server_name {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
        disable_symlinks if_not_owner;
-       access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
-       error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
+       access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log main buffer=32k;
+       error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/error.log warn;
        root /home/sites/data/{{TLD }}/{{ DOMAIN }}/{{SITE }}/;
 }
\ No newline at end of file
index e22bfc8..f25b86f 100644 (file)
@@ -5,7 +5,7 @@ map $arg_v $asset_immutable {
 }
 server {
        listen 80;
-       server_name {{ SITE }}.{{ DOMAIN }}.{{ TLD }};
+       server_name {{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }};
        #disable_symlinks if_not_owner;
 {% if ssl_ready is defined and ssl_ready %}
 
@@ -15,23 +15,23 @@ server {
        # Enforce HTTPS
        return 301 https://$server_name$request_uri;
 
-       access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
-       error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
+       access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log main buffer=32k;
+       error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/error.log warn;
 
 }
 server {
        listen 443 ssl http2;
-       server_name {{ SITE }}.{{ DOMAIN }}.{{ TLD }};
+       server_name {{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }};
 
        # Path to the root of your installation
-       root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/nextcloud;
+       root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/nextcloud;
 
        disable_symlinks if_not_owner;
-       ssl_certificate /etc/letsencrypt/live/{{ SITE }}.{{ DOMAIN }}.{{ TLD }}/fullchain.pem;
-       ssl_certificate_key /etc/letsencrypt/live/{{ SITE }}.{{ DOMAIN }}.{{ TLD }}/privkey.pem;
+       ssl_certificate /etc/letsencrypt/live/{{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }}/fullchain.pem;
+       ssl_certificate_key /etc/letsencrypt/live/{{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }}/privkey.pem;
 {% endif %}
-       access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
-       error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
+       access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log main buffer=32k;
+       error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/error.log warn;
 
        # Prevent nginx HTTP Server Detection
        server_tokens off;
@@ -88,11 +88,11 @@ server {
        }
 
        location ~ /common-apps/(.*)$ {
-         alias /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/common/$1;
+         alias /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/common/$1;
        }
 
        location ~ /instance-apps/(.*)$ {
-         alias /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/apps/$1;
+         alias /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/apps/$1;
        }
 
        # Specify how to handle directories -- specifying `/index.php$request_uri`
@@ -165,8 +165,8 @@ server {
          fastcgi_param modHeadersAvailable true;         # Avoid sending the security headers twice
          fastcgi_param front_controller_active true;     # Enable pretty urls
          
-         fastcgi_param NEXTCLOUD_CONFIG_DIR /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/config;
-         fastcgi_pass unix:/run/php{{ php_version }}/fpm/php_{{ SIGLE }}_{{ SITE }};
+         fastcgi_param NEXTCLOUD_CONFIG_DIR /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/config;
+         fastcgi_pass unix:/run/php{{ php_version }}/fpm/php_{{ SIGLE }}_{{ config_ss_domain }};
        
          #fastcgi_intercept_errors on;
          fastcgi_request_buffering off;
index f4ae705..acaa505 100644 (file)
@@ -1,5 +1,5 @@
 server_name {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
-root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/www;
+root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/www;
 
 location / {
        try_files $uri $uri/ /_route.php?$query_string;
@@ -12,5 +12,5 @@ location ~ \.php {
        fastcgi_index  index.php ;
        fastcgi_param REDIRECT_STATUS 200;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
-    fastcgi_pass unix:/run/php{{ php_version}}/fpm/php_{{ SIGLE }}_{{ SITE }};
+    fastcgi_pass unix:/run/php{{ php_version}}/fpm/php_{{ SIGLE }}_{{ config_ss_domain }};
 }
\ No newline at end of file
index 8f42629..1facc46 100644 (file)
@@ -1,17 +1,17 @@
 server {
        listen 80;
-       include /etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/common.conf;
-       access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
-       error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
+       include /etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/common.conf;
+       access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log main buffer=32k;
+       error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/error.log warn;
 {% if ssl_ready is defined and ssl_ready %}
     return 301 https://$server_name$request_uri;
  }
 server {
        listen 443;
-       include /etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/common.conf;
-    ssl_certificate /etc/letsencrypt/live/{{ SITE }}.{{ DOMAIN }}.{{ TLD }}/fullchain.pem;
-    ssl_certificate_key /etc/letsencrypt/live/{{ SITE }}.{{ DOMAIN }}.{{ TLD }}/privkey.pem;
-    access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
-    error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
+       include /etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/common.conf;
+    ssl_certificate /etc/letsencrypt/live/{{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }}/fullchain.pem;
+    ssl_certificate_key /etc/letsencrypt/live/{{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }}/privkey.pem;
+    access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log main buffer=32k;
+    error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/error.log warn;
 {% endif %}
 }
\ No newline at end of file
index 831a739..0c424a8 100644 (file)
@@ -1,6 +1,6 @@
 server_name {{ DOMAIN }}.{{ TLD }} {{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }};
 {# semble ne pas être nécessaire rewrite ^/(.*) http://{{ config_ss_domain | default(SITE) }}.{{ DOMAIN }}.{{ TLD }}/$1 permanent;        #}
-root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/;
+root /home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/;
 index index.html;
 
 client_body_buffer_size 8k;
index fd9ba1f..c4ba553 100644 (file)
@@ -1,17 +1,17 @@
 server {
     listen 80;
-    include /etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/common.conf;
-    access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
-    error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
+    include /etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/common.conf;
+    access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log main buffer=32k;
+    error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/error.log warn;
 {% if ssl_ready is defined and ssl_ready %}
     return 301 https://$server_name$request_uri;
 }
 server {
     listen 443 ssl;
-    include /etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/common.conf;
-    ssl_certificate /etc/letsencrypt/live/{{ SITE }}.{{ DOMAIN }}.{{ TLD }}/fullchain.pem;
-    ssl_certificate_key /etc/letsencrypt/live/{{ SITE }}.{{ DOMAIN }}.{{ TLD }}/privkey.pem;
-    access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log main buffer=32k;
-    error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/error.log warn;
+    include /etc/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/common.conf;
+    ssl_certificate /etc/letsencrypt/live/{{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }}/fullchain.pem;
+    ssl_certificate_key /etc/letsencrypt/live/{{ config_ss_domain }}.{{ DOMAIN }}.{{ TLD }}/privkey.pem;
+    access_log /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log main buffer=32k;
+    error_log  /home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/error.log warn;
 {% endif %}
 }
\ No newline at end of file
index 321bd91..91e3ffe 100644 (file)
@@ -1,8 +1,8 @@
-[{{ TLD }}/{{ DOMAIN }}/{{ SITE }}]
-user = php_{{ SIGLE }}_{{ SITE }}
-group = php_{{ SIGLE }}_{{ SITE }}
+[{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}]
+user = php_{{ SIGLE }}_{{ config_ss_domain }}
+group = php_{{ SIGLE }}_{{ config_ss_domain }}
 
-listen = /run/php{{ php_version }}/fpm/php_{{ SIGLE }}_{{ SITE }}
+listen = /run/php{{ php_version }}/fpm/php_{{ SIGLE }}_{{ config_ss_domain }}
 
 listen.group = www-data
 
@@ -12,4 +12,4 @@ pm.max_children = 10
 pm.process_idle_timeout = 60s
 pm.max_requests = 500
 
-access.log = /home/sites/log/php/fpm/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log
\ No newline at end of file
+access.log = /home/sites/log/php/fpm/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log
\ No newline at end of file
index e65b214..a1fb817 100644 (file)
@@ -1,8 +1,8 @@
-[{{ TLD }}/{{ DOMAIN }}/{{ SITE }}]
-user = php_{{ SIGLE }}_{{ SITE }}
-group = php_{{ SIGLE }}_{{ SITE }}
+[{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}]
+user = php_{{ SIGLE }}_{{ config_ss_domain }}
+group = php_{{ SIGLE }}_{{ config_ss_domain }}
 
-listen = /run/php{{ php_version }}/fpm/php_{{ SIGLE }}_{{ SITE }}
+listen = /run/php{{ php_version }}/fpm/php_{{ SIGLE }}_{{ config_ss_domain }}
 
 listen.group = www-data
 
@@ -12,4 +12,4 @@ pm.start_servers = 2
 pm.min_spare_servers = 1
 pm.max_spare_servers = 3
 
-access.log = /home/sites/log/php/fpm/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log
\ No newline at end of file
+access.log = /home/sites/log/php/fpm/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log
\ No newline at end of file
index e65b214..a1fb817 100644 (file)
@@ -1,8 +1,8 @@
-[{{ TLD }}/{{ DOMAIN }}/{{ SITE }}]
-user = php_{{ SIGLE }}_{{ SITE }}
-group = php_{{ SIGLE }}_{{ SITE }}
+[{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}]
+user = php_{{ SIGLE }}_{{ config_ss_domain }}
+group = php_{{ SIGLE }}_{{ config_ss_domain }}
 
-listen = /run/php{{ php_version }}/fpm/php_{{ SIGLE }}_{{ SITE }}
+listen = /run/php{{ php_version }}/fpm/php_{{ SIGLE }}_{{ config_ss_domain }}
 
 listen.group = www-data
 
@@ -12,4 +12,4 @@ pm.start_servers = 2
 pm.min_spare_servers = 1
 pm.max_spare_servers = 3
 
-access.log = /home/sites/log/php/fpm/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/access.log
\ No newline at end of file
+access.log = /home/sites/log/php/fpm/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/access.log
\ No newline at end of file
index c541557..22ab49f 100644 (file)
 // ** MySQL settings - You can get this info from your web host ** //
 /** The name of the database for WordPress */
 define('WP_CACHE', true);
-define('WPCACHEHOME', '/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}/wp-content/plugins/wp-super-cache/' );
-define('DB_NAME', 'php_{{ SIGLE }}_{{ SITE }}');
+define('WPCACHEHOME', '/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ config_ss_domain }}/wp-content/plugins/wp-super-cache/' );
+define('DB_NAME', 'php_{{ SIGLE }}_{{ config_ss_domain }}');
 
 /** MySQL database username */
-define('DB_USER', 'php_{{ SIGLE }}_{{ SITE }}');
+define('DB_USER', 'php_{{ SIGLE }}_{{ config_ss_domain }}');
 
 /** MySQL database password */
 define('DB_PASSWORD', '');
index 3f8fa94..eeed883 100644 (file)
@@ -10,7 +10,7 @@
     - name: nouvelle_version
       prompt: 'Nouvelle version nextcloud à télécharger?(ex: 27.1.8)'
       private: false
-      default: "27.1.8"
+      default: "28.0.6"
 
     - name: TLD
       prompt: 'TLD du site à mettre à jour?(ex: org)'
         ansible_become: true
         become_user: nextcloud
 
-    - name: Create new app common folder from old version one
-      become_user: nextcloud
+    - name: Création du dossier common de la nouvelle version en utilisant les apps de l'instance test-nuage
       become: true
       ansible.builtin.copy:
-        src: "{{ nextcloud_common_files_path }}/nextcloud-{{ ancienne_version }}/"
-        dest: "{{ nextcloud_common_files_path }}/nextcloud-{{ nouvelle_version }}"
+        src: "/home/site/home/sites/data/org/heureux-cyclage/test-nuage/apps/*"
+        dest: "{{ nextcloud_common_files_path }}/nextcloud-{{ nouvelle_version }}/"
         remote_src: true # because the copy is from remote host to remote host
         mode: '754' # or 'u=rwx,g=rx,o=r'
-      when: not new_nextcloud_common.stat.exists
+        owner: nextcloud
+        group: nextcloud
 
     - name: Include backup tasks
       ansible.builtin.include_tasks: tasks/backup_nextcloud.yml