Add tasks to remove happydomain
This commit is contained in:
parent
a58a122836
commit
6cb84cba9a
@ -1,5 +1,6 @@
|
|||||||
---
|
---
|
||||||
use_container: false
|
use_container: false
|
||||||
|
state: present
|
||||||
|
|
||||||
instance_name: "happyDomain"
|
instance_name: "happyDomain"
|
||||||
happydomain_version: "latest"
|
happydomain_version: "latest"
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
---
|
---
|
||||||
|
- block:
|
||||||
- include_tasks: download.yml
|
- include_tasks: download.yml
|
||||||
when: not use_container
|
when: not use_container
|
||||||
|
|
||||||
@ -11,3 +12,8 @@
|
|||||||
hour: "3"
|
hour: "3"
|
||||||
minute: "0"
|
minute: "0"
|
||||||
job: "docker exec {{ instance_name }} hadmin /api/tidy -X POST"
|
job: "docker exec {{ instance_name }} hadmin /api/tidy -X POST"
|
||||||
|
|
||||||
|
when: state == 'present'
|
||||||
|
|
||||||
|
- include_tasks: remove.yml
|
||||||
|
when: state == 'absent'
|
||||||
|
33
roles/happydomain/tasks/remove.yml
Normal file
33
roles/happydomain/tasks/remove.yml
Normal 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
|
Loading…
Reference in New Issue
Block a user