add backup script
This commit is contained in:
47
roles/deploy-web/tasks/backup.yml
Normal file
47
roles/deploy-web/tasks/backup.yml
Normal file
@@ -0,0 +1,47 @@
|
||||
# tasks file for stats script
|
||||
|
||||
- name: "Create log for backup script"
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
with_items:
|
||||
- "/var/log/scw-log"
|
||||
- "/root/log"
|
||||
vars:
|
||||
ansible_become: yes
|
||||
ansible_become_method: sudo
|
||||
ansible_become_password: "{{ sudo_password }}"
|
||||
|
||||
- name: Copy scw backup script
|
||||
copy:
|
||||
src: "scw-backup.sh"
|
||||
dest: "/opt/scw-backup.sh"
|
||||
mode: "0500"
|
||||
vars:
|
||||
ansible_become: yes
|
||||
ansible_become_method: sudo
|
||||
ansible_become_password: "{{ sudo_password }}"
|
||||
|
||||
- name: Copy scw backup config
|
||||
template:
|
||||
src: "scw-configrc.j2"
|
||||
dest: "/root/.scw-configrc"
|
||||
mode: "0400"
|
||||
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 }}"
|
@@ -46,3 +46,9 @@
|
||||
import_tasks: supervision.yml
|
||||
tags: [ "configure_supervision" ]
|
||||
|
||||
- name: Configure backup script
|
||||
import_tasks: backup.yml
|
||||
tags: [ "configure_backup" ]
|
||||
|
||||
|
||||
|
||||
|
@@ -11,7 +11,7 @@
|
||||
|
||||
- name: Deconfigure blacklist script
|
||||
import_tasks: deconfigure_blacklist.yml
|
||||
tags: [ "deconfigure_blacklist" ]
|
||||
tags: [ "deconfigure_blacklist" ]
|
||||
|
||||
|
||||
- name: Deconfigure supervision script
|
||||
|
Reference in New Issue
Block a user