Fix(BorgServer): Change variable syntax

This commit is contained in:
Bertrand Benjamin 2018-11-11 09:05:50 +01:00
parent 24d07cd8d1
commit 1fb153b427
1 changed files with 23 additions and 23 deletions

View File

@ -6,62 +6,62 @@
- name: Add borgbackup group - name: Add borgbackup group
group: group:
name: "{{ borg_group }}" name: "{{ borg.group }}"
state: present state: present
- name: Add borgbackup user - name: Add borgbackup user
user: user:
name: "{{ borg_user }}" name: "{{ borg.user }}"
shell: /bin/bash shell: /bin/bash
home: "{{ borg_home }}" home: "{{ borg.home }}"
createhome: yes createhome: yes
group: "{{ borg_group }}" group: "{{ borg.group }}"
state: present state: present
- name: Fix permission on borgbackup home - name: Fix permission on borgbackup home
file: file:
path: "{{ borg_home }}" path: "{{ borg.home }}"
owner: "{{ borg_user }}" owner: "{{ borg.user }}"
group: "{{ borg_group }}" group: "{{ borg.group }}"
mode: 0700 mode: 0700
state: directory state: directory
- name: Fix .ssh permision - name: Fix .ssh permision
file: file:
path: "{{ borg_home }}/.ssh" path: "{{ borg.home }}/.ssh"
owner: "{{ borg_user }}" owner: "{{ borg.user }}"
group: "{{ borg_group }}" group: "{{ borg.group }}"
mode: 0700 mode: 0700
state: directory state: directory
- name: Fix pool permission - name: Fix pool permission
file: file:
path: "{{ borg_pool }}" path: "{{ borg.pool }}"
owner: "{{ borg_user }}" owner: "{{ borg.user }}"
group: "{{ borg_group }}" group: "{{ borg.group }}"
mode: 0700 mode: 0700
state: directory state: directory
- name: Add autorized backup user through $HOME/.ssh/authorized_keys - name: Add autorized backup user through $HOME/.ssh/authorized_keys
authorized_key: authorized_key:
user: "{{ borg_user }}" user: "{{ borg.user }}"
key: "{{ item.key }}" key: "{{ item.key }}"
key_options: 'command="cd {{ borg_pool }}/{{ item.host }};borg serve --restrict-to-path {{ borg_pool }}/{{ item.host }}",restrict' key_options: 'command="cd {{ borg.pool }}/{{ item.host }};borg serve --restrict-to-path {{ borg.pool }}/{{ item.host }}",restrict'
with_items: "{{ borg_auth_users }}" with_items: "{{ borg.auth_users }}"
- name: Fix permission on authorized_keys - name: Fix permission on authorized_keys
file: file:
path: "{{ borg_home }}/.ssh/authorized_keys" path: "{{ borg.home }}/.ssh/authorized_keys"
owner: "{{ borg_user }}" owner: "{{ borg.user }}"
group: "{{ borg_group }}" group: "{{ borg.group }}"
mode: 0600 mode: 0600
state: file state: file
- name: Fix permission on each repo - name: Fix permission on each repo
file: file:
path: "{{ borg_pool }}/{{ item.host }}" path: "{{ borg.pool }}/{{ item.host }}"
owner: "{{ borg_user }}" owner: "{{ borg.user }}"
group: "{{ borg_group }}" group: "{{ borg.group }}"
mode: 0700 mode: 0700
state: directory state: directory
with_items: "{{ borg_auth_users }}" with_items: "{{ borg.auth_users }}"