added backup role
This commit is contained in:
27
logs/log.txt
27
logs/log.txt
@@ -234,3 +234,30 @@ The offending line appears to be:
|
|||||||
2022-07-18 12:56:42,168 p=33487 u=opal n=ansible | fatal: [localhost]: FAILED! => {"msg": "Failed to get information on remote file (/etc/dnf/dnf.conf): sudo: a password is required\n"}
|
2022-07-18 12:56:42,168 p=33487 u=opal n=ansible | fatal: [localhost]: FAILED! => {"msg": "Failed to get information on remote file (/etc/dnf/dnf.conf): sudo: a password is required\n"}
|
||||||
2022-07-18 12:56:42,170 p=33487 u=opal n=ansible | PLAY RECAP ***************************************************************************************************************************************************
|
2022-07-18 12:56:42,170 p=33487 u=opal n=ansible | PLAY RECAP ***************************************************************************************************************************************************
|
||||||
2022-07-18 12:56:42,170 p=33487 u=opal n=ansible | localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
|
2022-07-18 12:56:42,170 p=33487 u=opal n=ansible | localhost : ok=0 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
|
||||||
|
2022-07-18 16:12:38,276 p=58089 u=opal n=ansible | PLAY [Initial Setup Including Keys, Packages, and Users.] *****************************
|
||||||
|
2022-07-18 16:12:38,344 p=58089 u=opal n=ansible | TASK [backup : Pull Backup Repository] ************************************************
|
||||||
|
2022-07-18 16:12:38,907 p=58089 u=opal n=ansible | ok: [localhost]
|
||||||
|
2022-07-18 16:12:38,917 p=58089 u=opal n=ansible | TASK [backup : Ensure correct file/dir ownership] *************************************
|
||||||
|
2022-07-18 16:12:39,321 p=58089 u=opal n=ansible | ok: [localhost]
|
||||||
|
2022-07-18 16:12:39,329 p=58089 u=opal n=ansible | TASK [backup : Copy Borgmatic Cronjob] ************************************************
|
||||||
|
2022-07-18 16:12:39,553 p=58089 u=opal n=ansible | fatal: [localhost]: FAILED! => {"changed": false, "msg": "src option requires state to be 'link' or 'hard'", "path": "/etc/cron.d/borgmatic"}
|
||||||
|
2022-07-18 16:12:39,555 p=58089 u=opal n=ansible | PLAY RECAP ****************************************************************************
|
||||||
|
2022-07-18 16:12:39,555 p=58089 u=opal n=ansible | localhost : ok=2 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0
|
||||||
|
2022-07-18 16:13:30,045 p=58230 u=opal n=ansible | PLAY [Initial Setup Including Keys, Packages, and Users.] *****************************
|
||||||
|
2022-07-18 16:13:30,112 p=58230 u=opal n=ansible | TASK [backup : Pull Backup Repository] ************************************************
|
||||||
|
2022-07-18 16:13:30,559 p=58230 u=opal n=ansible | ok: [localhost]
|
||||||
|
2022-07-18 16:13:30,570 p=58230 u=opal n=ansible | TASK [backup : Ensure correct file/dir ownership] *************************************
|
||||||
|
2022-07-18 16:13:30,971 p=58230 u=opal n=ansible | ok: [localhost]
|
||||||
|
2022-07-18 16:13:30,987 p=58230 u=opal n=ansible | TASK [backup : Copy Borgmatic Cronjob] ************************************************
|
||||||
|
2022-07-18 16:13:31,672 p=58230 u=opal n=ansible | changed: [localhost]
|
||||||
|
2022-07-18 16:13:31,695 p=58230 u=opal n=ansible | PLAY RECAP ****************************************************************************
|
||||||
|
2022-07-18 16:13:31,695 p=58230 u=opal n=ansible | localhost : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
||||||
|
2022-07-18 16:14:58,334 p=58473 u=opal n=ansible | PLAY [Initial Setup Including Keys, Packages, and Users.] *****************************
|
||||||
|
2022-07-18 16:14:58,400 p=58473 u=opal n=ansible | TASK [backup : Pull Backup Repository] ************************************************
|
||||||
|
2022-07-18 16:14:58,843 p=58473 u=opal n=ansible | ok: [localhost]
|
||||||
|
2022-07-18 16:14:58,854 p=58473 u=opal n=ansible | TASK [backup : Ensure correct file/dir ownership] *************************************
|
||||||
|
2022-07-18 16:14:59,266 p=58473 u=opal n=ansible | ok: [localhost]
|
||||||
|
2022-07-18 16:14:59,278 p=58473 u=opal n=ansible | TASK [backup : Copy Borgmatic Cronjob] ************************************************
|
||||||
|
2022-07-18 16:14:59,969 p=58473 u=opal n=ansible | changed: [localhost]
|
||||||
|
2022-07-18 16:14:59,992 p=58473 u=opal n=ansible | PLAY RECAP ****************************************************************************
|
||||||
|
2022-07-18 16:14:59,993 p=58473 u=opal n=ansible | localhost : ok=3 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
|
||||||
|
|||||||
21
roles/backup/tasks/main.yml
Normal file
21
roles/backup/tasks/main.yml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
---
|
||||||
|
- name: Pull Backup Repository
|
||||||
|
git:
|
||||||
|
repo: "{{ backup_repo }}"
|
||||||
|
dest: "{{ backup_repo_dir }}"
|
||||||
|
update: no
|
||||||
|
|
||||||
|
- name: Ensure correct file/dir ownership
|
||||||
|
file:
|
||||||
|
path: "{{ backup_repo_dir }}"
|
||||||
|
recurse: True
|
||||||
|
owner: opal
|
||||||
|
group: opal
|
||||||
|
|
||||||
|
- name: Copy Borgmatic Cronjob
|
||||||
|
copy:
|
||||||
|
src: borgmatic-cron
|
||||||
|
dest: /etc/cron.d/borgmatic
|
||||||
|
mode: u+x
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
4
roles/backup/vars/main.yml
Normal file
4
roles/backup/vars/main.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
backup_repo: git@codeberg.org:opalvaults/backup.git
|
||||||
|
|
||||||
|
backup_repo_dir: /home/opal/projects/backup-config
|
||||||
@@ -1,5 +1,3 @@
|
|||||||
# see `man dnf.conf` for defaults and possible options
|
|
||||||
|
|
||||||
[main]
|
[main]
|
||||||
fastestmirror=True
|
fastestmirror=True
|
||||||
max_parallel_downloads=10
|
max_parallel_downloads=10
|
||||||
|
|||||||
@@ -28,4 +28,3 @@ init_users:
|
|||||||
state: present
|
state: present
|
||||||
shell: /usr/bin/zsh
|
shell: /usr/bin/zsh
|
||||||
create_home: true
|
create_home: true
|
||||||
|
|
||||||
|
|||||||
@@ -2,3 +2,4 @@
|
|||||||
flatpak_packages:
|
flatpak_packages:
|
||||||
- im.riot.Riot
|
- im.riot.Riot
|
||||||
- org.signal.Signal
|
- org.signal.Signal
|
||||||
|
- org.libreoffice.LibreOffice
|
||||||
|
|||||||
Reference in New Issue
Block a user