diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2017-04-01 04:53:28 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2017-04-01 04:53:28 +0200 |
commit | e7ed329bd81c2273c03e94c93c9ce9c1d01cdc86 (patch) | |
tree | 444778102e4f73b83ef9462235b7f614b004b264 /vm/vagrant-router/Vagrantfile | |
download | ands-e7ed329bd81c2273c03e94c93c9ce9c1d01cdc86.tar.gz ands-e7ed329bd81c2273c03e94c93c9ce9c1d01cdc86.tar.bz2 ands-e7ed329bd81c2273c03e94c93c9ce9c1d01cdc86.tar.xz ands-e7ed329bd81c2273c03e94c93c9ce9c1d01cdc86.zip |
Initial import
Diffstat (limited to 'vm/vagrant-router/Vagrantfile')
-rw-r--r-- | vm/vagrant-router/Vagrantfile | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/vm/vagrant-router/Vagrantfile b/vm/vagrant-router/Vagrantfile new file mode 100644 index 0000000..6e39ae0 --- /dev/null +++ b/vm/vagrant-router/Vagrantfile @@ -0,0 +1,35 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +Vagrant.configure("2") do |config| + config.vm.define "ipekatrinrouter" do |node| + node.vm.box = "centos/7" + node.vm.hostname = "ipekatrinrouter" + node.vm.network "public_network", bridge: "br0", ip: "141.52.64.15", netmask: "255.255.254.0" + node.vm.network "public_network", bridge: "br0", ip: "141.52.64.17", netmask: "255.255.254.0" + node.vm.network "public_network", bridge: "br0", ip: "192.168.26.254" + + node.vm.provision "shell", run: "always", inline: "( ip addr show | grep 64.15 ) || ifcfg eth1 141.52.64.15/23" + node.vm.provision "shell", run: "always", inline: "( ip addr show | grep 64.17 ) || ifcfg eth2 141.52.64.17/23" + node.vm.provision "shell", run: "always", inline: "( ip addr show | grep 192.168.26 ) || ifcfg eth3 192.168.26.254" + node.vm.provision "shell", run: "always", inline: "chmod +r /etc/sysconfig/network-scripts/ifcfg-eth*" + node.vm.provision "shell", run: "always", inline: "chcon --reference /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth*" + + node.vm.provision "shell" do |s| + ssh_pub_key = File.readlines("/Image/My/Private/ssh/authorized_keys").first.strip + s.inline = <<-SHELL + mkdir -p /root/.ssh/ + echo #{ssh_pub_key} >> /root/.ssh/authorized_keys + SHELL + end + + node.vm.provider "virtualbox" do |vb| + vb.memory = "1024" + vb.customize [ + "modifyvm", :id, + "--audio", "none", + ] + end + end +end + |