From 6d1344f4c659bdd61b126111aca17ab580e34168 Mon Sep 17 00:00:00 2001
From: s3lph <s3lph@kabelsalat.ch>
Date: Sun, 9 Mar 2025 14:39:41 +0100
Subject: [PATCH] chore!: remove watchtower

---
 roles/pretalx/meta/argument_specs.yml    |  7 ----
 roles/pretalx/tasks/install.yml          |  4 ---
 roles/pretix/meta/argument_specs.yml     |  7 ----
 roles/pretix/tasks/install.yml           |  4 ---
 roles/watchtower/meta/argument_specs.yml | 42 ------------------------
 roles/watchtower/meta/main.yml           | 42 ------------------------
 roles/watchtower/tasks/install.yml       | 25 --------------
 roles/watchtower/tasks/main.yml          |  7 ----
 8 files changed, 138 deletions(-)
 delete mode 100644 roles/watchtower/meta/argument_specs.yml
 delete mode 100644 roles/watchtower/meta/main.yml
 delete mode 100644 roles/watchtower/tasks/install.yml
 delete mode 100644 roles/watchtower/tasks/main.yml

diff --git a/roles/pretalx/meta/argument_specs.yml b/roles/pretalx/meta/argument_specs.yml
index 701106c..fb21c18 100644
--- a/roles/pretalx/meta/argument_specs.yml
+++ b/roles/pretalx/meta/argument_specs.yml
@@ -58,13 +58,6 @@ argument_specs:
           - You should not need to change this.
         type: int
         default: 999
-      pretalx_watchtower_enabled:
-        description:
-          - "Whether to enable automatic container updates through L(Watchtower,https://containrrr.dev/watchtower/)."
-          - "If this is true, you should set O(pretalx_image_tag) to something other than V(latest) or V(stable)."
-          - "See also: M(s3lph.conference.watchtower)."
-        type: bool
-        default: false
 
       # System user settings
       pretalx_system_group:
diff --git a/roles/pretalx/tasks/install.yml b/roles/pretalx/tasks/install.yml
index a688ab2..4d1c8ef 100644
--- a/roles/pretalx/tasks/install.yml
+++ b/roles/pretalx/tasks/install.yml
@@ -130,8 +130,6 @@
     image: "{{ pretalx_cache_image }}:{{ pretalx_cache_image_tag }}"
     network:
       - pretalx
-    labels:
-      com.centurylinklabs.watchtower.enable: "{{ pretalx_watchtower_enabled | ternary('true', 'false') }}"
     subuidname: "{{ pretalx_system_user }}"
     subgidname: "{{ pretalx_system_user }}"
     generate_systemd:
@@ -155,8 +153,6 @@
       PRETALX_FILESYSTEM_MEDIA: /public/media
       PRETALX_FILESYSTEM_STATIC: /public/static
       GUNICORN_BIND_ADDR: "[::]:8080"
-    labels:
-      com.centurylinklabs.watchtower.enable: "{{ pretalx_watchtower_enabled | ternary('true', 'false') }}"
     subuidname: "{{ pretalx_system_user }}"
     subgidname: "{{ pretalx_system_user }}"
     generate_systemd:
diff --git a/roles/pretix/meta/argument_specs.yml b/roles/pretix/meta/argument_specs.yml
index 2cb57b5..83c7084 100644
--- a/roles/pretix/meta/argument_specs.yml
+++ b/roles/pretix/meta/argument_specs.yml
@@ -58,13 +58,6 @@ argument_specs:
           - You should not need to change this.
         type: int
         default: 15371
-      pretix_watchtower_enabled:
-        description:
-          - "Whether to enable automatic container updates through L(Watchtower,https://containrrr.dev/watchtower/)."
-          - "If this is true, you should set O(pretix_image_tag) to something other than V(latest) or V(stable)."
-          - "See also: M(s3lph.conference.watchtower)."
-        type: bool
-        default: false
 
       # System user settings
       pretix_system_group:
diff --git a/roles/pretix/tasks/install.yml b/roles/pretix/tasks/install.yml
index 2249105..1e498bf 100644
--- a/roles/pretix/tasks/install.yml
+++ b/roles/pretix/tasks/install.yml
@@ -118,8 +118,6 @@
     image: "{{ pretix_cache_image }}:{{ pretix_cache_image_tag }}"
     network:
       - pretix
-    labels:
-      com.centurylinklabs.watchtower.enable: "{{ pretix_watchtower_enabled | ternary('true', 'false') }}"
     subuidname: "{{ pretix_system_user }}"
     subgidname: "{{ pretix_system_user }}"
     generate_systemd:
@@ -138,8 +136,6 @@
       - "/etc/pretix:/etc/pretix:ro"
       - "{{ pretix_system_home }}/data:/data"
       - "/run/postgresql:/run/postgresql"
-    labels:
-      com.centurylinklabs.watchtower.enable: "{{ pretix_watchtower_enabled | ternary('true', 'false') }}"
     subuidname: "{{ pretix_system_user }}"
     subgidname: "{{ pretix_system_user }}"
     generate_systemd:
