Files
CmiiDeploy/53-202501-江西扩容/批量任务.sh
2025-02-21 14:00:16 +08:00

40 lines
1.7 KiB
Bash

rm octopus-agent_linux_amd64
wget http://42.192.52.227:9000/octopus/octopus-agent_linux_amd64
host_list=(10.129.80.217)
host_list=(10.20.1.133 10.20.1.134)
host_list=(10.20.1.141 10.20.1.142 10.20.1.144 10.20.1.145)
for server in "${host_list[@]}";do
echo "current ip is $server"
# scp /home/app/octopus-agent_linux_amd64 app@${server}:/home/app/octopus-agent_linux_amd64
# scp /root/wdd/disk.sh root@${server}:/root/wdd/
# ssh root@${server} "bash /root/wdd/disk.sh && lsblk"
# scp /root/wdd/docker-amd64-20.10.15.tgz root@${server}:/root/wdd/docker-amd64-20.10.15.tgz
# scp /root/wdd/docker-compose-linux-x86_64-v2.18.0 root@${server}:/root/wdd/
# ssh root@${server} "printf 'firewall\n' | octopus-agent --mode=bastion"
# ssh root@${server} "printf 'sysconfig\n' | octopus-agent --mode=bastion"
# ssh root@${server} "printf 'swap\n' | octopus-agent --mode=bastion"
# ssh root@${server} "printf 'selinux\n' | octopus-agent --mode=bastion"
# ssh root@${server} "printf 'docker\n' | octopus-agent --mode=bastion"
# ssh root@${server} "printf 'dockercompose\n' | octopus-agent --mode=bastion"
# scp /etc/docker/daemon.json root@${server}:/etc/docker/daemon.json
# ssh root@${server} "systemctl restart docker"
# ssh root@${server} "docker info"
ssh root@${server} "yum install -y nfs-utils && systemctl enable nfs-client"
done
rm -f /usr/local/bin/octopus-agent
mv -f /home/app/octopus-agent_linux_amd64 /usr/local/bin/octopus-agent
chmod +x /usr/local/bin/octopus-agent
printf 'sshkey\n' | octopus-agent --mode=bastion
printf 'sshconfig\n' | octopus-agent --mode=bastion
# 修改可以使用root登录
cp /etc/ssh/sshd_config /etc/ssh/sshd_config_back
sed -i