add data server
This commit is contained in:
parent
2895d00e60
commit
812ba00884
20 changed files with 51 additions and 21 deletions
|
@ -1 +0,0 @@
|
|||
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBTag7YToG5W+H2kEUz40kOH+7cs0Lp3owFFKkmHBiWM root@max
|
|
@ -11,11 +11,6 @@
|
|||
template:
|
||||
src: "{{ role_path }}/templates/backup.yml.j2"
|
||||
dest: "{{ service_dir }}/backup.yml"
|
||||
- name: Copy public key
|
||||
copy:
|
||||
src: "{{ role_path }}/files/id_ed25519.pub"
|
||||
dest: "{{ service_dir }}/id_ed25519.pub"
|
||||
mode: 0644
|
||||
- name: Copy private key
|
||||
copy:
|
||||
src: "{{ role_path }}/files/id_ed25519"
|
||||
|
|
|
@ -2,7 +2,7 @@ location:
|
|||
source_directories:
|
||||
- {{ base_data_dir }}
|
||||
repositories:
|
||||
- ssh://root@lewis.lan/root/homeserver_backup
|
||||
- ssh://root@lewis.lan/{{ backup_location }}
|
||||
retention:
|
||||
keep_daily: 7
|
||||
keep_weekly: 4
|
||||
|
|
18
roles/dataserver/tasks/main.yml
Normal file
18
roles/dataserver/tasks/main.yml
Normal file
|
@ -0,0 +1,18 @@
|
|||
- name: APT upgrade
|
||||
apt:
|
||||
autoremove: true
|
||||
upgrade: yes
|
||||
state: latest
|
||||
update_cache: yes
|
||||
cache_valid_time: 86400 # One day
|
||||
- name: Install borg
|
||||
apt:
|
||||
name: borgbackup
|
||||
- name: Add Borg public key
|
||||
authorized_key:
|
||||
key: "{{ borg_public_key }}"
|
||||
user: "{{ ansible_user_id }}"
|
||||
- name: Create Borg repository
|
||||
command:
|
||||
cmd: "borg init -e none {{ backup_location }}"
|
||||
creates: "{{ backup_location }}"
|
Reference in a new issue