Changing name of salt minion CentsOS 7

We run into situation when we needed to change name of already added salt minion. Here is few simple steps that will get this done.

On Salt minion

Stop the Salt-Minion Service

systemctl stop salt-minion

Delete the current keys

cd /etc/salt/pki/minion/
rm -rf minion.pub minion.pem

Change the minions id in /etc/salt/minion_id

vim /etc/salt/minion_id
myminion.prolinuxhub.com

On Salt Master

Delete the key for our salt minion

salt-key -d myminion.prolinuxhub.com

Back to Salt minion
Restart Salt minion service

systemctl stop salt-minion

View all Unaccepted keys and make sure our minion is on the list

salt-key -L

On the Salt Master Accept the key

salt-key --accept=myminion.prolinuxhub.com

Vie accepted keys and make sure our minion is on the list

salt-key -L