加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Vagrantfile 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
buxiaomo 提交于 2021-10-08 11:14 . add default
# -*- mode: ruby -*-
# vi: set ft=ruby :
hosts = {
"ansible" => "192.168.22.10",
"node01" => "192.168.22.11",
"node02" => "192.168.22.12",
"node03" => "192.168.22.13",
"node04" => "192.168.22.14"
}
Vagrant.configure("2") do |config|
hosts.each do |name, ip|
config.vm.define name do |machine|
machine.vm.box = "ubuntu/focal64"
machine.vm.box_check_update = false
machine.ssh.insert_key = false
machine.vm.hostname = name
# machine.vm.synced_folder "./.ssh", "/root/.ssh"
machine.vm.network :private_network, ip: ip
machine.vm.provider "virtualbox" do |v|
v.name = name
v.memory = 1024
v.cpus = 1
end
machine.vm.provision "shell", inline: <<-SHELL
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install git make -y
sudo apt-get dist-upgrade -y
sudo cp /vagrant/.ssh/id_rsa /home/vagrant/.ssh/id_rsa
sudo cp /vagrant/.ssh/id_rsa.pub /home/vagrant/.ssh/id_rsa.pub
sudo cat /vagrant/.ssh/id_rsa.pub >> /home/vagrant/.ssh/authorized_keys
SHELL
end
end
end
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化