mise à jour nom de tâche
[lhc/ansible.git] / tasks / config_nginx.yml
index 02ac416..d370f46 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:
     name: nginx
     state: reloaded
-  when: SITE != 'nuage' and SITE != 'paheko' and template_site == 'http'
+  when: SITE != 'nuage' and SITE != 'paheko' and SITE != 'WP' and template_site == 'http'
+
+# ne jamais executer cette tâche sauf si le playbook est appelé avec le tag https - fin du playbook
+- name: Recharger le service nginx
+  ansible.builtin.service:
+    name: nginx
+    state: reloaded
+  tags:
+    - https
+    - never
\ No newline at end of file