Files
pxe_boot_alma/work/KickStart/cfg/probe-config/L300-addDNS.sh
T
andersenandClaude Fable 5 6d398b826a refactor: move tree under homelab/, add alma10 hardening and kickstart docs
- restructure boot/kickstarts/scripts/docs into homelab/
- docs: alma9->10 breaking changes, CIS hardening, kickstart changes
- add find_cron_entries.sh helper and codex running memory notes

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-07-06 22:35:07 -04:00

44 lines
1.1 KiB
Bash

#
# Add host to IPA
#
if [ -z "$PROBE" ]; then
Warn "Probe name required for IPA host setup."
elif [ -z "$CUST" ]; then
Warn "Customer required for IPA host setup"
elif [ -z "$PADDR" ]; then
Warn "IP address required for IPA host setup"
else
TAB=/home/KickStart/ks/.tab/dnskey-monolith.tab
if echo "$PROBE" | grep -qv "iglass.net"; then
PROBE="$PROBE.iglass.net"
fi
ADD=0
echo "Adding host $PROBE to IPA"
#ipa dnsrecord-add iglass.net $PROBE --a-ip-address=$PADDR --a-create-reverse
if $SSH "kinit -k -t $TAB [email protected]; ipa host-show $PROBE 2>/dev/null" |grep -Eq "Principal.*$PROBE" ; then
if NotContinue "Probe $PROBE already exists in IPA. Delete?"; then
echo $SSH "kinit -k -t $TAB [email protected]; ipa host-del $PROBE --updatedns"
ADD=1
else
echo "Leaving probe in IPA as is"
fi
else
ADD=1
fi
if [ "$ADD" -eq 1 ]; then
$SSH "kinit -k -t $TAB [email protected]; ipa host-add $PROBE --ip-address=$PADDR --desc='$CUST' && ipa hostgroup-add-member probes --hosts $PROBE;"
fi
fi
Continue