mirror of
https://github.com/jbowdre/vagrant-saltlab.git
synced 2024-11-26 23:22:17 +00:00
pass master IP as arg to salt bootstrap script
This removes the need to hardcode hostnames/IPs in /etc/hosts (Thanks Steven!)
This commit is contained in:
parent
cd603f2228
commit
8287448fd4
1 changed files with 4 additions and 12 deletions
16
salt/Vagrantfile
vendored
16
salt/Vagrantfile
vendored
|
@ -14,10 +14,6 @@ Vagrant.configure("2") do |config|
|
||||||
libvirt.memory = 1024
|
libvirt.memory = 1024
|
||||||
end
|
end
|
||||||
salt.vm.provision "shell", inline: <<-SHELL
|
salt.vm.provision "shell", inline: <<-SHELL
|
||||||
echo "192.168.100.121 minion01" | sudo tee -a /etc/hosts
|
|
||||||
echo "192.168.100.122 minion02" | sudo tee -a /etc/hosts
|
|
||||||
echo "192.168.100.123 minion03" | sudo tee -a /etc/hosts
|
|
||||||
echo "192.168.100.124 minion04" | sudo tee -a /etc/hosts
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install curl -y
|
sudo apt-get install curl -y
|
||||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||||
|
@ -31,11 +27,10 @@ Vagrant.configure("2") do |config|
|
||||||
minion01.vm.hostname = "minion01"
|
minion01.vm.hostname = "minion01"
|
||||||
minion01.vm.network "private_network", ip: "192.168.100.121"
|
minion01.vm.network "private_network", ip: "192.168.100.121"
|
||||||
minion01.vm.provision "shell", inline: <<-SHELL
|
minion01.vm.provision "shell", inline: <<-SHELL
|
||||||
echo "192.168.100.120 salt" | sudo tee -a /etc/hosts
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install curl -y
|
sudo apt-get install curl -y
|
||||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||||
sudo sh bootstrap-salt.sh
|
sudo sh bootstrap-salt.sh -A 192.168.100.120
|
||||||
sudo systemctl start salt-minion
|
sudo systemctl start salt-minion
|
||||||
SHELL
|
SHELL
|
||||||
end
|
end
|
||||||
|
@ -44,11 +39,10 @@ Vagrant.configure("2") do |config|
|
||||||
minion02.vm.hostname = "minion02"
|
minion02.vm.hostname = "minion02"
|
||||||
minion02.vm.network "private_network", ip: "192.168.100.122"
|
minion02.vm.network "private_network", ip: "192.168.100.122"
|
||||||
minion02.vm.provision "shell", inline: <<-SHELL
|
minion02.vm.provision "shell", inline: <<-SHELL
|
||||||
echo "192.168.100.120 salt" | sudo tee -a /etc/hosts
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install curl -y
|
sudo apt-get install curl -y
|
||||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||||
sudo sh bootstrap-salt.sh
|
sudo sh bootstrap-salt.sh -A 192.168.100.120
|
||||||
sudo systemctl start salt-minion
|
sudo systemctl start salt-minion
|
||||||
SHELL
|
SHELL
|
||||||
end
|
end
|
||||||
|
@ -57,9 +51,8 @@ Vagrant.configure("2") do |config|
|
||||||
minion03.vm.hostname = "minion03"
|
minion03.vm.hostname = "minion03"
|
||||||
minion03.vm.network "private_network", ip: "192.168.100.123"
|
minion03.vm.network "private_network", ip: "192.168.100.123"
|
||||||
minion03.vm.provision "shell", inline: <<-SHELL
|
minion03.vm.provision "shell", inline: <<-SHELL
|
||||||
echo "192.168.100.120 salt" | sudo tee -a /etc/hosts
|
|
||||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||||
sudo sh bootstrap-salt.sh
|
sudo sh bootstrap-salt.sh -A 192.168.100.120
|
||||||
sudo systemctl start salt-minion
|
sudo systemctl start salt-minion
|
||||||
SHELL
|
SHELL
|
||||||
end
|
end
|
||||||
|
@ -68,9 +61,8 @@ Vagrant.configure("2") do |config|
|
||||||
minion04.vm.hostname = "minion04"
|
minion04.vm.hostname = "minion04"
|
||||||
minion04.vm.network "private_network", ip: "192.168.100.124"
|
minion04.vm.network "private_network", ip: "192.168.100.124"
|
||||||
minion04.vm.provision "shell", inline: <<-SHELL
|
minion04.vm.provision "shell", inline: <<-SHELL
|
||||||
echo "192.168.100.120 salt" | sudo tee -a /etc/hosts
|
|
||||||
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
curl -o bootstrap-salt.sh -L https://bootstrap.saltproject.io
|
||||||
sudo sh bootstrap-salt.sh
|
sudo sh bootstrap-salt.sh -A 192.168.100.120
|
||||||
sudo systemctl start salt-minion
|
sudo systemctl start salt-minion
|
||||||
SHELL
|
SHELL
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue