2023-02-17 18:04:21 +01:00
|
|
|
# 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 }}"
|
|
|
|
|
2023-02-27 22:39:25 +01:00
|
|
|
- name: Copy scw backup and restore script
|
2023-02-17 18:04:21 +01:00
|
|
|
copy:
|
2023-02-27 22:39:25 +01:00
|
|
|
src: "{{ item }}"
|
|
|
|
dest: "/opt/{{ item }}"
|
2023-02-17 18:04:21 +01:00
|
|
|
mode: "0500"
|
2023-02-27 22:39:25 +01:00
|
|
|
with_items:
|
|
|
|
- "scw-backup.sh"
|
|
|
|
- "scw-restore.sh"
|
2023-02-17 18:04:21 +01:00
|
|
|
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 }}"
|