diff --git a/roles/watchtower/meta/argument_specs.yml b/roles/watchtower/meta/argument_specs.yml
deleted file mode 100644
index 8a6ad15..0000000
--- a/roles/watchtower/meta/argument_specs.yml
+++ /dev/null
@@ -1,42 +0,0 @@
----
-
-argument_specs:
-
-  main:
-    version_added: "0.0.1"
-    short_description: Install and configure Watchtower.
-    description:
-      - Install and configure L(Watchtower,https://containrrr.dev/watchtower/).
-      - "Execution of this role can be limited using the following tags:"
-      - "C(role::watchtower:install): Install Podman and Watchtower"
-      - "C(role::watchtower): Apply all of the above."
-    author: s3lph
-    options:
-
-      watchtower_image:
-        description:
-          - The name of the OCI image to run.
-          - "See also: O(watchtower_image_tag)."
-        type: str
-        default: docker.io/containrrr/watchtower
-      watchtower_image_tag:
-        description:
-          - The tag of the OCI image to run
-          - "See also: O(watchtower_image)."
-        type: str
-        default: latest
-      watchtower_schedule:
-        description:
-          - Cron expression of when containers should be updated.
-          - If omitted, default to once every 24h without specifying a point in time.
-        type: str
-      watchtower_label_enable:
-        description:
-          - Whether Watchtower support has to be enabled explicitly via container labels.
-        type: bool
-        default: true
-      watchtower_update_self:
-        description:
-          - Whether Watchtower should update itself as well.
-        type: bool
-        default: true
diff --git a/roles/watchtower/meta/main.yml b/roles/watchtower/meta/main.yml
deleted file mode 100644
index 0889655..0000000
--- a/roles/watchtower/meta/main.yml
+++ /dev/null
@@ -1,42 +0,0 @@
----
-# SPDX-License-Identifier: MIT
-galaxy_info:
-  author: s3lph
-  description: Install and configure Watchtower.
-
-  # If the issue tracker for your role is not on github, uncomment the
-  # next line and provide a value
-  issue_tracker_url: https://git.kabelsalat.ch/s3lph/ansible-collection-conference/issues
-
-  # Choose a valid license ID from https://spdx.org - some suggested licenses:
-  # - BSD-3-Clause (default)
-  # - MIT
-  # - GPL-2.0-or-later
-  # - GPL-3.0-only
-  # - Apache-2.0
-  # - CC-BY-4.0
-  license: MIT
-
-  min_ansible_version: "2.15"
-
-  # If this a Container Enabled role, provide the minimum Ansible Container version.
-  # min_ansible_container_version:
-
-  platforms:
-    - name: Debian
-      versions:
-        - bullseye
-        - bookworm
-        - trixie
-
-  galaxy_tags: []
-  # List tags for your role here, one per line. A tag is a keyword that describes
-  # and categorizes the role. Users find roles by searching for tags. Be sure to
-  # remove the '[]' above, if you add tags to this list.
-  #
-  # NOTE: A tag is limited to a single word comprised of alphanumeric characters.
-  #       Maximum 20 tags per role.
-
-dependencies: []
-# List your role dependencies here, one per line. Be sure to remove the '[]' above,
-# if you add dependencies to this list.
diff --git a/roles/watchtower/tasks/install.yml b/roles/watchtower/tasks/install.yml
deleted file mode 100644
index b34392e..0000000
--- a/roles/watchtower/tasks/install.yml
+++ /dev/null
@@ -1,25 +0,0 @@
----
-
-- name: Install dependencies
-  ansible.builtin.package:
-    name:
-      - podman
-
-- name: Enable podman socket
-  ansible.builtin.systemd_service:
-    name: podman.socket
-    state: started
-    enabled: true
-
-- name: Create Watchtower container
-  containers.podman.podman_container:
-    name: watchtower
-    image: "{{ watchtower_image }}:{{ watchtower_image_tag }}"
-    env:
-      WATCHTOWER_SCHEDULE: "{{ watchtower_schedule | default(omit) }}"
-      WATCHTOWER_LABEL_ENABLE: "{{ watchtower_label_enable | default(omit) }}"
-    restart_policy: unless-stopped
-    volumes:
-      - "/run/podman/podman.sock:/var/run/docker.sock"
-    labels:
-      com.centurylinklabs.watchtower.enable: "{{ watchtower_update_self | ternary('true', 'false') }}"
diff --git a/roles/watchtower/tasks/main.yml b/roles/watchtower/tasks/main.yml
deleted file mode 100644
index a0e6fc5..0000000
--- a/roles/watchtower/tasks/main.yml
+++ /dev/null
@@ -1,7 +0,0 @@
----
-
-- name: Install Watchtower
-  ansible.builtin.import_tasks: install.yml
-  tags:
-    - "role::watchtower"
-    - "role::watchtower:install"