-
-
Notifications
You must be signed in to change notification settings - Fork 420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cron role #275
Add cron role #275
Conversation
@mrsrvman thank you so much for your contribution! It's funny, but today I planned to add a task for the crontab configuration for wal-g. But I like the idea of having a separate role because it's a more universal solution and you can add any tasks. Now that we can set tasks for pgbackrest in the |
loop: "{{ cron_jobs }}" | ||
when: | ||
- cron_jobs is defined and cron_jobs | length > 0 | ||
- remove_postgres is defined and remove_postgres | bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, the role must be added to the remove_cluster.yml
playbook
vars/main.yml
Outdated
# day: "*" | ||
# month: "*" | ||
# weekday: "*" | ||
# job: "[ '200' = $(curl -s -o /dev/null -w '\\%{http_code}' http://{{ hostvars[inventory_hostname]['inventory_hostname'] }}:8008) ] && /usr/local/bin/wal-g backup-push" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This command allows you to determine the master according to patroni
[ '200' = $(curl -s -o /dev/null -w '\%{http_code}' http://{{ hostvars[inventory_hostname]['inventory_hostname'] }}:8008) ]
Example for bash
curl -s -o /dev/null -w '%{http_code}' http://10.48.5.196:8008
Co-authored-by: Vitaliy Kukharik <[email protected]>
Two example: