2024-05-18 13:19:56 +02:00

33 lines
935 B
YAML

---
- name: mkdir ~/.ssh
connection: local
delegate_to: localhost
command:
cmd: "/usr/bin/incus exec {{ inventory_hostname }} -- mkdir -p /root/.ssh"
#- name: get authorized_keys
# connection: local
# delegate_to: localhost
# copy:
# src: authorized_keys
# dest: "/var/lib/incus/storage-pools/default/containers/{{ inventory_hostname }}/rootfs/root/.ssh/authorized_keys"
# owner: root
# group: root
# mode: 0600
- name: get authorized_keys
connection: local
delegate_to: localhost
get_url:
url: https://git.br0tkasten.de/br0tkasten.keys
dest: "/var/lib/incus/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
# command:
# cmd: "/usr/bin/incus exec {{ inventory_hostname }} -- chmod 0600 /root/.ssh/authorized_keys"