--- - name: Create repository on borg server ansible.builtin.file: path: "{{ borgmatic_server.repo_path }}/{{ inventory_hostname }}" state: directory owner: "{{ borgmatic_server.user }}" group: "{{ borgmatic_server.group }}" mode: u=rwX,g=rX,o= become: true delegate_to: "{{ borgmatic_server.host }}" - name: Deploy public key on borg server ansible.posix.authorized_key: user: "{{ borgmatic_server.user }}" state: present key: "{{ key['content'] | b64decode }}" key_options: 'command="cd {{ borgmatic_server.repo_path }}/{{ inventory_hostname }};borg serve --restrict-to-path {{ borgmatic_server.repo_path }}/{{ inventory_hostname }}",restrict' become: true delegate_to: "{{ borgmatic_server.host }}"