From 171392bf045e44b0f02a0b2e670303ac8a20c46b Mon Sep 17 00:00:00 2001 From: Valentin CZERYBA Date: Mon, 27 Feb 2023 22:47:49 +0100 Subject: [PATCH] add deconfigure backup --- roles/deploy-web/tasks/deconfigure.yml | 5 +++ roles/deploy-web/tasks/deconfigure_backup.yml | 31 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 roles/deploy-web/tasks/deconfigure_backup.yml diff --git a/roles/deploy-web/tasks/deconfigure.yml b/roles/deploy-web/tasks/deconfigure.yml index 4e1ccf3..16de21d 100644 --- a/roles/deploy-web/tasks/deconfigure.yml +++ b/roles/deploy-web/tasks/deconfigure.yml @@ -18,6 +18,11 @@ import_tasks: deconfigure_supervision.yml tags: [ "deconfigure_supervision" ] +- name: Deconfigure backup script + import_tasks: deconfigure_backup.yml + tags: [ "deconfigure_backup" ] + + - name: Remove sentinel directory file: state: absent diff --git a/roles/deploy-web/tasks/deconfigure_backup.yml b/roles/deploy-web/tasks/deconfigure_backup.yml new file mode 100644 index 0000000..504bbcf --- /dev/null +++ b/roles/deploy-web/tasks/deconfigure_backup.yml @@ -0,0 +1,31 @@ +# tasks file for stats script + +- name: "Create log for backup script" + file: + path: "{{ item }}" + state: absent + with_items: + - "/var/log/scw-log" + - "/root/log" + - "/opt/scw-backup.sh" + - "/opt/scw-restore.sh" + - "/root/.scw-configrc" + vars: + ansible_become: yes + ansible_become_method: sudo + ansible_become_password: "{{ sudo_password }}" + + + +#- name: Crontab blacklist +# ansible.builtin.cron: +# name: "blacklist script" +# cron_file: "blacklist_cron" +# minute: "*/5" +# job: "bash /usr/local/bin/sentinel/blacklist.sh" +# user: root +# +# vars: +# ansible_become: yes +# ansible_become_method: sudo +# ansible_become_password: "{{ sudo_password }}"