Skip to content

Commit 23c9cad

Browse files
committed
guestfs: bringup: fix ssh key injection
Fixes error: sudo virt-sysprep -a /var/lib/libvirt/images/kdevops/guestfs/debian13/root.raw \ --hostname debian13 --ssh-inject \ kdevops:file:/media/tarkir/dagomez/src/linux-kdevops/ kdevops/guestfs/debian13/ssh/id_ed25519.pub \ --timezone Etc/UTC [ 0.0] Examining the guest ... [ 2.2] Performing "abrt-data" ... [ 2.2] Performing "backup-files" ... [ 2.3] Performing "bash-history" ... ... [ 3.2] Performing "customize" ... [ 3.2] Setting a random seed virt-sysprep: warning: random seed could not be set for this type of guest [ 3.3] Setting the machine ID in /etc/machine-id [ 3.3] Setting the hostname: debian13 [ 4.0] SSH key inject: kdevops virt-sysprep: error: ssh-inject: the user kdevops does not exist on the guest If reporting bugs, run virt-sysprep with debugging enabled and include the complete output: virt-sysprep -v -x [...] Generated-by: Claude AI Signed-off-by: Daniel Gomez <[email protected]>
1 parent 7a8fba2 commit 23c9cad

File tree

1 file changed

+12
-0
lines changed
  • playbooks/roles/guestfs/tasks/bringup

1 file changed

+12
-0
lines changed

playbooks/roles/guestfs/tasks/bringup/main.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@
5858
- "{{ root_image }}"
5959
- "--hostname"
6060
- "{{ inventory_hostname }}"
61+
- "--run-command"
62+
- "useradd -s /bin/bash -m kdevops || true"
63+
- "--run-command"
64+
- "echo 'kdevops ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/kdevops"
65+
- "--password"
66+
- "kdevops:password:kdevops"
6167
- "--ssh-inject"
6268
- "kdevops:file:{{ ssh_key }}.pub"
6369
- "--timezone"
@@ -73,6 +79,12 @@
7379
- "{{ root_image }}"
7480
- "--hostname"
7581
- "{{ inventory_hostname }}"
82+
- "--run-command"
83+
- "useradd -s /bin/bash -m kdevops || true"
84+
- "--run-command"
85+
- "echo 'kdevops ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/kdevops"
86+
- "--password"
87+
- "kdevops:password:kdevops"
7688
- "--ssh-inject"
7789
- "kdevops:file:{{ ssh_key }}.pub"
7890
- "--timezone"

0 commit comments

Comments
 (0)