diff --git a/roles/dags/tasks/main.yml b/roles/dags/tasks/main.yml new file mode 100644 index 0000000..c6479e3 --- /dev/null +++ b/roles/dags/tasks/main.yml @@ -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" diff --git a/roles/dags/vars/main.yml b/roles/dags/vars/main.yml new file mode 100644 index 0000000..c4a78c3 --- /dev/null +++ b/roles/dags/vars/main.yml @@ -0,0 +1 @@ +dags_path: /srv/dags