Cronjobs einfach konfigurierbar machen #6
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: CCCHH/ansible-infra#6
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Diverse Komponenten möchten gerne per Cron aufgerufen werden. Für diese einfachen Fälle wäre es cool, wenn man eine Cronzeile direkt ins Playbook kippen könnte.
Beispiele:
Cronjobs können gut via
ansible.builtin.cron
konfiguriert werden.So zum Beispiel jetzt auch geschehen in der Docker Compose Rolle:
- name: Make sure anacron is installed
become: true
ansible.builtin.package:
name: anacron
state: present
- name: ensure automatic update cron job is present
become: true
ansible.builtin.cron:
name: 'ansible docker compose auto update'
minute: "0"
hour: "5"
job: "cd /ansible_docker_compose; docker compose pull && docker compose up -d"
- name: ensure automatic cleanup cron job is present
become: true
ansible.builtin.cron:
name: 'ansible docker compose auto cleanup'
minute: "23"
hour: "4"
job: "docker system prune -a -f"