Juniper / vqfx10k-vagrant

Vagrant projects for vQFX10k
Apache License 2.0
136 stars 62 forks source link

seems not compatible with new Ansible version(2.4.3.0) #14

Open josephlai2020 opened 6 years ago

josephlai2020 commented 6 years ago

josephl-mbp:light-ipfabric-2S-3L josephl$ vagrant up Bringing machine 'spine1' up with 'virtualbox' provider... Bringing machine 'spine2' up with 'virtualbox' provider... Bringing machine 'leaf1' up with 'virtualbox' provider... Bringing machine 'srv1' up with 'virtualbox' provider... Bringing machine 'leaf2' up with 'virtualbox' provider... Bringing machine 'srv2' up with 'virtualbox' provider... Bringing machine 'leaf3' up with 'virtualbox' provider... Bringing machine 'srv3' up with 'virtualbox' provider... ==> spine1: Checking if box 'juniper/vqfx10k-re' is up to date... ==> spine1: Machine already provisioned. Run vagrant provision or use the --provision ==> spine1: flag to force provisioning. Provisioners marked to run always will still run. ==> spine2: Checking if box 'juniper/vqfx10k-re' is up to date... ==> spine2: Machine already provisioned. Run vagrant provision or use the --provision ==> spine2: flag to force provisioning. Provisioners marked to run always will still run. ==> leaf1: Checking if box 'juniper/vqfx10k-re' is up to date... ==> leaf1: Machine already provisioned. Run vagrant provision or use the --provision ==> leaf1: flag to force provisioning. Provisioners marked to run always will still run. ==> srv1: Checking if box 'robwc/minitrusty64' is up to date... ==> srv1: Clearing any previously set forwarded ports... ==> srv1: Fixed port collision for 22 => 2222. Now on port 2202. ==> srv1: Clearing any previously set network interfaces... ==> srv1: Preparing network interfaces based on configuration... srv1: Adapter 1: nat srv1: Adapter 2: intnet ==> srv1: Forwarding ports... srv1: 22 (guest) => 2202 (host) (adapter 1) ==> srv1: Running 'pre-boot' VM customizations... ==> srv1: Booting VM... ==> srv1: Waiting for machine to boot. This may take a few minutes... srv1: SSH address: 127.0.0.1:2202 srv1: SSH username: vagrant srv1: SSH auth method: private key ==> srv1: Machine booted and ready! ==> srv1: Checking for guest additions in VM... srv1: The guest additions on this VM do not match the installed version of srv1: VirtualBox! In most cases this is fine, but in rare cases it can srv1: prevent things such as shared folders from working properly. If you see srv1: shared folder errors, please make sure the guest additions within the srv1: virtual machine match the version of VirtualBox you have installed on srv1: your host and reload your VM. srv1: srv1: Guest Additions Version: 4.3.10 srv1: VirtualBox Version: 5.2 ==> srv1: Setting hostname... ==> srv1: Configuring and enabling network interfaces... ==> srv1: Running provisioner: ansible... Vagrant has automatically selected the compatibility mode '2.0'. <<<<<<<<<<<<<<<<<<<<<< according to the Ansible version installed (2.4.3.0). <<<<<<<<<<<<<<<<<<<<<<

Alternatively, the compatibility mode can be specified in your Vagrantfile: https://www.vagrantup.com/docs/provisioning/ansible_common.html#compatibility_mode

srv1: Running ansible-playbook...

[WARNING]: Unable to set correct type for configuration entry: DEFAULT_LOCAL_TMP

[DEPRECATION WARNING]: 'include' for playbook includes. You should use 'import_playbook' instead. This feature will be removed in version 2.8. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. ERROR! the role 'Juniper.junos' was not found in /Users/josephl/vqfx-demo/vqfx10k-vagrant/light-ipfabric-2S-3L/roles:/Users/josephl/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles:/Users/josephl/vqfx-demo/vqfx10k-vagrant/light-ipfabric-2S-3L/roles:/Users/josephl/vqfx-demo/vqfx10k-vagrant/light-ipfabric-2S-3L

The error appears to have been in '/Users/josephl/vqfx-demo/vqfx10k-vagrant/light-ipfabric-2S-3L/roles/vagrant-base/meta/main.yaml': line 10, column 6, but may be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

dependencies:

Ansible failed to complete successfully. Any error output should be visible above. Please fix these errors and try again.

jasweet commented 6 years ago

This is not Ansible's fault. You need to install the custom Juniper module from Ansible galaxy. ansible-galaxy install juniper.junos Alternatively, you can declare a specific version of the Juniper module like below: ansible-galaxy install juniper.junos,2.0.2

Some other considerations are the roles_path in /etc/ansible/ansible.cfg typically defaults to /etc/ansible/roles. This is typically where you want to check to ensure the modules from ansible-galaxy were properly installed. Further, you'll want to make sure you have all the requisite packages Juniper leverages installed for ansible's env, i.e. junos-eznc - ncclient - jxmlease - and another fun one (not required) to use is jsnapy

sliddjur commented 5 years ago

@jasweet @joseph0705 how did u get it working?

I installed dependencies with both pip and pip3

Installed juniper.junos role from ansible-galaxy

olof@80003v-app005:~/vqfx10k-vagrant/full-2qfx-4srv-evpnvxlan$ ls -l /etc/ansible/roles/
total 4
d-wx--x--x 10 olof olof 4096 nov.   7 14:44 juniper.junos
olof@80003v-app005:~/vqfx10k-vagrant/full-2qfx-4srv-evpnvxlan$ ls -l /home/olof/.ansible/roles/
total 4
drwxr-xr-x 10 olof olof 4096 nov.   7 14:26 juniper.junos
olof@80003v-app005:~/vqfx10k-vagrant/full-2qfx-4srv-evpnvxlan$ grep roles /etc/ansible/ansible.cfg
# additional paths to search for roles in, colon separated
roles_path    = /etc/ansible/roles
# by default, variables from roles will be visible in the global variable
olof@80003v-app005:~/vqfx10k-vagrant/full-2qfx-4srv-evpnvxlan$ ansible --version
ansible 2.7.1
  config file = /home/olof/vqfx10k-vagrant/full-2qfx-4srv-evpnvxlan/ansible.cfg
  configured module search path = [u'/home/olof/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.15rc1 (default, Apr 15 2018, 21:51:34) [GCC 7.3.0]
olof@80003v-app005:~/vqfx10k-vagrant/full-2qfx-4srv-evpnvxlan$ vagrant --version
Vagrant 2.2.0
olof@80003v-app005:~/vqfx10k-vagrant/full-2qfx-4srv-evpnvxlan$ vboxmanage --version
5.2.10_Ubuntur121806
sliddjur commented 5 years ago

Looks like juniper.junos wasn't case sensitive when downloading. But in install of course it was. I installed with Juniper.junos and it worked.