Posted on March 29, 2021 3:02 pm
 |  Asked by Walter Steadman
 |  36 views
0
0
Print Friendly, PDF & Email

Greetings all,
I am trying to learn how to use ansible with the arista swtiches.  I am using some vEOS switches with version 4.25 and when I try to run a playbook to add a vrf using

– name: Create vrf
arista.eos.eos_vrf:
name: test
interfaces:
– Ethernet2
state: present

When I run it, I get a large error:

“An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ansible.module_utils.connection.ConnectionError: This command is deprecated by ‘vrf instance [VRF_ID]’ (at token 2: ‘definition’)
fatal: [10.10.200.2]: FAILED! => {“changed”: false, “module_stderr”: “Traceback (most recent call last):\n File \”/home/ansible/.ansible/tmp/ansible-local-85617ya1xiz9u/ansible-tmp-1617020360.9878001-134603945993508/AnsiballZ_eos_vrf.py\”, line 102, in <module>\n _ansiballz_main()\n File \”/home/ansible/.ansible/tmp/ansible-local-85617ya1xiz9u/ansible-tmp-1617020360.9878001-134603945993508/AnsiballZ_eos_vrf.py\”, line 94, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File \”/home/ansible/.ansible/tmp/ansible-local-85617ya1xiz9u/ansible-tmp-1617020360.9878001-134603945993508/AnsiballZ_eos_vrf.py\”, line 40, in invoke_module\n runpy.run_module(mod_name=’ansible_collections.arista.eos.plugins.modules.eos_vrf’, init_globals=None, run_name=’__main__’, alter_sys=True)\n File \”/usr/lib/python3.8/runpy.py\”, line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \”/usr/lib/python3.8/runpy.py\”, line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \”/usr/lib/python3.8/runpy.py\”, line 87, in _run_code\n exec(code, run_globals)\n File \”/tmp/ansible_arista.eos.eos_vrf_payload_uk5h203w/ansible_arista.eos.eos_vrf_payload.zip/ansible_collections/arista/eos/plugins/modules/eos_vrf.py\”, line 432, in <module>\n File \”/tmp/ansible_arista.eos.eos_vrf_payload_uk5h203w/ansible_arista.eos.eos_vrf_payload.zip/ansible_collections/arista/eos/plugins/modules/eos_vrf.py\”, line 420, in main\n File \”/tmp/ansible_arista.eos.eos_vrf_payload_uk5h203w/ansible_arista.eos.eos_vrf_payload.zip/ansible_collections/arista/eos/plugins/module_utils/network/eos/eos.py\”, line 726, in load_config\n File \”/tmp/ansible_arista.eos.eos_vrf_payload_uk5h203w/ansible_arista.eos.eos_vrf_payload.zip/ansible_collections/arista/eos/plugins/module_utils/network/eos/eos.py\”, line 607, in load_config\n File \”/tmp/ansible_arista.eos.eos_vrf_payload_uk5h203w/ansible_arista.eos.eos_vrf_payload.zip/ansible_collections/arista/eos/plugins/module_utils/network/eos/eos.py\”, line 644, in edit_config\n File \”/tmp/ansible_arista.eos.eos_vrf_payload_uk5h203w/ansible_arista.eos.eos_vrf_payload.zip/ansible/module_utils/connection.py\”, line 185, in __rpc__\nansible.module_utils.connection.ConnectionError: This command is deprecated by ‘vrf instance [VRF_ID]’ (at token 2: ‘definition’)\n”, “module_stdout”: “”, “msg”: “MODULE FAILURE\nSee stdout/stderr for the exact error”, “rc”: 1}”

And I don’t know how to find out how to fix the error.  something about the vrf instance changing.  Any help would be appreciated

 

0
Posted by Tamas Plugor
Answered on March 29, 2021 3:15 pm

Hi Walter,

It's seems like that is because the eos_vrf role doesn't understand the new CLI syntax, you should instead use eos_config and create the vrf using CLI commands, the new syntax since 4.23.0F is vrf instance vrfName. The old syntax since that version is not accepted anymore.

Note that the arista.eos collection is maintained by RedHat, and in general we advise not to leverage the resource modules, but recommend using arista.avd collection and eos_cli_config_gen_role maintained and updated very frequently by Arista and which has a greater coverage for any protocol/features. You can read more about it at https://avd.sh/
Please feel free to reach out to your local AM/SE team for a demo.

HTH,
Tamas

0
Posted by Moritz Rios
Answered on April 9, 2021 11:34 am

Try running an ad-hoc setup command against one device and pipe the output to a file.

That should give you all the facts you can use for that device.

e.g. ansible crustyeos -m setup -i inventory.inv | crustyeos.json.

 

Post your Answer

You must be logged in to post an answer.