Created
September 30, 2016 14:43
-
-
Save privateip/c0e440c82dbb22ce0d88a3356156a100 to your computer and use it in GitHub Desktop.
changing default output for nxos_command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: nxos01 | |
tasks: | |
- name: return native objects from cli | |
nxos_command: | |
commands: | |
- command: show version | |
output: json | |
provider: "{{ cli }}" | |
register: output | |
- debug: var=output | |
- name: return text objects from nxapi | |
nxos_command: | |
commands: | |
- command: show version | |
output: text | |
provider: "{{ nxapi }}" | |
register: output | |
- debug: var=output | |
(ansible)[ansible-nxos]$ play show.yaml | |
PLAY [nxos01] ****************************************************************** | |
TASK [return native objects from cli] ****************************************** | |
ok: [nxos01] | |
TASK [debug] ******************************************************************* | |
ok: [nxos01] => { | |
"output": { | |
"changed": false, | |
"stdout": [ | |
{ | |
"bootflash_size": 3184776, | |
"chassis_id": "NX-OSv Chassis", | |
"cpu_name": "QEMU Virtual CPU version 2.0", | |
"header_str": "Cisco Nexus Operating System (NX-OS) Software\nTAC support: http://www.cisco.com/tac\nDocuments: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html\nCopyright (c) 2002-2016, Cisco Systems, Inc. All rights reserved.\nThe copyrights to certain works contained herein are owned by\nother third parties and are used and distributed under license.\nSome parts of this software are covered under the GNU Public\nLicense. A copy of the license is available at\nhttp://www.gnu.org/licenses/gpl.html.\n\nNX-OSv is a demo version of the Nexus Operating System", | |
"host_name": "nxos01", | |
"isan_cmpl_time": "1/11/2016 16:00:00", | |
"isan_file_name": "bootflash:///titanium-d1.7.3.0.D1.1.bin", | |
"isan_tmstmp": "02/11/2016 13:08:11", | |
"kern_uptm_days": 2, | |
"kern_uptm_hrs": 7, | |
"kern_uptm_mins": 6, | |
"kern_uptm_secs": 48, | |
"kick_cmpl_time": "1/11/2016 16:00:00", | |
"kick_file_name": "bootflash:///titanium-d1-kickstart.7.3.0.D1.1.bin", | |
"kick_tmstmp": "02/11/2016 10:30:12", | |
"kickstart_ver_str": "7.3(0)D1(1)", | |
"loader_ver_str": "N/A", | |
"manufacturer": "Cisco Systems, Inc.", | |
"mem_type": "kB", | |
"memory": 3064860, | |
"module_id": "NX-OSv Supervisor Module", | |
"proc_board_id": "TM3E2BA727B", | |
"sys_ver_str": "7.3(0)D1(1)" | |
} | |
], | |
"stdout_lines": [ | |
{ | |
"bootflash_size": 3184776, | |
"chassis_id": "NX-OSv Chassis", | |
"cpu_name": "QEMU Virtual CPU version 2.0", | |
"header_str": "Cisco Nexus Operating System (NX-OS) Software\nTAC support: http://www.cisco.com/tac\nDocuments: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html\nCopyright (c) 2002-2016, Cisco Systems, Inc. All rights reserved.\nThe copyrights to certain works contained herein are owned by\nother third parties and are used and distributed under license.\nSome parts of this software are covered under the GNU Public\nLicense. A copy of the license is available at\nhttp://www.gnu.org/licenses/gpl.html.\n\nNX-OSv is a demo version of the Nexus Operating System", | |
"host_name": "nxos01", | |
"isan_cmpl_time": "1/11/2016 16:00:00", | |
"isan_file_name": "bootflash:///titanium-d1.7.3.0.D1.1.bin", | |
"isan_tmstmp": "02/11/2016 13:08:11", | |
"kern_uptm_days": 2, | |
"kern_uptm_hrs": 7, | |
"kern_uptm_mins": 6, | |
"kern_uptm_secs": 48, | |
"kick_cmpl_time": "1/11/2016 16:00:00", | |
"kick_file_name": "bootflash:///titanium-d1-kickstart.7.3.0.D1.1.bin", | |
"kick_tmstmp": "02/11/2016 10:30:12", | |
"kickstart_ver_str": "7.3(0)D1(1)", | |
"loader_ver_str": "N/A", | |
"manufacturer": "Cisco Systems, Inc.", | |
"mem_type": "kB", | |
"memory": 3064860, | |
"module_id": "NX-OSv Supervisor Module", | |
"proc_board_id": "TM3E2BA727B", | |
"sys_ver_str": "7.3(0)D1(1)" | |
} | |
], | |
"warnings": [] | |
} | |
} | |
TASK [return text objects from nxapi] ****************************************** | |
ok: [nxos01] | |
TASK [debug] ******************************************************************* | |
ok: [nxos01] => { | |
"output": { | |
"changed": false, | |
"stdout": [ | |
"Cisco Nexus Operating System (NX-OS) Software\nTAC support: http://www.cisco.com/tac\nDocuments: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html\nCopyright (c) 2002-2016, Cisco Systems, Inc. All rights reserved.\nThe copyrights to certain works contained herein are owned by\nother third parties and are used and distributed under license.\nSome parts of this software are covered under the GNU Public\nLicense. A copy of the license is available at\nhttp://www.gnu.org/licenses/gpl.html.\n\nNX-OSv is a demo version of the Nexus Operating System\n\nSoftware\n loader: version N/A\n kickstart: version 7.3(0)D1(1)\n system: version 7.3(0)D1(1)\n kickstart image file is: bootflash:///titanium-d1-kickstart.7.3.0.D1.1.bin\n kickstart compile time: 1/11/2016 16:00:00 [02/11/2016 10:30:12]\n system image file is: bootflash:///titanium-d1.7.3.0.D1.1.bin\n system compile time: 1/11/2016 16:00:00 [02/11/2016 13:08:11]\n\n\nHardware\n cisco NX-OSv Chassis ( NX-OSv Supervisor Module )\n QEMU Virtual CPU version 2.0 with 3064860 kB of memory.\n Processor Board ID TM3E2BA727B\n\n Device name: nxos01\n bootflash: 3184776 kB\n\nKernel uptime is 2 day(s), 7 hour(s), 6 minute(s), 49 second(s)\n\n\nplugin\n Core Plugin, Ethernet Plugin\n\nActive Package(s)\n" | |
], | |
"stdout_lines": [ | |
[ | |
"Cisco Nexus Operating System (NX-OS) Software", | |
"TAC support: http://www.cisco.com/tac", | |
"Documents: http://www.cisco.com/en/US/products/ps9372/tsd_products_support_series_home.html", | |
"Copyright (c) 2002-2016, Cisco Systems, Inc. All rights reserved.", | |
"The copyrights to certain works contained herein are owned by", | |
"other third parties and are used and distributed under license.", | |
"Some parts of this software are covered under the GNU Public", | |
"License. A copy of the license is available at", | |
"http://www.gnu.org/licenses/gpl.html.", | |
"", | |
"NX-OSv is a demo version of the Nexus Operating System", | |
"", | |
"Software", | |
" loader: version N/A", | |
" kickstart: version 7.3(0)D1(1)", | |
" system: version 7.3(0)D1(1)", | |
" kickstart image file is: bootflash:///titanium-d1-kickstart.7.3.0.D1.1.bin", | |
" kickstart compile time: 1/11/2016 16:00:00 [02/11/2016 10:30:12]", | |
" system image file is: bootflash:///titanium-d1.7.3.0.D1.1.bin", | |
" system compile time: 1/11/2016 16:00:00 [02/11/2016 13:08:11]", | |
"", | |
"", | |
"Hardware", | |
" cisco NX-OSv Chassis ( NX-OSv Supervisor Module )", | |
" QEMU Virtual CPU version 2.0 with 3064860 kB of memory.", | |
" Processor Board ID TM3E2BA727B", | |
"", | |
" Device name: nxos01", | |
" bootflash: 3184776 kB", | |
"", | |
"Kernel uptime is 2 day(s), 7 hour(s), 6 minute(s), 49 second(s)", | |
"", | |
"", | |
"plugin", | |
" Core Plugin, Ethernet Plugin", | |
"", | |
"Active Package(s)", | |
"" | |
] | |
], | |
"warnings": [] | |
} | |
} | |
PLAY RECAP ********************************************************************* | |
nxos01 : ok=4 changed=0 unreachable=0 failed=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment