Use shell scripts to telnet to the server and modify the Saltstack configuration and restart the service

Source: Internet
Author: User
Tags saltstack

recently, the company added 40 servers for the last active function, although the server can be managed by saltstack (automated operations Tools Saltstack), the project can be released through Jenkins + Saltstack (using jenkins+ Saltstack+sh deploy the project to multiple servers, but before this need to get rid of the 40 server Saltstack configuration file Ah, can not be a server manually to deal with it (well, before you write this article on a half-day, really manual to modify, pit AH)

Because the public key has been added so that you can login without password directly

#!/bin/shIP=$1ssh"sed-i ' s/id:shop02/id:active30/g '/etc/salt/ Minion && Service salt-minion restart"

The script is basically

1. Log in to ${ip} on this server.

2. Replace the string id:shop02 in the/etc/salt/minion file with the Id:active30

3. Restart the Salt-minion service

Of course the feeling is not very good in this way, using the Python fabric module to handle the larger point.

Use shell scripts to telnet to the server and modify the Saltstack configuration and restart the service

Related Article

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.