2023-08-23 15:08:21 +02:00

21 lines
568 B
YAML

---
- name: mkdir ~/.ssh
connection: local
delegate_to: localhost
raw: "lxc exec {{ inventory_hostname }} -- mkdir -p /root/.ssh"
- name: get authorized_keys
connection: local
delegate_to: localhost
copy:
src: authorized_keys
dest: "/var/lib/lxd/storage-pools/default/containers/{{ inventory_hostname }}/rootfs/root/.ssh/authorized_keys"
owner: root
group: root
mode: 0600
- name: fix file permissions
connection: local
delegate_to: localhost
raw: "lxc exec {{ inventory_hostname }} -- chmod 0600 /root/.ssh/authorized_keys"