diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..04a4a3c --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,6 @@ +Metrics/LineLength: + Enabled: false +Style/FileName: + Enabled: false +Style/StringLiterals: + Enabled: false diff --git a/Vagrantfile b/Vagrantfile index 34dde6b..cbe0c06 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -8,29 +8,24 @@ require "vagrant-host-shell" require "vagrant-junos" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - #disable filder sharing by default - config.vm.synced_folder ".", "/vagrant", disabled: true - config.vm.define "ndo", primary: true do |ndo| ndo.vm.box = "juniper/netdevops-ubuntu1404" ndo.vm.hostname = "NetDevOps-Student" ndo.vm.network "private_network", - ip: "172.16.0.10", - virtualbox__intnet: "NetDevOps-StudentInternal" - config.vm.synced_folder "", "/vagrant", disabled: false + ip: "172.16.0.10", + virtualbox__intnet: "NetDevOps-StudentInternal" + config.vm.synced_folder "", "/vagrant" ndo.vm.provider "virtualbox" do |v| - # v.gui = true - # v.customize ["modifyvm", :id, "--nic1", "hostonly"] + # v.gui = true + # v.customize ["modifyvm", :id, "--nic1", "hostonly"] end - ndo.ssh.shell = 'sh' - ndo.vm.provision "shell" do |s| - # TODO: DO THIS STUFF!!!!! - # add this to the shell - # export ANSIBLE_LIBRARY=/etc/ansible/roles/ - # set routes for 10.10.0.0/24 and 192.168.10.0/24 to 172.16.0.1 + # TODO: DO THIS STUFF!!!!! + # add this to the shell + # export ANSIBLE_LIBRARY=/etc/ansible/roles/ + # set routes for 10.10.0.0/24 and 192.168.10.0/24 to 172.16.0.1 s.path = "scripts/ndo-setup.sh" end end @@ -39,23 +34,18 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| srx.vm.box = "juniper/ffp-12.1X47-D20.7" srx.vm.hostname = "NetDevOps-SRX01" srx.vm.provider "virtualbox" do |v| - #v.gui = true + # v.gui = true end srx.vm.network "private_network", - ip: "172.16.0.1", - virtualbox__intnet: "NetDevOps-StudentInternal", - nic_type: 'virtio' + ip: "172.16.0.1", + virtualbox__intnet: "NetDevOps-StudentInternal" + srx.vm.network "private_network", - ip: "10.255.255.10", - virtualbox__intnet: "NetDevOps-StudentLAN", - nic_type: 'virtio' + ip: "10.255.255.10", + virtualbox__intnet: "NetDevOps-StudentLAN" srx.vm.synced_folder "", "/vagrant", disabled: true - srx.ssh.username = 'root' - srx.ssh.shell = 'sh' - srx.ssh.insert_key = false - srx.vm.provision "file", source: "scripts/srx-setup.sh", destination: "/tmp/srx-setup.sh" srx.vm.provision :host_shell do |host_shell| host_shell.inline = 'vagrant ssh srx -c "/usr/sbin/cli -f /tmp/srx-setup.sh"' diff --git a/Vagrantfile.BRIDGED b/Vagrantfile.BRIDGED index 8b309c1..248f1cd 100644 --- a/Vagrantfile.BRIDGED +++ b/Vagrantfile.BRIDGED @@ -8,48 +8,38 @@ require "vagrant-host-shell" require "vagrant-junos" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - config.vm.synced_folder ".", "/vagrant", disabled: true - config.vm.define "ndo", primary: true do |ndo| ndo.vm.box = "juniper/netdevops-ubuntu1404" ndo.vm.hostname = "NetDevOps-Student" ndo.vm.network "private_network", - ip: "172.16.0.10", - virtualbox__intnet: "NetDevOps-StudentInternal" - config.vm.synced_folder "", "/vagrant", disabled: false + ip: "172.16.0.10", + virtualbox__intnet: "NetDevOps-StudentInternal" + config.vm.synced_folder "", "/vagrant" ndo.vm.provider "virtualbox" do |v| - # v.gui = true - # v.customize ["modifyvm", :id, "--nic1", "hostonly"] + # v.gui = true + # v.customize ["modifyvm", :id, "--nic1", "hostonly"] end - - ndo.ssh.shell = 'sh' - + ndo.vm.provision "shell" do |s| s.path = "scripts/ifbounce.sh" end end - + config.vm.define "srx" do |srx| srx.vm.box = "juniper/ffp-12.1X47-D10.4" srx.vm.hostname = "NetDevOps-SRX01" srx.vm.provider "virtualbox" do |v| - #v.gui = true + # v.gui = true end srx.vm.network "private_network", - ip: "172.16.0.1", - virtualbox__intnet: "NetDevOps-StudentInternal", - nic_type: 'virtio' - srx.vm.network "public_network", - #ip: "10.255.255.10", - #virtualbox__intnet: "NetDevOps-StudentLAN", - nic_type: 'virtio' - - srx.vm.synced_folder "", "/vagrant", disabled: true + ip: "172.16.0.1", + virtualbox__intnet: "NetDevOps-StudentInternal" + srx.vm.network "public_network" + # ip: "10.255.255.10", + # virtualbox__intnet: "NetDevOps-StudentLAN", - srx.ssh.username = 'root' - srx.ssh.shell = 'sh' - srx.ssh.insert_key = false + srx.vm.synced_folder "", "/vagrant", disabled: true srx.vm.provision "file", source: "scripts/srx-setup.sh", destination: "/tmp/srx-setup.sh" srx.vm.provision :host_shell do |host_shell| diff --git a/proctor/Vagrantfile b/proctor/Vagrantfile index 4430caf..fc7b8de 100644 --- a/proctor/Vagrantfile +++ b/proctor/Vagrantfile @@ -8,29 +8,25 @@ require "vagrant-host-shell" require "vagrant-junos" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - #disable filder sharing by default - config.vm.synced_folder ".", "/vagrant", disabled: true config.vm.define "ndo", primary: true do |ndo| ndo.vm.box = "juniper/netdevops-ubuntu1404" ndo.vm.hostname = "NetDevOps-Proctor" ndo.vm.network "private_network", - ip: "10.10.0.10", - virtualbox__intnet: "NetDevOps-StudentInternal" - config.vm.synced_folder "", "/vagrant", disabled: false + ip: "10.10.0.10", + virtualbox__intnet: "NetDevOps-StudentInternal" + config.vm.synced_folder "", "/vagrant" ndo.vm.provider "virtualbox" do |v| - # v.gui = true - # v.customize ["modifyvm", :id, "--nic1", "hostonly"] + # v.gui = true + # v.customize ["modifyvm", :id, "--nic1", "hostonly"] end - ndo.ssh.shell = 'sh' - ndo.vm.provision "shell" do |s| - # TODO: DO THIS STUFF!!!!! - # add this to the shell - # export ANSIBLE_LIBRARY=/etc/ansible/roles/ - # set routes for 10.10.0.0/24 and 192.168.10.0/24 to 172.16.0.1 + # TODO: DO THIS STUFF!!!!! + # add this to the shell + # export ANSIBLE_LIBRARY=/etc/ansible/roles/ + # set routes for 10.10.0.0/24 and 192.168.10.0/24 to 172.16.0.1 s.path = "scripts/ifbounce.sh" end end @@ -39,23 +35,19 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| srx.vm.box = "juniper/ffp-12.1X47-D20.7" srx.vm.hostname = "NetDevOps-SRX01" srx.vm.provider "virtualbox" do |v| - #v.gui = true + # v.gui = true end srx.vm.network "private_network", - ip: "192.168.10.10", - virtualbox__intnet: "NetDevOps-Private", - nic_type: 'virtio' + ip: "192.168.10.10", + virtualbox__intnet: "NetDevOps-Private", + nic_type: 'virtio' srx.vm.network "private_network", - ip: "10.10.0.10" - virtualbox__intnet: "NetDevOps-Public", - nic_type: 'virtio' + ip: "10.10.0.10", + virtualbox__intnet: "NetDevOps-Public", + nic_type: 'virtio' srx.vm.synced_folder "", "/vagrant", disabled: true - srx.ssh.username = 'root' - srx.ssh.shell = 'sh' - srx.ssh.insert_key = false - srx.vm.provision "file", source: "scripts/srx-setup.sh", destination: "/tmp/srx-setup.sh" srx.vm.provision :host_shell do |host_shell| host_shell.inline = 'vagrant ssh srx -c "/usr/sbin/cli -f /tmp/srx-setup.sh"' diff --git a/scripts/ndo-setup.sh b/scripts/ndo-setup.sh index c9a703b..6894aef 100644 --- a/scripts/ndo-setup.sh +++ b/scripts/ndo-setup.sh @@ -1,7 +1,17 @@ +#!/usr/bin/env bash export ANSIBLE_LIBRARY=/etc/ansible/roles/ -echo "export ANSIBLE_LIBRARY=/etc/ansible/roles/" >> /home/vagrant/.bashrc +if ! grep -qe "export ANSIBLE_LIBRARY=/etc/ansible/roles/" "/home/vagrant/.bashrc"; then + cat >> /home/vagrant/.bashrc <> /etc/network/interfaces -echo "up route add -net 192.168.10.0/24 gw 172.16.0.1 dev eth1" >> /etc/network/interfaces +export ANSIBLE_LIBRARY=/etc/ansible/roles/ +EOF +fi + +ip r a 10.10.0.0/24 via 172.16.0.1 dev eth1 +ip r a 192.168.10.0/24 via 172.16.0.1 dev eth1 + +cat >> /etc/network/interfaces <