fix ssh authorized_keys

This commit is contained in:
2023-08-23 15:08:21 +02:00
parent e56b7e0088
commit b510009b92
3 changed files with 15 additions and 7 deletions

View File

@ -2,20 +2,20 @@
- name: install basics
connection: local
delegate_to: localhost
raw: "lxc exec {{ inventory_hostname }} -- /usr/sbin/pacman -Syu --noconfirm python3 dropbear dropbear-scp wget"
raw: "lxc exec {{ inventory_hostname }} -- /usr/sbin/pacman -Syu --noconfirm python3 openssh wget"
- name: setup ssh
include: ssh.yml
- name: enable dropbear
- name: enable sshd
connection: local
delegate_to: localhost
raw: "lxc exec {{ inventory_hostname }} -- systemctl enable dropbear"
raw: "lxc exec {{ inventory_hostname }} -- systemctl enable sshd"
- name: enable dropbear
- name: start dropbear
connection: local
delegate_to: localhost
raw: "lxc exec {{ inventory_hostname }} -- systemctl restart dropbear"
raw: "lxc exec {{ inventory_hostname }} -- systemctl restart sshd"
- name: install software
pacman: name={{ archlinux_software }} state=present update_cache=yes

View File

@ -6,8 +6,13 @@
- name: get authorized_keys
connection: local
delegate_to: localhost
raw: "lxc exec {{ inventory_hostname }} -- wget -O /root/.ssh/authorized_keys https://git.br0tkasten.de/br0tkasten/configs/raw/branch/master/dotfiles/authorized_keys"
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