43 lines
1.6 KiB
YAML
43 lines
1.6 KiB
YAML
|
- name: Stop Archer A9 Router Rebooter
|
||
|
ansible.builtin.import_playbook: stop.yaml
|
||
|
|
||
|
- name: Uninstall Archer A9 Router Rebooter
|
||
|
hosts: Rivendell
|
||
|
tasks:
|
||
|
- name: Remove Archer A9 Router Rebooter logs Docker volume
|
||
|
community.docker.docker_volume:
|
||
|
volume_name: archer-a9-router-rebooter-logs
|
||
|
state: absent
|
||
|
- name: Remove Archer A9 Router Rebooter logs Docker volume directory
|
||
|
become: true
|
||
|
ansible.builtin.file:
|
||
|
path: /data/archer-a9-router-rebooter-logs
|
||
|
state: absent
|
||
|
|
||
|
- name: Read homelab config
|
||
|
ansible.builtin.slurp:
|
||
|
src: '{{ansible_user_dir}}/.homelab.json'
|
||
|
register: homelab_config_file
|
||
|
- name: Set homelab_config variable
|
||
|
ansible.builtin.set_fact:
|
||
|
homelab_config: '{{homelab_config_file.content|b64decode|from_json}}'
|
||
|
|
||
|
- name: Delete from Postgres table service_data
|
||
|
community.postgresql.postgresql_query:
|
||
|
login_host: '{{homelab_config.database.host}}'
|
||
|
login_user: '{{homelab_config.database.user}}'
|
||
|
login_password: '{{homelab_config.database.password}}'
|
||
|
db: '{{homelab_config.database.name}}'
|
||
|
query: 'DELETE FROM service_data WHERE service = %s;'
|
||
|
positional_args:
|
||
|
- archer_a9_router_rebooter
|
||
|
- name: Delete from Postgres table service
|
||
|
community.postgresql.postgresql_query:
|
||
|
login_host: '{{homelab_config.database.host}}'
|
||
|
login_user: '{{homelab_config.database.user}}'
|
||
|
login_password: '{{homelab_config.database.password}}'
|
||
|
db: '{{homelab_config.database.name}}'
|
||
|
query: 'DELETE FROM service WHERE name = %s;'
|
||
|
positional_args:
|
||
|
- archer_a9_router_rebooter
|