initial commit

This commit is contained in:
Ludovic Cartier
2024-12-11 17:58:34 +01:00
parent 554e08edb5
commit 9ea5639efa
6 changed files with 167 additions and 0 deletions

11
tasks/asserts.yml Normal file
View File

@ -0,0 +1,11 @@
---
- name: assert | check OS
assert:
that:
- ansible_distribution == 'Debian'
- name: assert | check vars
assert:
that:
- backup_dir is defined
- backup_retention is defined

37
tasks/install.yml Normal file
View File

@ -0,0 +1,37 @@
---
- name: proxmox backup client | get GPG key
apt_key:
url: "{{ pbs_repo_key }}"
- name: proxmox backup client | add repository
become: yes
apt_repository:
repo: "{{ pbs_repo_no_subscription }}"
filename: pbs-client.list
- name: proxmox backup client | update APT Cache
apt:
update_cache: yes
cache_valid_time: 3600
- name: proxmox backup client | install
apt:
name:
- proxmox-backup-client
state: present
- name: proxmox backup client | copy backup script
template:
src: brain_backup.j2
dest: /usr/local/bin/brain_backup
owner: root
group: root
mode: 0755
- name: proxmox backup client | install crontab
cron:
name: brain backup
minute: "{{ backup_cron_minute | default('0') }}"
hour: "{{ backup_cron_hour | default('2') }}"
user: root
job: "/usr/local/bin/brain_backup"

6
tasks/main.yml Normal file
View File

@ -0,0 +1,6 @@
---
- name: asserts
include_tasks: asserts.yml
- name: install
include_tasks: install.yml