This commit is contained in:
2024-10-22 12:40:42 -07:00
parent c0f842626e
commit 952fb30972
3 changed files with 5 additions and 30 deletions

View File

@@ -1,31 +1,6 @@
---
- name: Ensure backup user exists
- name: Ensure admin user exists
user:
name: "{{ backup_user }}"
name: "{{ admin_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 != ""