


echo "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI0+RoNm8IB+dXYwk9JkXb6a/fGXAtxj+0TOpE8t9/ZQrn2fDJuRK33W+gK+MJ8XOWWIkqiLW7/Hsjd5fpOecLQ= root@ops-01.ecs.io
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBAoiW8JzVq18VHnQfS4M6uqV6rApixlV6BZ//GsoKrXL4HClc1TmPj3DOb10Fpnj2VAwW5WqWu1ELPIwJV66U+k= root@ops-02.ecs.io
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBO6IjOcco9eAvA/T7LDsylCgjKJlLrVXY1zxO1/mX/MTzVZGuAhbikFJT2ZN2Up8iED+pJwpcps3LlA1wOjQC3Q= root@ops-04.ecs.io
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBC5RPqzYKLWVz+LvXaM+Jfz48nMMYRa35TB/+tG2QIxBownA/3+cC4tWFqntbtDrRcp2MHv7xzhTuwJEgHdpZbE= root@ops-03.ecs.io" >> /root/.ssh/authorized_keys


echo "192.168.34.232 vip.ecs.io
192.168.12.242 harbor.sre.cdcyy.cn
192.168.92.185 harbor.cdcyy.com.cn
192.168.39.4 harbor-qa.sre.cdcyy.cn" >> /etc/hosts

# ops-04 执行
export ip=192.168.34.240

cd /root/wdd

ssh root@${ip} "mkdir -p /root/wdd"
scp /root/wdd/octopus-agent_linux_amd64 root@${ip}:/root/wdd/
scp /root/wdd/docker-amd64-20.10.15.tgz root@${ip}:/root/wdd/
scp /root/wdd/docker-compose-linux-x86_64-v2.18.0 root@${ip}:/root/wdd/

ssh root@${ip} "chmod +x /root/wdd/octopus-agent_linux_amd64"
ssh root@${ip} "printf 'firewall\n' | /root/wdd/octopus-agent_linux_amd64 --mode=bastion"
ssh root@${ip} "printf 'sysconfig\n' | /root/wdd/octopus-agent_linux_amd64 --mode=bastion"
ssh root@${ip} "printf 'swap\n' | /root/wdd/octopus-agent_linux_amd64 --mode=bastion"
ssh root@${ip} "printf 'selinux\n' | /root/wdd/octopus-agent_linux_amd64 --mode=bastion"
ssh root@${ip} "printf 'docker\n' | /root/wdd/octopus-agent_linux_amd64 --mode=bastion"
ssh root@${ip} "printf 'dockercompose\n' | /root/wdd/octopus-agent_linux_amd64 --mode=bastion"