From 0f19764703a1631c62f0800cbfc2323e293a7018 Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Tue, 18 Oct 2022 18:16:03 +0200 Subject: [PATCH] dags first iteration --- roles/dags/tasks/main.yml | 29 +++++++++++++++++++++++++++++ roles/dags/vars/main.yml | 1 + 2 files changed, 30 insertions(+) create mode 100644 roles/dags/tasks/main.yml create mode 100644 roles/dags/vars/main.yml 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