Skip to content

Instantly share code, notes, and snippets.

@DaffyDuke
Created May 31, 2017 08:46
Show Gist options
  • Save DaffyDuke/e7701a4f81577846c8dcde5916a60cf8 to your computer and use it in GitHub Desktop.
Save DaffyDuke/e7701a4f81577846c8dcde5916a60cf8 to your computer and use it in GitHub Desktop.
Foreman tips

Delete dans Foreman avec clean des certifs

On passe la machine en "managed" :

curl -k -s -u $user:$pass -H "Accept: version=2,application/json" -H "Content-Type: application/json" -X PUT  -d {\"host\":{\"managed\":true}} https://$foreman/api/hosts/$fqdn 

Puis on la supprime :

curl -k -s -u $user:$pass  -H "Accept: version=2,application/json" -H "Content-Type: application/json" -X DELETE https://$foreman/api/hosts/$fqdn 

Avec : $user ==> login foreman $pass ==> pass foreman $foreman ==> foreman url $fqdn ===> fqdn du server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment