Add sleep to ansible-pull commands. Change weekly force to daily. Use explicit command rather than rarely used file.
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
---
|
||||
# Jobs relating to the ansible user.
|
||||
|
||||
# $RANDOM is anywhere from 0 to 32767 in BASH. This would be up to ~9 hours.
|
||||
# $RANDOM / 10 can be up to about 3200 seconds, or ~55 minutes.
|
||||
# $RANDOM / 20 can be up to about 1600 seconds, or ~27 minutes.
|
||||
# $RANDOM / 50 can be up to about 650 seconds, or ~11 minutes.
|
||||
# $RANDOM / 100 can be up to about 320 seconds, or ~5 minutes.
|
||||
# This prevents multiple systems from hitting it at the exact same time.
|
||||
- name: General | Cron | Ansible | Create Subscriber Job
|
||||
cron:
|
||||
user: ansible
|
||||
name: "Ansible Sync"
|
||||
minute: "*/30"
|
||||
job: "sudo {{ ansible_pull_exec.stdout }} -v -o -U {{ git_repo_http }} --checkout {{ branch }}"
|
||||
job: "sleep $(( $RANDOM / 20 )); sudo {{ ansible_pull_exec.stdout }} -v -o -U {{ git_repo_http }} --checkout {{ branch }}"
|
||||
state: present
|
||||
disabled: "{{ 'yes' if no_telem else 'no' }}"
|
||||
|
||||
@@ -14,7 +20,7 @@
|
||||
cron:
|
||||
user: ansible
|
||||
name: "Ansible Weekly Forced Sync"
|
||||
special_time: weekly
|
||||
job: "{{ user_root.home }}/bin/scm.sh"
|
||||
special_time: daily
|
||||
job: "sleep $(( $RANDOM / 1 )); sudo {{ ansible_pull_exec.stdout }} -v -U {{ git_repo_http }} --checkout {{ branch }}"
|
||||
state: present
|
||||
disabled: "{{ 'yes' if no_telem else 'no' }}"
|
||||
|
Reference in New Issue
Block a user