Wednesday, October 6, 2021

thumbnail

How to re-register salt-key on salt-master

Re-register salt-key on salt-master when you are having issue for the key to be registered in salt-master



Perform the following steps on the salt-minion side to fix the hostname issue on the salt-master.

1. Update the /etc/hosts file with the correct hostname that you want to be

2. Then on salt-minion stop salt-minion service

# systemctl stop salt-minion
OR
# service salt-minion stop

3. Delete the salt-minion keys. you need to find the salt-minion key location and then remote minion.pem and minion.pub keys.

# rm -rf /opt/salt/etc/pki/minion/minion.p*
/opt/salt/etc/pki/minion
    - minion.pem
    - minion.pub

Perform the following steps on the salt-master side to fix the hostname issue

1. Delete the salt-key for the respective server

# salt-key -d acg-vm1.acg.com

2. After that restart the salt-minion service on the client side.

# systemctl restart salt-minion

3. Then you can verify on salt-master with the following command to find if the key is registered.

# salt-key -L | grep acg-vm1

4. once the key shows in salt-master then you should be able to push the configuration changes to the client which is salt-minion

5. To verify the salt-minion service on the client side use the following command

# systemctl status salt-minion
# service salt-minion status
Redirecting to /bin/systemctl status salt-minion.service
\u25cf salt-minion.service - The Salt Minion
   Loaded: loaded (/usr/lib/systemd/system/salt-minion.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2021-08-06 23:35:55 EDT; 1 months 29 days ago
     Docs: man:salt-minion(1)
           file:///usr/share/doc/salt/html/contents.html
           https://docs.saltstack.com/en/latest/contents.html
 Main PID: 1008 (python2.7)
   CGroup: /system.slice/salt-minion.service
           \u251c\u25001008 /opt/salt/bin/python2.7 /opt/salt/bin/salt-minion --config-dir=/opt/salt/etc
           \u251c\u25001769 /opt/salt/bin/python2.7 /opt/salt/bin/salt-minion --config-dir=/opt/salt/etc
           \u2514\u25001776 /opt/salt/bin/python2.7 /opt/salt/bin/salt-minion --config-dir=/opt/salt/etc

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.


Subscribe by Email

Follow Updates Articles from This Blog via Email

No Comments

Powered by Blogger.