How to delete salt masters connected to the RAAS that were authenticated using username:password method
search cancel

How to delete salt masters connected to the RAAS that were authenticated using username:password method

book

Article ID: 373637

calendar_today

Updated On:

Products

VMware Aria Suite

Issue/Introduction

When salt master is connected to the RAAS with authentication method configured "username:password" you cannot delete  salt masters  with the following  method "set_master_key_state" because there is no key to delete.  

To delete the salt master use the following API client.api.master.delete_master(master)

Resolution

To delete salt master follow the steps from below: 

  1. Always be  sure that you have a backup or snapshot of the raas database
  2. Get the list of the masters using API, like curl

    curl  --insecure --request POST https://localhost/rpc --user root:salt --data '{"resource": "master", "method": "get_master_presence"}' --cookie "_xsrf=fred" --header "X-Xsrftoken: fred" --header 'Content-Type: application/json'| jq . | grep 'master_id' | grep masterpatterntodelete

     

    where: 

    root:salt - is the username and password of local RAAS user
    localhost - is the FQDN or IP of RAAS
    masterpatterntodelete - is the search part of masters you want to remove 

  3. Delete master using API

    curl -vv  --insecure --request POST https://localhost/rpc --user root:salt  --data '{"resource":"master","method":"delete_master","kwarg":{"master_id":"saltstack_enterprise_installer"}}' --cookie "_xsrf=fred" --header "X-Xsrftoken: fred" --header 'Content-Type: application/json'


    where
    saltstack_enterprise_installer - is the id of the master you want to delete