---
- name: "⏹️  Stopping {{ service_name }} service"
  systemd:
    name: "{{ service_name }}-docker.service"
    state: stopped
  become: yes
  ignore_errors: yes

- name: "❌ Disabling {{ service_name }} service"
  systemd:
    name: "{{ service_name }}-docker.service"
    enabled: no
  become: yes
  ignore_errors: yes

- name: "🐳 Stopping and removing {{ service_name }} containers"
  docker_compose:
    project_src: "/home/orangepi/{{ service_name }}"
    state: absent
  ignore_errors: yes

- name: "🗑️  Removing {{ service_name }} systemd service file"
  file:
    path: "/etc/systemd/system/{{ service_name }}-docker.service"
    state: absent
  become: yes

- name: "📁 Removing {{ service_name }} directory"
  file:
    path: "/home/orangepi/{{ service_name }}"
    state: absent

- name: "🔄 Reloading systemd daemon"
  systemd:
    daemon_reload: yes
  become: yes
