playbook to remove tlis from safekeepers

This commit is contained in:
Arseny Sher
2022-07-01 16:43:07 +04:00
parent 69e7fbbcb1
commit 777f9cb304
2 changed files with 36 additions and 0 deletions

View File

@@ -4,6 +4,8 @@ localhost_warning = False
host_key_checking = False
timeout = 30
allow_world_readable_tmpfiles=true
[ssh_connection]
ssh_args = -F ./ansible.ssh.cfg
# teleport doesn't support sftp yet https://github.com/gravitational/teleport/issues/7127

View File

@@ -0,0 +1,34 @@
- name: cleanup timelines
hosts: safekeepers
gather_facts: False
remote_user: admin
tasks:
- name: install pip
ansible.builtin.apt:
name:
- python3-pip
- acl
become: True
- name: install psycopg2
ansible.builtin.pip:
name: psycopg2
become_user: safekeeper
become: True
- name: upload script
ansible.builtin.copy:
src: /home/ars/zenith/cloud/ops/ad_hoc/clean_timelines.py
dest: clean_timelines.py
tags:
- safekeeper
- name: run script
ansible.builtin.command: python3 clean_timelines.py --really-delete
environment:
CONSOLE_DB: "{{ CONSOLE_DB }}"
become_user: safekeeper
become: True
register: hello
- debug: var=hello