commit inicial
This commit is contained in:
42
tasks/main.yml
Normal file
42
tasks/main.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
---
|
||||
- name: instalar borg
|
||||
apt:
|
||||
name: borgbackup
|
||||
state: present
|
||||
|
||||
- name: crear usuario borg
|
||||
user:
|
||||
name: "{{ borg_user }}"
|
||||
home: "{{ borg_home }}"
|
||||
shell: /bin/bash
|
||||
system: yes
|
||||
|
||||
- name: crear directorio {{ borg_repo_path }}
|
||||
file:
|
||||
path: "{{ borg_repo_path }}"
|
||||
owner: "{{ borg_user }}"
|
||||
state: directory
|
||||
recurse: yes
|
||||
|
||||
- name: crear enlace {{ borg_home }}/{{ borg_repo_name }}
|
||||
when: borg_repo_path != (borg_home+'/'+borg_repo_name)
|
||||
file:
|
||||
path: "{{ borg_home }}/{{ borg_repo_name }}"
|
||||
src: "{{ borg_repo_path }}"
|
||||
owner: "{{ borg_user }}"
|
||||
state: link
|
||||
|
||||
- name: crear directorio .ssh para borg
|
||||
file:
|
||||
path: "{{ borg_home }}/.ssh"
|
||||
owner: "{{ borg_user }}"
|
||||
state: directory
|
||||
mode: go-rwx
|
||||
|
||||
- name: permitir login root
|
||||
when: borg_user == "root"
|
||||
lineinfile:
|
||||
name: "/etc/ssh/sshd_config"
|
||||
state: "absent"
|
||||
regexp: '^\s*PermitRootLogin\s+no'
|
||||
notify: restart ssh
|
||||
Reference in New Issue
Block a user