docker_systemd_service/tasks/uninstall.yml

23 lines
538 B
YAML
Raw Normal View History

2023-12-03 21:56:21 +00:00
---
# task/uninstall file for docker_systemd_service
- name: Remove ENV file for {{ service_name }}.service
file:
path: "{{ sysconf_dir }}/{{ container_name }}"
state: absent
- name: Disable and stop {{ container_name }}
systemd:
name: '{{ service_name }}.service'
enabled: false
state: stopped
- name: Remove unit {{ service_name }}.service
file:
path: /etc/systemd/system/{{ service_name }}.service
state: absent
- name: Reload systemd units
systemd:
daemon_reload: true
changed_when: false