Salt-stack replacing host names

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.