Add know_host removing
This commit is contained in:
parent
72a80f83f7
commit
d08265517b
|
@ -70,6 +70,9 @@ info "Remove host from Prometheus"
|
||||||
sudo rm -f "/etc/prometheus/nodes/*${VMNAME}*"
|
sudo rm -f "/etc/prometheus/nodes/*${VMNAME}*"
|
||||||
sudo systemctl restart prometheus
|
sudo systemctl restart prometheus
|
||||||
|
|
||||||
|
info "Remove from know_host"
|
||||||
|
ssh-keygen -R "${VMNAME}"
|
||||||
|
|
||||||
info "Remove host from Rudder"
|
info "Remove host from Rudder"
|
||||||
RUDDER_ID=$(curl -s -X GET -H 'Content-Type: application/json' -H "X-API-Token: ${RUDDER_API_TOKEN}" -H "X-API-Version: 12" "${RUDDER_SRV}/rudder/api/nodes" | jq --raw-output '.data.nodes[] | select(.hostname=="'${VMNAME}'") | .id')
|
RUDDER_ID=$(curl -s -X GET -H 'Content-Type: application/json' -H "X-API-Token: ${RUDDER_API_TOKEN}" -H "X-API-Version: 12" "${RUDDER_SRV}/rudder/api/nodes" | jq --raw-output '.data.nodes[] | select(.hostname=="'${VMNAME}'") | .id')
|
||||||
curl -s -X DELETE -H 'Content-Type: application/json' -H "X-API-Token: ${RUDDER_API_TOKEN}" -H "X-API-Version: 12" "${RUDDER_SRV}/rudder/api/nodes/${RUDDER_ID}" &> /dev/null
|
curl -s -X DELETE -H 'Content-Type: application/json' -H "X-API-Token: ${RUDDER_API_TOKEN}" -H "X-API-Version: 12" "${RUDDER_SRV}/rudder/api/nodes/${RUDDER_ID}" &> /dev/null
|
||||||
|
|
Loading…
Reference in New Issue