correction syntaxe
[lhc/ansible.git] / tasks / config_www.yml
index 06af483..c1a4b20 100644 (file)
@@ -1,7 +1,7 @@
 - name: Ajout de l'utilisateur site_SIGLE_SITE
   ansible.builtin.user:
     name: "site_{{ SIGLE }}_{{ SITE }}"
-    home: "/home/sites/log/nginx/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
+    home: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
     shell: /bin/false
     groups: www-data
     system: true
@@ -25,6 +25,8 @@
     owner: "{{ item.owner }}"
     group: "{{ item.group }}"
     mode: "{{ item.mode }}"
+  vars: 
+    concat: "site_{{ SIGLE }}_{{ SITE }}"
   loop_control:
     label: "{{ item.path }}"
   loop:
@@ -40,6 +42,6 @@
       mode: '2751'
     - path: "/home/sites/data/{{ TLD }}/{{ DOMAIN }}/{{ SITE }}"
       state: directory
-      owner: 'root'
+      owner: "{{ ( SITE in ['www','WP'] ) | ternary ( concat , 'root' ) }}"
       group: "site_{{ SIGLE }}_{{ SITE }}"
       mode: '2750'