repartissement des background job cron nuage master
authorrominique <romain.legoff@heureux-cyclage.org>
Mon, 15 Jul 2024 16:16:13 +0000 (18:16 +0200)
committerrominique <romain.legoff@heureux-cyclage.org>
Mon, 15 Jul 2024 16:16:13 +0000 (18:16 +0200)
tasks/config_nuage.yml

index 46ba017..ce1cb6e 100644 (file)
     #   role: "{{ nextcloud_php_user }}"
     #   name: "GRANT SELECT ON pg_database TO php_{{ SIGLE }}_nuage;"
 
     #   role: "{{ nextcloud_php_user }}"
     #   name: "GRANT SELECT ON pg_database TO php_{{ SIGLE }}_nuage;"
 
+# on rend aléatoire la minutes de l'heure à laquelle les tâches d'arriere plan nextcloud tournent entre les différentes instance pour répartir la charge
 - name: Creation d'un fichier cron pour /etc/cron.d
   ansible.builtin.cron:
     name: "nextcloud {{ SIGLE }}_{{ config_ss_domain }} taches d'arriere plan toutes les 5 mins"
 - name: Creation d'un fichier cron pour /etc/cron.d
   ansible.builtin.cron:
     name: "nextcloud {{ SIGLE }}_{{ config_ss_domain }} taches d'arriere plan toutes les 5 mins"
-    minute: "*/5"
+    minute: "{{ 5 | random }}-59/5"
     user: "php_{{ SIGLE }}_{{ config_ss_domain }}"
     job: "{{ nextcloud_webroot }}/cron"
 
     user: "php_{{ SIGLE }}_{{ config_ss_domain }}"
     job: "{{ nextcloud_webroot }}/cron"