ansible-based crons

This commit is contained in:
Arya 2023-07-14 21:16:51 +05:30
parent 5d525e0c4e
commit 3ea64ddbb8
Signed by: arya
GPG Key ID: 842D12BDA50DF120
4 changed files with 34 additions and 0 deletions

2
cron/README.md Normal file
View File

@ -0,0 +1,2 @@
# crons
Things here are cronjobs executed by ansible-semaphore.

View File

@ -0,0 +1,12 @@
# IMPORTANT: Inventory file for pubnix is stored in semaphore, not inventory.yml
---
- name: Caddy Builds on Pubnix (Weekly Cron)
hosts: pubnix
tasks:
- name: Do the thing
ansible.builtin.command: xcaddy build github.com/jung-kurt/caddy-cgi=/root/caddy/caddy-cgi --output /usr/local/bin/caddy
register: out
changed_when: out.rc != 0
- name: Print output of thing
ansible.builtin.debug:
var: out.stderr_lines

View File

@ -0,0 +1,11 @@
---
- name: Caddy Builds on Soleil (Weekly Cron)
hosts: core
tasks:
- name: Do the thing
ansible.builtin.command: xcaddy build --with github.com/caddy-dns/rfc2136@master --with github.com/mholt/caddy-ratelimit --output /var/www/caddy-build/bin
register: out
changed_when: out.rc != 0
- name: Print output of thing
ansible.builtin.debug:
var: out.stderr_lines

9
cron/prune.yaml Normal file
View File

@ -0,0 +1,9 @@
---
- name: Docker Prunes (Daily Cron)
hosts: docker,backwards,eu,us,in,status
tasks:
- name: Do thing
community.docker.docker_prune:
containers: true
images: true
networks: true