由于我们使用ansible进行快速安装,所以我们要修改下面两个配置文件即可
新添加的机器和ansible的机器需要跟之前的一样,配置好免密钥登陆

修改ansible的配置文件

添加新的机器IP

[root@jumpserver ~]# cat /etc/ansible/hosts
[bootstrap]
3.115.184.172
[master]
18.177.76.161
54.178.234.17
[private]
52.198.146.9
[public]
13.115.17.255
18.177.164.22
18.177.242.51

测试下连通性

[root@jumpserver ~]# ansible all -m ping
18.177.164.22 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
54.178.234.17 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
3.115.184.172 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
13.115.17.255 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
18.177.76.161 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
18.177.242.51 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}
52.198.146.9 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "ping": "pong"
}

修改文件inventory

添加新机器IP

[root@jumpserver ~]# cd .ansible/collections/ansible_collections/dcos/dcos_ansible/dcos-ansible-0.52.0/
[root@jumpserver dcos-ansible-0.52.0]# ls
ansible.cfg  dcos.yml  Dockerfile  group_vars  inventory  inventory.example  Jenkinsfile  molecule  README.md  roles  TESTING.MD  test_requirements.txt
[root@jumpserver dcos-ansible-0.52.0]# cat inventory
[bootstraps]
3.115.184.172
[masters]
18.177.76.161
18.177.76.161
[agents_private]
52.198.146.9
[agents_public]
13.115.17.255
18.177.164.22
18.177.242.51
[bootstraps:vars]
12-20 16:44