Shell Scripting--03 Automated Deployment

Source: Internet
Author: User
Tags asymmetric encryption

1. Requirements

Server Master Agent Envtype

8.0.0.1 8.0.0.11 8.0.0.111 AAA

8.0.0.112

8.0.0.12 8.0.0.113

8.0.0.114

1. Get the list of machines in the document

/etc/ansible/hosts

[Server]
[Master]
[Agent]

2. contract to target Machine

2.1 Send flask to all machines

2.2 Be familiar with distributing the installation package to each node

3. Execute the Script

3.1 Installing FLASK, etc.--flask.sh

3.2 Configuring the server node--config_server.py

3.2.1 Get the native IP address, when ip=8.0.0.1, master=[8.0.0.11, 8.0.0.12]; agent=[8.0.0.111, 8.0.0.112, 8.0.0.113, 8.0.0.114]

3.2.2 The server ip=8.0.0.1 in the Task_server.json

...

3.3 Configuring the Master node

3.3.1 Get the native IP address, when ip=8.0.0.11, server=8.0.0.1; agent=[8.0.0.111, 8.0.0.112]

3.3.2 Modify the server ip=8.0.0.1,master ip= native IP in Task_agent.json, agent1 ip=8.0.0.111, Agent2 IP =8.0.0.112, envtype=aaa

...

3.4 Configuring the Agent Node

...

4. Implementation

2.json3.ansible add native SSH key to the target machine Authorized_keys

# Generate asymmetric Encryption public key

Ssh-keygen-t rsa-f ~/.ssh/id_rsa-p "

# enables the machine to access the target machine

Ssh-copy-id-i ~/.ssh/id_rsa.pub target user @ Target machine IP

3. Command

Reference Document: Https://www.cnblogs.com/yc913344706/p/7867554.html

Shell Scripting--03 Automated Deployment

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.