Skip to content

Commit

Permalink
infra/image/system-service/fixipaip.sh: Behave idempotent
Browse files Browse the repository at this point in the history
This makes sure that the service is not failing on already applied
modifications.
  • Loading branch information
t-woerner committed Oct 1, 2024
1 parent ba5c5ce commit 2fac618
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions infra/image/system-service/fixipaip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ for zone in ${ZONES}; do
echo "ERROR: Failed to get old PTR from '${zone}': '${OLD_PTR}'"
else
ipa dnsrecord-mod "${zone}" "${OLD_PTR}" --ptr-rec="${HOSTNAME}." \
--rename="${PTR}"
--rename="${PTR}" || true
fi
else
echo "Fixing forward zone ${zone}:"
ipa dnsrecord-mod test.local "${HOSTNAME%%.*}" --a-rec="$IP"
ipa dnsrecord-mod test.local ipa-ca --a-rec="$IP"
ipa dnsrecord-mod test.local "${HOSTNAME%%.*}" --a-rec="$IP" || true
ipa dnsrecord-mod test.local ipa-ca --a-rec="$IP" || true
fi
done

ipa dnsserver-mod "${HOSTNAME}" --forwarder="${FORWARDER}"
ipa dnsserver-mod "${HOSTNAME}" --forwarder="${FORWARDER}" || true

kdestroy -c "${KRB5CCNAME}" -A

Expand Down

0 comments on commit 2fac618

Please sign in to comment.