Skip to content

Instantly share code, notes, and snippets.

@mbaldessari
Last active March 17, 2020 09:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbaldessari/d356ef76d68ff8636a3d73b1cd968269 to your computer and use it in GitHub Desktop.
Save mbaldessari/d356ef76d68ff8636a3d73b1cd968269 to your computer and use it in GitHub Desktop.
Clean freeipa from spurious hosts
# To delete all hosts that are not freeipa and undercloud
# Go to freeipa-0 and open /tmp/freeipa-setup.env
# look for AdminPassword
kinit admin
# Type in AdminPassword
D='redhat.local'
for i in $(ipa host-find |grep 'Host name:' | awk '{ print $3 }' | grep -v -e freeipa-0 -e undercloud-0 -e "ctlplane.$D" -e "$D" -e "internalapi.$D" -e "storage.$D" -e "storagemgmt.$D"); do ipa host-del "$i"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment