deploiement script de backup
This commit is contained in:
31
tasks/backup.yml
Normal file
31
tasks/backup.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: create root bin and backup dirs
|
||||
ansible.builtin.file:
|
||||
path: "{{ item }}"
|
||||
state: directory
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0700
|
||||
loop:
|
||||
- "{{ ldap_backup_dir }}"
|
||||
- /root/bin
|
||||
|
||||
|
||||
- name: deploy backup script
|
||||
ansible.builtin.git:
|
||||
repo: https://infra.opendoor.fr/git/tom/Ldap_backup.git
|
||||
dest: /root/bin/ldap_backup
|
||||
|
||||
- name: backup script permissions
|
||||
ansible.builtin.file:
|
||||
path: /root/bin/ldap_backup/ldap_backup.sh
|
||||
mode: 700
|
||||
|
||||
- name: backup script cron
|
||||
ansible.builtin.cron:
|
||||
name: ldap_backup
|
||||
cron_file: ldap_backup
|
||||
user: root
|
||||
hour: "01"
|
||||
minute: "00"
|
||||
job: "/root/bin/ldap_backup/ldap_backup.sh {{ ldap_backup_dir }}"
|
||||
@@ -203,3 +203,7 @@
|
||||
loop: "{{ ldap_entries }}"
|
||||
when: ldap_entries is defined
|
||||
ignore_errors: true
|
||||
|
||||
- name: setup backup
|
||||
import_tasks: backup.yml
|
||||
tags: backup_ldap
|
||||
|
||||
Reference in New Issue
Block a user