User Tools

Site Tools


automation:vagrant

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
automation:vagrant [2019/05/16 08:17] – created jotasandokuautomation:vagrant [2023/11/02 14:38] (current) – external edit 127.0.0.1
Line 1: Line 1:
 JUNIPER VAGRANT CLOUD: JUNIPER VAGRANT CLOUD:
   dnf install Git   dnf install Git
-  sudo dnf -y install vagrant (min 2.2.4 so it supports vbox 6)+  sudo dnf -y install vagrant 
   wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -P /etc/yum.repos.d   wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -P /etc/yum.repos.d
   dnf update    dnf update 
   dnf install @development-tools   dnf install @development-tools
   dnf install kernel-devel kernel-headers dkms qt5-qtx11extras  elfutils-libelf-devel zlib-deve   dnf install kernel-devel kernel-headers dkms qt5-qtx11extras  elfutils-libelf-devel zlib-deve
-  dnf install VirtualBox-6.0+  dnf install VirtualBox-5.2   ## Important, doesn't work with 6 yet
   usermod -a -G vboxusers jaime   usermod -a -G vboxusers jaime
   dnf install ansible   dnf install ansible
   pip install --upgrade pip   pip install --upgrade pip
-  pip install -U junos-eznc +  pip3 install junos-eznc  
-  pip install junos-eznc +  pip3 install jxmlease 
-  pip install jxmlease +  ansible-galaxy install   / ansible-galaxy install Juniper.junos -c 
-  ansible-galaxy install    +  dnf install python3-lxml
-  install python3-lxml +
-  pip install lxml+
   git clone https://github.com/grigorenkoae/vqfx10k-vagrant.git   git clone https://github.com/grigorenkoae/vqfx10k-vagrant.git
   cd [to directory]   cd [to directory]
-  vagrant up+   
 +Increase config.vm.boot_timeout value in Vagrantfile. 
 +  config.vm.provider :virtualbox do |vb| 
 +    v.gui = true 
 +  end 
 +   
 +[[https://github.com/Juniper/ansible-junos-stdlib/issues/412]] \\ 
 +[[https://github.com/Juniper/vqfx10k-vagrant/issues/5]] \\ 
 +This is to force ansible to use python3.7. If we don't do it ansible will error with messages like : //ImportError: No module named plugins.action.normal// 
 +  cat > pb.conf.all.commit.yaml 
 +    - Juniper.junos 
 +  vars: 
 +    ansible_python_interpreter: "/usr/bin/python3.7" 
 + 
 +[[https://github.com/Juniper/vqfx10k-vagrant/issues/5]]  
 + 
 +   vagrant up --provider=virtualbox    # delete .vagrant if having issues with running it under normal user (not root) 
 +   vagrant destroy  
 +   ls host_vars/ 
 +   vagrant ssh vqfx1 
 +    
 +    
 +Other commands:  
 +   
 +  vagrant up --provider=virtualbox--debug 
 +  vagrant halt 
 +  vagrant up --no-provision 
 +  vagrant destroy 
 +  vboxmanage list runningvms 
 + 
 + 
 +---- 
 + 
 + 
 +ADD LINUX BOX:\\ 
 +  vagrant box add centos/7 
 +  vagrant box list 
 +   
 + 
 +---- 
 + 
 +ORCHESTRATE CONFIG FOR VAGRANT WITH ANSIBLE:\\ 
 + 
 +[[https://www.linkedin.com/pulse/network-automation-using-ansibleplaybookspart-4-ahnaf-shahriar/]] 
 + 
 +\\ 
 +BUT WE GET THIS ERROR!!: 
 +  [root@mycompany2test.cambridge.mycompany1.co.uk vmx-test-2]# ansible-playbook -i ini/hosts -l all playbook.yml 
 +   
 +  PLAY [Change configuration using junos_config module] ************************************************************************************************************************************************************************************************************************************************************************************************ 
 +   
 +  TASK [ip_loop : Change configuration using junos_config module] ************************************************************************************************************************************************************************************************************************************************************************************** 
 +  fatal: [Router-2]: FAILED! => {"msg": "'interfaces' is undefined"
 + 
automation/vagrant.1557994640.txt.gz · Last modified: (external edit)