when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
register:janitors_token
no_log:True
- name:Copy build_room_list.py script to target machine
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
- name:Fetch complete room list from target machine
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
- name:Remove complete room list from target machine
file:
path:/tmp/room_list_complete.json
state:absent
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
- name:Collect epoche time from date
delegate_to:127.0.0.1
shell:|
date -d '{{ purge_date }}' +"%s"
when:(purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
register:purge_epoche_time
- name:Generate list of rooms with more then N users
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1) or (purge_mode.find("Skip purging rooms [faster]") != -1)
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1) or (purge_mode.find("Skip purging rooms [faster]") != -1)
- name:Revert 'Deploy/Update a Server' job template
delegate_to:127.0.0.1
awx.awx.tower_job_template:
name:"{{ matrix_domain }} - 0 - Deploy/Update a Server"
description:"Creates a new matrix service with Spantaleev's playbooks"
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1) or (purge_mode.find("Skip purging rooms [faster]") != -1)
- name:Ensure matrix-synapse is stopped
service:
name:matrix-synapse
state:stopped
daemon_reload:yes
when:(purge_mode.find("Perform final shrink") != -1)
when:(purge_mode.find("Perform final shrink") != -1)
- name:Cleanup room_list files
delegate_to:127.0.0.1
shell:|
rm /tmp/{{ subscription_id }}_room_list*
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
ignore_errors:yes
- name:Collect after shrink size of Synapse database
shell:du -sh /matrix/postgres/data
register:db_size_after_stat
when:(purge_mode.find("Perform final shrink") != -1)
no_log:True
- name:Print total number of rooms processed
debug:
msg:'{{ rooms_total.stdout }}'
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
- name:Print the number of rooms purged with no local users
debug:
msg:'{{ rooms_no_local_total.stdout }}'
when:(purge_mode.find("No local users [recommended]") != -1) or (purge_mode.find("Number of users [slower]") != -1) or (purge_mode.find("Number of events [slower]") != -1)
- name:Print the number of rooms purged with more then N users
debug:
msg:'{{ rooms_join_members_total.stdout }}'
when:purge_mode.find("Number of users") != -1
- name:Print the number of rooms purged with more then N events
debug:
msg:'{{ rooms_state_events_total.stdout }}'
when:purge_mode.find("Number of events") != -1
- name:Print before purge size of Synapse database