add postfix and journalwatch roles
[ansible.git] / roles / journalwatch / tasks / main.yml
diff --git a/roles/journalwatch/tasks/main.yml b/roles/journalwatch/tasks/main.yml
new file mode 100644 (file)
index 0000000..773a2b2
--- /dev/null
@@ -0,0 +1,23 @@
+- name: install journalwatch dependencies
+  apt: name=python3-systemd state=latest
+- name: install journalwatch
+  git:
+    repo: 'https://github.com/The-Compiler/journalwatch.git'
+    version: b62f223bc36eabc193cfcf0d309d284da4f66463
+    dest: /root/journalwatch
+- name: create journalwatch config dir
+  file: path=/root/.config/journalwatch state=directory
+- name: install journalwatch config files
+  template:
+    src: templates/{{item}}
+    dest: /root/.config/journalwatch/{{item}}
+  with_items:
+  - config
+  - patterns
+- name: delete old journalwatch crontab entry
+  file: path=/etc/cron.d/journalwatch state=absent
+- name: create journalwatch crontab entry
+  cron:
+    name: "journalwatch"
+    minute: "*/10"
+    job: "/root/journalwatch/journalwatch.py mail"