forked from planetary-social/ansible-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete-feed.yml
45 lines (40 loc) · 1.4 KB
/
delete-feed.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
# Deletes the feed of the given user id on all Planetary pubs. This is very innefficient
# as it rewrites the entire db. It also will cause the pub to be unresponsive for ~15
# minutes after the playbook ends while the flume views are rebuilt.
#
# Note: this does not publish a block message for the feed, so it could be resynced.
# To block a user see the block-user.yml playbook.
#
# Usage: ansible-playbook delete-feed.yml -i {inventory} --extra-vars "feed_id='{feedID}'"
- name: Delete feed
hosts: pubs
serial: 1 # rolling update, don't bring all pubs down at once
roles:
- flumedb-delete
tasks:
- name: Stop sbot container
docker_container:
name: sbot
state: absent
- name: Stop healer container
docker_container:
name: healer
state: absent
- name: Run delete script
shell:
cmd: source /root/.profile && node ssb.js --id='{{ feed_id }}' --dir ~/ssb-pub-data
chdir: flumedb-delete
args:
executable: /bin/bash
- name: Clear flume views
shell:
cmd: source /root/.profile && node delete-views --dir ~/ssb-pub-data
chdir: flumedb-delete
args:
executable: /bin/bash
# The deletion script messes up the permissions that Docker needs
- name: Chown ssb-pub-data
command: chown -R 1000:1000 ~/ssb-pub-data/flume
- name: Start ssb-server
shell: ./start-sbot