1
0
Fork 0
mirror of https://github.com/JasonN3/build-container-installer.git synced 2025-12-25 10:57:55 +01:00

run as post actions

This commit is contained in:
Jason N. 2024-03-10 09:47:26 -04:00
parent 476629cee9
commit 541ac7d1f1

View file

@ -190,6 +190,10 @@ jobs:
poweroff
user --name=core --groups=wheel --password=foobar
%include /usr/share/anaconda/interactive-defaults.ks
%post
systemctl disable firewalld
systemctl enable sshd
%end
EOF
xorriso -dialog on << EOF
-indev deploy.iso
@ -227,13 +231,6 @@ jobs:
(tail -f vm.stdin | nc localhost 4321 | tee vm.stdout) &
timeout 30m bash -c "while ! (grep 'login:' vm.stdout); do sleep 1; done"
echo "${VM_USER}" >> vm.stdin
timeout 30m bash -c "while ! (grep 'Password:' vm.stdout); do sleep 1; done"
echo "${VM_Pass}" >> vm.stdin
echo > vm.stdout
timeout 30m bash -c "while ! (grep '#\|\$' vm.stdout); do sleep 1; done"
echo "sudo systemctl start sshd" >> vm.stdin
( timeout 30m bash -c "while ! (grep 'Password' vm.stdout); do sleep 1; done" && echo "${VM_PASS}" >> vm.stdin ) || true
export VM_IP=$({ echo '{"execute": "guest-network-get-interfaces"}'; sleep 2; } | socat unix-connect:/tmp/qga.sock - | jq -r '.return[1]["ip-addresses"][] | select(."ip-address-type"=="ipv4") | .["ip-address"]')
if ! (echo > /dev/tcp/${VM_IP}/22)