29 lines
785 B
YAML
29 lines
785 B
YAML
|
# code: language=ansible
|
||
|
|
||
|
- name: Clean Synapse
|
||
|
hosts: localhost
|
||
|
connection: local
|
||
|
become: false
|
||
|
gather_facts: false
|
||
|
vars_prompt:
|
||
|
- name: room_id
|
||
|
prompt: "Enter the room ID to delete"
|
||
|
private: false
|
||
|
tasks:
|
||
|
|
||
|
- name: Delete room
|
||
|
ansible.builtin.uri:
|
||
|
url: "https://{{ synapse_host_address }}/_synapse/admin/v2/rooms/{{ room_id }}"
|
||
|
method: DELETE
|
||
|
headers:
|
||
|
Authorization: "Bearer {{ synapse_admin_token }}"
|
||
|
body_format: json
|
||
|
body: {}
|
||
|
register: purge_id
|
||
|
|
||
|
- name: Wait for purge to complete
|
||
|
ansible.builtin.uri:
|
||
|
url: "https://{{ synapse_host_address }}/_synapse/admin/v2/rooms/delete_status/{{ item }}"
|
||
|
headers:
|
||
|
Authorization: "Bearer {{ synapse_admin_token }}"
|