Add tasks to remove happydomain

This commit is contained in:
nemunaire 2023-04-12 13:03:18 +02:00
parent a58a122836
commit 6cb84cba9a
3 changed files with 50 additions and 10 deletions

View File

@ -1,5 +1,6 @@
---
use_container: false
state: present
instance_name: "happyDomain"
happydomain_version: "latest"

View File

@ -1,4 +1,5 @@
---
- block:
- include_tasks: download.yml
when: not use_container
@ -11,3 +12,8 @@
hour: "3"
minute: "0"
job: "docker exec {{ instance_name }} hadmin /api/tidy -X POST"
when: state == 'present'
- include_tasks: remove.yml
when: state == 'absent'

View File

@ -0,0 +1,33 @@
---
- name: Stop the service
ansible.builtin.service:
name: happydomain
state: stopped
enabled: false
- name: Remove happydomain binary
ansible.builtin.file:
path: /usr/bin/happydomain
state: absent
- name: Remove happydomain user
ansible.builtin.user:
name: happydomain
state: absent
- name: Remove happydomain group
ansible.builtin.group:
name: happydomain
state: absent
- name: Remove init script
ansible.builtin.file:
path: /etc/init.d/happydomain
state: absent
- name: Remove systemd service
ansible.builtin.file:
path: /lib/systemd/system/happydomain.service
state: absent
notify:
- reload systemd