Scripted remote removal of server from Satellite 5

Latest response

I am looking for a scripted/automated remote method of removing a server from Satellite, basically the reverse of rhnreg_ks

This is to be executed as part of the teardown stage of life cycle management and can either be executed from the host before it is 'torn down' or alternatively can be executed from one of the orchestration servers. In both instances, the servers making the call are 'remote' (ie. not the Satellite server)

Currently I am looking at a using a spacecmd call from either the server or the orchestration infrastructure with an API call using spacecmd:

spacecmd system_delete <hostname>

Can anyone think of a better/more elegant solution?
Is anyone else doing automated removal remotely? (rather than cleaning up unresponsive hosts on the Satellite server itself)

Responses