lots o stuff

This commit is contained in:
2024-07-13 08:28:27 -07:00
parent c129987f29
commit 6a94530dc7
11 changed files with 54 additions and 1 deletions

View File

@@ -101,7 +101,7 @@ roles_path = ./roles
# default user to use for playbooks if user is not specified
# (/usr/bin/ansible will use current user as default)
remote_user = ansible
remote_user = root
# logging is off by default unless this path is defined
# if so defined, consider logrotate

6
backup_vps.yml Normal file
View File

@@ -0,0 +1,6 @@
---
- name: Backup VPS Config
hosts: backup_vps
become: yes
roles:
- role: backup_vps_base

View File

@@ -1,2 +1,5 @@
[workstation]
localhost ansible_connection=local
[backup_vps]
66.42.65.75

View File

@@ -0,0 +1 @@
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDggQXO5cPThq78XBxiN8q0qD2zoeEzXSykbFwiIiR2Le46ePXd24mkRxh9U/i5D9Xwc1/9TIIhf5HJ7sKWJLREzSu74RRPEp6wJgIMuCi8FSJ+36UM3DtKMl+s+F6f2Z9ZG1mL61mteGwAsqVFvtIprR2Tvz3J1ALJntlvighkvGVlbUZBFfh8thxFjTjtNDppxgrpl6weHWL3qR/GEXuF/dx4cXPxChb6S2bCLCQulRlR8AFA3Qe3APEjyg7uKFG29sjOQiZyZTNdrJYc1GzoGinp9KUh8jNW8Q2XABePA5yVQv+xE+v5FzTy+GELBFBAJPgWbaOnwVwQaCRMd8Kic5V9oRZFJeIjygaHx2W6cDOOet2jv57/UGMPBS3PQ+qmXZCRt/Q6uB5Pf/H63k5HPuk26zfw40fdUyJqNI5GEhJ+pw8uhfly1JU50uSbc6xfH0c82VT+QOO3SS/bCfuvjEUTkWzlFXe1QV/I7scOFTnD7x5THwZ7/1Ks+lSdEqE= opal@x1

View File

@@ -0,0 +1,6 @@
---
- name: Restart SSH
become: yes
service:
name: ssh
state: restarted

View File

@@ -0,0 +1,31 @@
---
- name: Ensure backup user exists
user:
name: "{{ backup_user }}"
state: present
shell: /bin/bash
- name: Create .ssh directory
file:
path: /home/{{ backup_user }}/.ssh
state: directory
owner: "{{ backup_user }}"
group: "{{ backup_user }}"
mode: '0700'
- name: Copy public key to authorized_keys
copy:
src: "{{ public_key_path }}"
dest: /home/{{ backup_user }}/.ssh/authorized_keys
owner: "{{ backup_user }}"
group: "{{ backup_user }}"
mode: '0600'
- name: Create backups dir for mount point
file:
path: "{{ mount_point }}"
state: directory
owner: "{{ backup_user }}"
group: "{{ backup_user }}"
mode: '0755'
when: mount_device is defined and mount_device != ""

View File

@@ -0,0 +1,5 @@
---
backup_user: backup
public_key_path: files/backup_rsa.pub
mount_device: /dev/vdb
mount_point: /home/backup/backups

View File

@@ -14,6 +14,7 @@ wm_packages:
- wdisplays
general_packages:
- borgmatic
- cups
- docker
- keychain