feat(semaphore): add optional aggressive storage cleanup for legacy mode

This commit is contained in:
Hermes Agent service account
2026-05-28 15:17:54 -05:00
parent 85cc1f8c6a
commit b93a6e50ab

View File

@@ -32,6 +32,21 @@
- name: Legacy deployment with PostgreSQL - name: Legacy deployment with PostgreSQL
when: semaphore_use_postgres | default(false) when: semaphore_use_postgres | default(false)
block: block:
- name: Aggressive storage cleanup (when semaphore_force_storage_cleanup=true)
when: semaphore_force_storage_cleanup | default(false)
block:
- name: Force remove all containers
ansible.builtin.command:
cmd: "podman rm -af"
become: true
failed_when: false
- name: Prune unused images, volumes and networks
ansible.builtin.command:
cmd: "podman system prune -f --volumes"
become: true
failed_when: false
- name: Remove existing containers if present (force + storage cleanup) - name: Remove existing containers if present (force + storage cleanup)
ansible.builtin.command: ansible.builtin.command:
cmd: "podman rm -f --storage {{ item }}" cmd: "podman rm -f --storage {{ item }}"