You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/roles/common/tasks/helpers.yml

63 lines
1.3 KiB
YAML

---
- name: Create directory for helper scripts
file:
path: "{{ global_helper_directory }}"
state: directory
owner: root
group: root
mode: "u=rwx,g=rx,o=rx"
tags:
- backups
- name: Upload helper scripts
copy:
src: "{{ item }}"
dest: "{{ global_helper_directory }}/{{ item }}"
owner: root
group: root
mode: "u=rwx,g=rx,o=rx"
validate: "{{ global_validate_shell_script }}"
loop:
- backup_rename.sh
- gpg_import_url_key.sh
tags:
- backups
- name: Upload python helper scripts
copy:
src: "{{ item }}"
dest: "{{ global_helper_directory }}/{{ item }}"
owner: root
group: root
mode: "u=rwx,g=rx,o=rx"
validate: "{{ global_validate_python_script }}"
loop:
- check_subnet.py
- name: Build and upload template helper scripts
template:
src: "{{ item }}"
dest: "{{ global_helper_directory }}/{{ item }}"
owner: root
group: root
mode: "u=rwx,g=rx,o=rx"
validate: "{{ global_validate_shell_script }}"
loop:
- backup_autoremove.sh
- backup_files.sh
- backup_mysql_database.sh
- nsupdate_keygen.sh
tags:
- backups
- name: Configure auto remove older backups
cron:
hour: 0
minute: 30
job: "{{ global_helper_directory }}/backup_autoremove.sh"
name: "Auto remove older backups"
state: present
tags:
- backups