ctucx.git: ansible-configs

My personal ansible roles and playbooks [deprecated in favor of nixos]

commit 9ba277523cd96dd5495c7484b237436a06d48071
parent 73b59b75c0b894b34ebdcd9e5ea44e8a116e41a1
Author: Leah (ctucx) <leah@ctu.cx>
Date: Sun, 28 Feb 2021 15:26:10 +0100

roles/ctucx-gallery: update alpine package name, add remove function
2 files changed, 24 insertions(+), 20 deletions(-)
M
roles/ctucx-gallery/tasks/install.yml
|
2
+-
M
roles/ctucx-gallery/tasks/remove.yml
|
42
+++++++++++++++++++++++-------------------
diff --git a/roles/ctucx-gallery/tasks/install.yml b/roles/ctucx-gallery/tasks/install.yml
@@ -2,7 +2,7 @@
 
 - name: "[Alpine] Install package: gallery"
   apk:
-    name: gallery
+    name: ctucx-gallery
     state: present
   when:
     - ansible_distribution == "Alpine" 
diff --git a/roles/ctucx-gallery/tasks/remove.yml b/roles/ctucx-gallery/tasks/remove.yml
@@ -1,38 +1,42 @@
 ---
+- name: "[cron] Delete crontab entry for: ctucx-gallery"
+  cron:
+    state: ansent
+    name: "ctucx-gallery regenerate"
+    special_time: hourly
+    user: "{{ services.ctucxGallery.user }}"
+    job: "/usr/bin/ctucx-gallery /etc/ctucx-gallery.conf"
+  when: 
+    - ansible_service_mgr != "systemd"
 
-- name: "[OpenRC] Disable and stop service: vnstatd"
-  service:
-    name: vnstatd
-    enabled: no
-    state: stopped
-  when:
-    - ansible_service_mgr == "openrc"
-
-- name: "[systemd] Disable and stop service: vnstat"
+- name: "[systemd] Disable and stop systemd.timer: ctucx-gallery.timer"
   systemd:
-    name: vnstat
+    name: ctucx-gallery.timer
     enabled: no
     state: stopped
   when:
     - ansible_service_mgr == "systemd"
 
 
-- name: "[Alpine] Remove package: vnstatd" 
+- name: "[Alpine] Remove package: ctucx-gallery" 
   apk:
-    name: vnstatd
+    name: ctucx-gallery
     state: absent
   when: 
     - ansible_distribution == "Alpine" 
 
-- name: "[Archlinux] Remove package: vnstat"
+- name: "[Archlinux] Remove package: ctucx-gallery"
   pacman:
-    name: vnstat
+    name: ctucx-gallery
     state: absent
   when: 
     - ansible_distribution == "Archlinux" 
 
-
-- name: "Remove file: /etc/vnstat.conf"
+- name: "Delete leftovers"
   file:
-    path: /etc/vnstat.conf
-    state: absent-
\ No newline at end of file
+    path: "{{item}}"
+    state: absent
+  with_items:
+    - /etc/ctucx-gallery.conf
+    - /etc/systemd/system/ctucx-gallery.service
+    - /etc/systemd/system/ctucx-gallery.timer+
\ No newline at end of file