dags first iteration

main
Ricard Illa 2022-10-18 18:16:03 +02:00
parent 3b146198f3
commit 0f19764703
2 changed files with 30 additions and 0 deletions

29
roles/dags/tasks/main.yml Normal file
View File

@ -0,0 +1,29 @@
---
- name: get DAGs code
git:
repo: 'git@git.narwhal.monotremata.xyz:rilla/dags.git'
dest: "{{ dags_path }}"
- name: install make and cron
pacman:
name:
- cronie
- make
when: ansible_distribution == "Archlinux"
- name: add DAG to cron
cron:
name: "acme_rsync"
minute: "0"
hour: "*/6"
job: "{{ dags_path }}/{{ ansible_hostname }}/{{ item }}/run.sh"
loop:
"{{ dags }}"
- name: enable cron
systemd:
name: cronie
state: started
enabled: true
when: ansible_distribution == "Archlinux"

1
roles/dags/vars/main.yml Normal file
View File

@ -0,0 +1 @@
dags_path: /srv/dags