From 777f9cb304f2885d278491f3a13f6515bbbaa9af Mon Sep 17 00:00:00 2001 From: Arseny Sher Date: Fri, 1 Jul 2022 16:43:07 +0400 Subject: [PATCH] playbook to remove tlis from safekeepers --- .circleci/ansible/ansible.cfg | 2 ++ .circleci/ansible/cleanup_tlis.yml | 34 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .circleci/ansible/cleanup_tlis.yml diff --git a/.circleci/ansible/ansible.cfg b/.circleci/ansible/ansible.cfg index 5818a64455..2dbf0e5e7f 100644 --- a/.circleci/ansible/ansible.cfg +++ b/.circleci/ansible/ansible.cfg @@ -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 diff --git a/.circleci/ansible/cleanup_tlis.yml b/.circleci/ansible/cleanup_tlis.yml new file mode 100644 index 0000000000..7d0cf464be --- /dev/null +++ b/.circleci/ansible/cleanup_tlis.yml @@ -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 \ No newline at end of file