backup and restore blacklist file

This commit is contained in:
2023-02-13 23:52:47 +01:00
parent 7d5f86b045
commit 9993844f02
3 changed files with 74 additions and 3 deletions

View File

@@ -11,7 +11,18 @@
ansible_become_password: "{{ sudo_password }}"
when: script is not defined
- name: Copy blacklist
copy:
src: "{{ playbook_dir }}/blacklist/{{ inventory_hostname }}/etc/sentinel/blacklist"
dest: /etc/sentinel/blacklist
mode: "0644"
when: script is not defined or script == "blacklist"
ignore_errors: true
vars:
ansible_become: yes
ansible_become_method: sudo
ansible_become_password: "{{ sudo_password }}"
tags: [ "restore" ]
- name: Deploy stats script
import_tasks: stats.yml
@@ -21,7 +32,7 @@
import_tasks: blacklist.yml
when: script is not defined or script == "blacklist"
- name: Configure supervision script
import_tasks: supervision.yml
when: script is not defined or script == "supervision"

View File

@@ -1,4 +1,9 @@
- name: Backup blacklist
fetch:
src: /etc/sentinel/blacklist
dest: blacklist
when: script is not defined or script == "blacklist"
tags: [ "backup" ]
- name: Deconfigure stats script