def remove_service(module, service_id):
 consul_api = get_consul_api(module)
 service = get_service_by_id_or_name(consul_api, service_id)
 if service:
  consul_api.agent.service.deregister(service_id)
  module.exit_json(changed=True, id=service_id)
 module.exit_json(changed=False, id=service_id)

def remove_service ( module , service_id ) : consul_api = get_consul_api ( module ) service = get_service_by_id_or_name ( consul_api , service_id ) if service : consul_api . agent . service . deregister ( service_id ) module . exit_json ( changed = True , id = service_id ) module . exit_json ( changed = False , id = service_id )
delete a service .