Commit 3a8e0f0
committed
guestfs: bringup: fix ssh key injection
This ensures the user exists before any SSH operations and uses
the standardized virt-builder.j2 template for consistent image
customization.
The custom-image role now:
* Detects the control host's kdevops UID and preserves it in guests
* Uses virt-builder.j2 template for all customization commands
* Handles both system and non-system libvirt configurations
* Creates temporary command files and cleans them up properly
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 a5a119d commit 3a8e0f0
File tree
2 files changed
+84
-0
lines changed- playbooks/roles
- base_image/tasks
- guestfs/tasks
2 files changed
+84
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
88 | 160 | | |
89 | 161 | | |
90 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
34 | 46 | | |
35 | 47 | | |
36 | 48 | | |
| |||
0 commit comments