two-images: rocky10, chrony sur les seuls serveurs NTP du DHCP #1

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-11-05 23:49:52 +01:00
commit a990c5a33e
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
4 changed files with 17 additions and 1 deletions

View file

@ -132,6 +132,12 @@ cloud_init_done () {
vm 'cloud-init status --wait' | grep -q 'status: done'
}
no_ntp_source () {
local sources
sources=$(vm 'chronyc -n -c sources') || return 1
[ -z "${sources}" ]
}
image="${1:-}"
if [ -z "${image}" ] || [ ! -f "${DIST}/${image}.qcow2" ]; then
die "usage : ${0} <image> (fichier ${DIST}/<image>.qcow2)"
@ -158,6 +164,9 @@ check "aucune clé de construction" vm '! sudo grep -rq two-images-build /home /
if vm 'command -v getenforce' >/dev/null; then
check "SELinux désactivé" test "$(vm getenforce)" = Disabled
fi
if vm 'command -v chronyc' >/dev/null; then
check "aucune source NTP hors DHCP (QEMU n'en annonce pas)" no_ntp_source
fi
BOOT=$(boot_id)
vm_closing 'sudo systemctl reboot'
wait_reboot "${BOOT}"