mirror of
https://gitlab.archlinux.org/archlinux/infrastructure.git
synced 2024-05-05 19:56:03 +02:00
4112bdf9fd
yaml: truthy value should be one of [false, true] (truthy) yaml: wrong indentation: expected 4 but found 2 (indentation) yaml: too few spaces before comment (comments) yaml: missing starting space in comment (comments) yaml: too many blank lines (1 > 0) (empty-lines) yaml: too many spaces after colon (colons) yaml: comment not indented like content (comments-indentation) yaml: no new line character at the end of file (new-line-at-end-of-file) load-failure: Failed to load or parse file parser-error: couldn't resolve module/action 'hosts'. This often indicates a misspelling, missing collection, or incorrect module path.
32 lines
978 B
YAML
32 lines
978 B
YAML
---
|
|
|
|
# We have to set up the rsync.net account in a weird fashion because
|
|
# they don't support ansible directly (no Python and such).
|
|
- name: create the root backup directory at {{ backup_dir }}
|
|
raw: mkdir -p {{ backup_dir }}
|
|
tags:
|
|
- skip_ansible_lint
|
|
|
|
- name: fetch ssh keys from each borg client machine
|
|
command: cat /root/.ssh/id_rsa.pub
|
|
register: client_ssh_keys
|
|
delegate_to: "{{ item }}"
|
|
with_items: "{{ backup_clients }}"
|
|
remote_user: root
|
|
changed_when: client_ssh_keys.changed
|
|
|
|
- name: create tempfile
|
|
tempfile: state=file
|
|
register: tempfile
|
|
delegate_to: localhost
|
|
|
|
- name: fill tempfile
|
|
copy: content="{{ lookup('template', 'authorized_keys.j2') }}" dest="{{ tempfile.path }}" mode=0644 # noqa 208
|
|
delegate_to: localhost
|
|
|
|
- name: upload authorized_keys file
|
|
command: scp "{{ tempfile.path }}" "{{ rsync_net_username }}@{{ inventory_hostname }}":.ssh/authorized_keys
|
|
delegate_to: localhost
|
|
register: scp
|
|
changed_when: "scp.rc == 0"
|