From cdf66d507d77ac1deabe960c1b7a3326a508df1e Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Wed, 12 Jul 2023 13:06:24 +0200 Subject: [PATCH] image: improve ansibleprep run Make it more likely we'll call ansible-poll at first boot. If there's no internet connectivity on first boot we woudln't ansible- poll until the crontab called it. Instead we now run ansibleprep every time and exit if our hostname isn't poudriere-image (i.e. if we've actually run the first ansible- poll call). --- image/overlay/domotica/etc/rc.d/ansibleprep | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/image/overlay/domotica/etc/rc.d/ansibleprep b/image/overlay/domotica/etc/rc.d/ansibleprep index 9d557b2..e778aba 100755 --- a/image/overlay/domotica/etc/rc.d/ansibleprep +++ b/image/overlay/domotica/etc/rc.d/ansibleprep @@ -4,7 +4,6 @@ # PROVIDE: ansibleprep # REQUIRE: DAEMON # BEFORE: LOGIN -# KEYWORD: firstboot . /etc/rc.subr @@ -13,6 +12,14 @@ start_cmd="ansibleprep_start" ansibleprep_start() { + # Only do this until we've set the hostname, which we use as a proxy for + # 'initial config done, reverse ssh tunnel ready' + # We do do a daily poll, so worst case it'll eventually work out. + if [ $(hostname) != "poudriere-image" ]; + then + exit 0 + fi + export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin # Just enough so kp can log in -- 2.51.0