- Set at least one tag (the experts follow the tags, so the right people will find you if you tag)
I am working through a Automating Networks with Ansible course on CBT Nuggets. In the section going through Ansible-Galaxy we install Genie and are supposed to parse some data. Iv followed the video exactly and ran the same commands and created the same playbook but when I run it I keep getting the following error.
fatal: [10.0.15.7]: FAILED! => {"msg": "parse_genie: Genie package is not installed. To install, run 'pip install genie'."}
Directory Tree:
(.venv) [bmarr@localhost CBT-Automating-Networks-with-Ansible]$ tree
.
βββ accessvars.yml
βββ ansible.cfg
βββ bannerconf.yml
βββ cisco_default_configuration
β βββ banner_exec.cfg
β βββ banner_login.cfg
βββ condition_test.yml
βββ eigrp
β βββ legacy.j2
β βββ named.j2
βββ encrypt-test.yml
βββ genie_parse_playbook.yml
βββ group_vars
β βββ all.yml
β βββ uk.yml
β βββ usa.yml
βββ handler-example.yml
βββ hosts
βββ host_vars
β βββ 10.0.15.13.yml
β βββ 10.0.15.14.yml
β βββ 10.0.15.7.yml
βββ ip-filter-test.yml
βββ loop-ip-address.yml
βββ newtest.yml
βββ ntp_config.yml
βββ nuggets
β βββ defaults
β β βββ main.yml
β βββ handlers
β β βββ main.yml
β βββ meta
β β βββ main.yml
β βββ README.md
β βββ tasks
β β βββ main.yml
β βββ tests
β β βββ inventory
β β βββ test.yml
β βββ vars
β βββ main.yml
βββ play.yml
βββ printvars.yml
βββ register-example.yml
βββ templates
β βββ bgp.j2
β βββ ntp.j2
βββ var_example1.yml
12 directories, 36 files
Steps taken to install β¦
- install clay584.genie galaxy collection
[bmarr@localhost ~]$ ansible-galaxy collection install clay584.genie
- create venv and activate then install pyats
[bmarr@localhost ~]$ python3 -m venv .venv
[bmarr@localhost ~]$ cd .venv/
[bmarr@localhost .venv]$ source bin/activate
(.venv) [bmarr@localhost .venv]$ cd ..
- install pyats
(.venv) [bmarr@localhost ~]$ pip install pyats
- install genie
(.venv) [bmarr@localhost ~]$ pip install genie
- back to the folder where my ansible playbooks are at and run the play
(.venv) [bmarr@localhost ~]$ cd CBT-Automating-Networks-with-Ansible/
(.venv) [bmarr@localhost CBT-Automating-Networks-with-Ansible]$ ansible-playbook genie_parse_playbook.yml -vvvvv
=
=
FILES:
ansible.cfg
[defaults]
gathering = explicit
inventory = ./hosts
host_key_checking=False
deprecation_warnings=False
interpreter_python=/usr/local/bin/python3
genie_parse_playbook.yml
---
- name: playbook 1 testing genie
hosts: 10.0.15.7
connection: network_cli
tasks:
- name: task 1 send a show command
cisco.ios.ios_command:
commands: show version
register: show_version_output
- name: task 2 parse show command
set_fact:
parsed_data: >-
{{ show_version_output.stdout.0 | clay584.genie.parse_genie(
command='show version', os='ios'
) }}
- name: task 3 print output
debug:
msg: "{{ parsed_data }}"
=
=
Play output: Error on TASK [task 2 parse show command] at the end of the play
ansible-playbook [core 2.15.13]
config file = /home/bmarr/CBT-Automating-Networks-with-Ansible/ansible.cfg
configured module search path = ['/home/bmarr/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/bmarr/.local/lib/python3.9/site-packages/ansible
ansible collection location = /home/bmarr/.ansible/collections:/usr/share/ansible/collections
executable location = /home/bmarr/.local/bin/ansible-playbook
python version = 3.9.21 (main, Dec 5 2024, 00:00:00) [GCC 11.5.0 20240719 (Red Hat 11.5.0-2)] (/usr/bin/python3)
jinja version = 3.1.5
libyaml = True
Using /home/bmarr/CBT-Automating-Networks-with-Ansible/ansible.cfg as config file
setting up inventory plugins
Loading collection ansible.builtin from
host_list declined parsing /home/bmarr/CBT-Automating-Networks-with-Ansible/hosts as it did not pass its verify_file() method
script declined parsing /home/bmarr/CBT-Automating-Networks-with-Ansible/hosts as it did not pass its verify_file() method
auto declined parsing /home/bmarr/CBT-Automating-Networks-with-Ansible/hosts as it did not pass its verify_file() method
Parsed /home/bmarr/CBT-Automating-Networks-with-Ansible/hosts inventory source with ini plugin
Loading collection cisco.ios from /home/bmarr/.local/lib/python3.9/site-packages/ansible_collections/cisco/ios
redirecting (type: action) cisco.ios.ios_command to cisco.ios.ios
Loading callback plugin default of type stdout, v2.0 from /home/bmarr/.local/lib/python3.9/site-packages/ansible/plugins/callback/default.py
Attempting to use 'default' callback.
Skipping callback 'default', as we already have a stdout callback.
Attempting to use 'junit' callback.
Attempting to use 'minimal' callback.
Skipping callback 'minimal', as we already have a stdout callback.
Attempting to use 'oneline' callback.
Skipping callback 'oneline', as we already have a stdout callback.
Attempting to use 'tree' callback.
PLAYBOOK: genie_parse_playbook.yml ******************************************************************************************************************************************************************
Positional arguments: genie_parse_playbook.yml
verbosity: 5
connection: smart
timeout: 10
become_method: sudo
tags: ('all',)
inventory: ('/home/bmarr/CBT-Automating-Networks-with-Ansible/hosts',)
forks: 5
1 plays in genie_parse_playbook.yml
PLAY [playbook 1 testing genie] *********************************************************************************************************************************************************************
redirecting (type: action) cisco.ios.ios_command to cisco.ios.ios
Loading collection ansible.netcommon from /home/bmarr/.local/lib/python3.9/site-packages/ansible_collections/ansible/netcommon
TASK [task 1 send a show command] *******************************************************************************************************************************************************************
task path: /home/bmarr/CBT-Automating-Networks-with-Ansible/genie_parse_playbook.yml:8
redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli
Loading collection ansible.utils from /home/bmarr/.local/lib/python3.9/site-packages/ansible_collections/ansible/utils
redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
<10.0.15.7> attempting to start connection
<10.0.15.7> using connection plugin ansible.netcommon.network_cli
Found ansible-connection at path /home/bmarr/.local/bin/ansible-connection
<10.0.15.7> local domain socket does not exist, starting it
<10.0.15.7> control socket path is /home/bmarr/.ansible/pc/9c4b65f273
<10.0.15.7> Loading collection ansible.builtin from
<10.0.15.7> redirecting (type: connection) ansible.builtin.network_cli to ansible.netcommon.network_cli
<10.0.15.7> Loading collection ansible.netcommon from /home/bmarr/.local/lib/python3.9/site-packages/ansible_collections/ansible/netcommon
<10.0.15.7> Loading collection ansible.utils from /home/bmarr/.local/lib/python3.9/site-packages/ansible_collections/ansible/utils
<10.0.15.7> redirecting (type: terminal) ansible.builtin.ios to cisco.ios.ios
<10.0.15.7> Loading collection cisco.ios from /home/bmarr/.local/lib/python3.9/site-packages/ansible_collections/cisco/ios
<10.0.15.7> redirecting (type: cliconf) ansible.builtin.ios to cisco.ios.ios
<10.0.15.7> local domain socket listeners started successfully
<10.0.15.7> loaded cliconf plugin ansible_collections.cisco.ios.plugins.cliconf.ios from path /home/bmarr/.local/lib/python3.9/site-packages/ansible_collections/cisco/ios/plugins/cliconf/ios.py for network_os ios
<10.0.15.7> ssh type is set to auto
<10.0.15.7> autodetecting ssh_type
<10.0.15.7> ssh type is now set to libssh
<10.0.15.7> Loading collection ansible.builtin from
<10.0.15.7> local domain socket path is /home/bmarr/.ansible/pc/9c4b65f273
redirecting (type: action) cisco.ios.ios_command to cisco.ios.ios
redirecting (type: action) cisco.ios.ios_command to cisco.ios.ios
<10.0.15.7> ANSIBLE_NETWORK_IMPORT_MODULES: enabled
<10.0.15.7> ANSIBLE_NETWORK_IMPORT_MODULES: found cisco.ios.ios_command at /home/bmarr/.local/lib/python3.9/site-packages/ansible_collections/cisco/ios/plugins/modules/ios_command.py
<10.0.15.7> ANSIBLE_NETWORK_IMPORT_MODULES: running cisco.ios.ios_command
<10.0.15.7> ANSIBLE_NETWORK_IMPORT_MODULES: complete
<10.0.15.7> ANSIBLE_NETWORK_IMPORT_MODULES: Result: {'changed': False, 'stdout': ['Cisco IOS XE Software, Version 17.03.08a\nCisco IOS Software [Amsterdam], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.3.8a, RELEASE SOFTWARE (fc3)\nTechnical Support: http://www.cisco.com/techsupport\nCopyright (c) 1986-2023 by Cisco Systems, Inc.\nCompiled Fri 20-Oct-23 15:48 by mcpre\n\n\nCisco IOS-XE software, Copyright (c) 2005-2023 by cisco Systems, Inc.\nAll rights reserved. Certain components of Cisco IOS-XE software are\nlicensed under the GNU General Public License ("GPL") Version 2.0. The\nsoftware code licensed under GPL Version 2.0 is free software that comes\nwith ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such\nGPL code under the terms of GPL Version 2.0. For more details, see the\ndocumentation or "License Notice" file accompanying the IOS-XE software,\nor the applicable URL provided on the flyer accompanying the IOS-XE\nsoftware.\n\n\nROM: IOS-XE ROMMON\n\nR1 uptime is 3 hours, 32 minutes\nUptime for this control processor is 3 hours, 34 minutes\nSystem returned to ROM by reload at 02:17:08 UTC Sun Feb 2 2025\nSystem image file is "bootflash:packages.conf"\nLast reload reason: Reload Command\n\n\n\nThis product contains cryptographic features and is subject to United\nStates and local country laws governing import, export, transfer and\nuse. Delivery of Cisco cryptographic products does not imply\nthird-party authority to import, export, distribute or use encryption.\nImporters, exporters, distributors and users are responsible for\ncompliance with U.S. and local country laws. By using this product you\nagree to comply with applicable laws and regulations. If you are unable\nto comply with U.S. and local laws, return this product immediately.\n\nA summary of U.S. laws governing Cisco cryptographic products may be found at:\nhttp://www.cisco.com/wwl/export/crypto/tool/stqrg.html\n\nIf you require further assistance please contact us by sending email to\nexport@cisco.com.\n\nLicense Level: ax\nLicense Type: N/A(Smart License Enabled)\nNext reload license Level: ax\n\nThe current throughput level is 1000 kbps \n\n\nSmart Licensing Status: UNREGISTERED/No Licenses in Use\n\ncisco CSR1000V (VXE) processor (revision VXE) with 2070552K/3075K bytes of memory.\nProcessor board ID 9QQ3Y05ZEFO\nRouter operating mode: Autonomous\n4 Gigabit Ethernet interfaces\n32768K bytes of non-volatile configuration memory.\n3978232K bytes of physical memory.\n6188032K bytes of virtual hard disk at bootflash:.\n\nConfiguration register is 0x2102'], 'stdout_lines': [['Cisco IOS XE Software, Version 17.03.08a', 'Cisco IOS Software [Amsterdam], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.3.8a, RELEASE SOFTWARE (fc3)', 'Technical Support: http://www.cisco.com/techsupport', 'Copyright (c) 1986-2023 by Cisco Systems, Inc.', 'Compiled Fri 20-Oct-23 15:48 by mcpre', '', '', 'Cisco IOS-XE software, Copyright (c) 2005-2023 by cisco Systems, Inc.', 'All rights reserved. Certain components of Cisco IOS-XE software are', 'licensed under the GNU General Public License ("GPL") Version 2.0. The', 'software code licensed under GPL Version 2.0 is free software that comes', 'with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such', 'GPL code under the terms of GPL Version 2.0. For more details, see the', 'documentation or "License Notice" file accompanying the IOS-XE software,', 'or the applicable URL provided on the flyer accompanying the IOS-XE', 'software.', '', '', 'ROM: IOS-XE ROMMON', '', 'R1 uptime is 3 hours, 32 minutes', 'Uptime for this control processor is 3 hours, 34 minutes', 'System returned to ROM by reload at 02:17:08 UTC Sun Feb 2 2025', 'System image file is "bootflash:packages.conf"', 'Last reload reason: Reload Command', '', '', '', 'This product contains cryptographic features and is subject to United', 'States and local country laws governing import, export, transfer and', 'use. Delivery of Cisco cryptographic products does not imply', 'third-party authority to import, export, distribute or use encryption.', 'Importers, exporters, distributors and users are responsible for', 'compliance with U.S. and local country laws. By using this product you', 'agree to comply with applicable laws and regulations. If you are unable', 'to comply with U.S. and local laws, return this product immediately.', '', 'A summary of U.S. laws governing Cisco cryptographic products may be found at:', 'http://www.cisco.com/wwl/export/crypto/tool/stqrg.html', '', 'If you require further assistance please contact us by sending email to', 'export@cisco.com.', '', 'License Level: ax', 'License Type: N/A(Smart License Enabled)', 'Next reload license Level: ax', '', 'The current throughput level is 1000 kbps ', '', '', 'Smart Licensing Status: UNREGISTERED/No Licenses in Use', '', 'cisco CSR1000V (VXE) processor (revision VXE) with 2070552K/3075K bytes of memory.', 'Processor board ID 9QQ3Y05ZEFO', 'Router operating mode: Autonomous', '4 Gigabit Ethernet interfaces', '32768K bytes of non-volatile configuration memory.', '3978232K bytes of physical memory.', '6188032K bytes of virtual hard disk at bootflash:.', '', 'Configuration register is 0x2102']], 'invocation': {'module_args': {'commands': ['show version'], 'match': 'all', 'retries': 9, 'interval': 1, 'wait_for': None}}, '_ansible_parsed': True}
ok: [10.0.15.7] => {
"changed": false,
"invocation": {
"module_args": {
"commands": [
"show version"
],
"interval": 1,
"match": "all",
"retries": 9,
"wait_for": null
}
},
"stdout": [
"Cisco IOS XE Software, Version 17.03.08a\nCisco IOS Software [Amsterdam], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.3.8a, RELEASE SOFTWARE (fc3)\nTechnical Support: http://www.cisco.com/techsupport\nCopyright (c) 1986-2023 by Cisco Systems, Inc.\nCompiled Fri 20-Oct-23 15:48 by mcpre\n\n\nCisco IOS-XE software, Copyright (c) 2005-2023 by cisco Systems, Inc.\nAll rights reserved. Certain components of Cisco IOS-XE software are\nlicensed under the GNU General Public License (\"GPL\") Version 2.0. The\nsoftware code licensed under GPL Version 2.0 is free software that comes\nwith ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such\nGPL code under the terms of GPL Version 2.0. For more details, see the\ndocumentation or \"License Notice\" file accompanying the IOS-XE software,\nor the applicable URL provided on the flyer accompanying the IOS-XE\nsoftware.\n\n\nROM: IOS-XE ROMMON\n\nR1 uptime is 3 hours, 32 minutes\nUptime for this control processor is 3 hours, 34 minutes\nSystem returned to ROM by reload at 02:17:08 UTC Sun Feb 2 2025\nSystem image file is \"bootflash:packages.conf\"\nLast reload reason: Reload Command\n\n\n\nThis product contains cryptographic features and is subject to United\nStates and local country laws governing import, export, transfer and\nuse. Delivery of Cisco cryptographic products does not imply\nthird-party authority to import, export, distribute or use encryption.\nImporters, exporters, distributors and users are responsible for\ncompliance with U.S. and local country laws. By using this product you\nagree to comply with applicable laws and regulations. If you are unable\nto comply with U.S. and local laws, return this product immediately.\n\nA summary of U.S. laws governing Cisco cryptographic products may be found at:\nhttp://www.cisco.com/wwl/export/crypto/tool/stqrg.html\n\nIf you require further assistance please contact us by sending email to\nexport@cisco.com.\n\nLicense Level: ax\nLicense Type: N/A(Smart License Enabled)\nNext reload license Level: ax\n\nThe current throughput level is 1000 kbps \n\n\nSmart Licensing Status: UNREGISTERED/No Licenses in Use\n\ncisco CSR1000V (VXE) processor (revision VXE) with 2070552K/3075K bytes of memory.\nProcessor board ID 9QQ3Y05ZEFO\nRouter operating mode: Autonomous\n4 Gigabit Ethernet interfaces\n32768K bytes of non-volatile configuration memory.\n3978232K bytes of physical memory.\n6188032K bytes of virtual hard disk at bootflash:.\n\nConfiguration register is 0x2102"
],
"stdout_lines": [
[
"Cisco IOS XE Software, Version 17.03.08a",
"Cisco IOS Software [Amsterdam], Virtual XE Software (X86_64_LINUX_IOSD-UNIVERSALK9-M), Version 17.3.8a, RELEASE SOFTWARE (fc3)",
"Technical Support: http://www.cisco.com/techsupport",
"Copyright (c) 1986-2023 by Cisco Systems, Inc.",
"Compiled Fri 20-Oct-23 15:48 by mcpre",
"",
"",
"Cisco IOS-XE software, Copyright (c) 2005-2023 by cisco Systems, Inc.",
"All rights reserved. Certain components of Cisco IOS-XE software are",
"licensed under the GNU General Public License (\"GPL\") Version 2.0. The",
"software code licensed under GPL Version 2.0 is free software that comes",
"with ABSOLUTELY NO WARRANTY. You can redistribute and/or modify such",
"GPL code under the terms of GPL Version 2.0. For more details, see the",
"documentation or \"License Notice\" file accompanying the IOS-XE software,",
"or the applicable URL provided on the flyer accompanying the IOS-XE",
"software.",
"",
"",
"ROM: IOS-XE ROMMON",
"",
"R1 uptime is 3 hours, 32 minutes",
"Uptime for this control processor is 3 hours, 34 minutes",
"System returned to ROM by reload at 02:17:08 UTC Sun Feb 2 2025",
"System image file is \"bootflash:packages.conf\"",
"Last reload reason: Reload Command",
"",
"",
"",
"This product contains cryptographic features and is subject to United",
"States and local country laws governing import, export, transfer and",
"use. Delivery of Cisco cryptographic products does not imply",
"third-party authority to import, export, distribute or use encryption.",
"Importers, exporters, distributors and users are responsible for",
"compliance with U.S. and local country laws. By using this product you",
"agree to comply with applicable laws and regulations. If you are unable",
"to comply with U.S. and local laws, return this product immediately.",
"",
"A summary of U.S. laws governing Cisco cryptographic products may be found at:",
"http://www.cisco.com/wwl/export/crypto/tool/stqrg.html",
"",
"If you require further assistance please contact us by sending email to",
"export@cisco.com.",
"",
"License Level: ax",
"License Type: N/A(Smart License Enabled)",
"Next reload license Level: ax",
"",
"The current throughput level is 1000 kbps ",
"",
"",
"Smart Licensing Status: UNREGISTERED/No Licenses in Use",
"",
"cisco CSR1000V (VXE) processor (revision VXE) with 2070552K/3075K bytes of memory.",
"Processor board ID 9QQ3Y05ZEFO",
"Router operating mode: Autonomous",
"4 Gigabit Ethernet interfaces",
"32768K bytes of non-volatile configuration memory.",
"3978232K bytes of physical memory.",
"6188032K bytes of virtual hard disk at bootflash:.",
"",
"Configuration register is 0x2102"
]
]
}
TASK [task 2 parse show command] ********************************************************************************************************************************************************************
task path: /home/bmarr/CBT-Automating-Networks-with-Ansible/genie_parse_playbook.yml:13
Loading collection clay584.genie from /home/bmarr/.ansible/collections/ansible_collections/clay584/genie
fatal: [10.0.15.7]: FAILED! => {
"msg": "parse_genie: Genie package is not installed. To install, run 'pip install genie'."
}
PLAY RECAP ******************************************************************************************************************************************************************************************
10.0.15.7 : ok=1 changed=0 unreachable=0 failed=1 skipped=0 rescued=0 ignored=0