Author:headsen Chen
Date:2018-09-30 11:22:40
1, establish normal connection between master and client side
#MasterYum-y Install epel-Releaseyum-Y Install satl-mastersed-I.'s/#auto_aucept false/auto_accept true/g'/etc/salt/Master/etc/salt-maser Restart
#MinionYum-y Install epel-Releaseyum-Y Install satl-mastersed-I.'s/salt:master/salt:192.168.1.130/g'/etc/init.d/satl-Minion Restart#MasterSalt-key#Wait 2 minutes, there's a client key coming up.Salt'*'Test.ping
2, impersonate the client to modify host name
1, Minion end stop service/etc/init.d/salt-Minion Stop2, the master side deletes the corresponding Keysalt-key-d jack.com#jack.com is the ID of the Minion end3, minion-side modify hostname sed-I.'s/hostname=jack.com/hostname=tom.com/g'/etc/sysconfig/networkhostname tom.com4, the Minion end removes the original IDRM-f/etc/salt/minion_idrm-rf/etc/salt/PKI5, minion-side enable service/etc/init.d/salt-Minion Restart6, view the newly received idsalt on the master side-key#wait 2 minutesSatl'tom.com'Cmd.run'hostname'
Salt-stack replacing host names