mirror of
https://git.valherun.com/valherun/pxe_boot_alma.git
synced 2026-10-15 22:22:03 -04:00
- 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]>
44 lines
1.1 KiB
Bash
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
|