Advertisement
Sergey_Gorshkov

Untitled

May 2nd, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.39 KB | None | 0 0
  1. [root@ansible ansible]# ansible-playbook -s d-link.yml -l SW1 -e '{"COMMAND":"show switch"}'
  2. [DEPRECATION WARNING]: The sudo command line option has been deprecated in favor of the "become" command line arguments. This feature will be removed in version 2.9. Deprecation warnings can be disabled by setting
  3. deprecation_warnings=False in ansible.cfg.
  4.  
  5. PLAY [all] **********************************************************************************************************************************************************************************************************************************
  6.  
  7. TASK [telnet,login and execute command] *****************************************************************************************************************************************************************************************************
  8. fatal: [172.16.117.96]: FAILED! => {"changed": true, "cmd": "telnet \"172.16.117.96\"", "delta": "0:00:00.816523", "end": "2019-05-01 14:04:56.061234", "msg": "non-zero return code", "rc": 1, "start": "2019-05-01 14:04:55.244711", "stdout": "Trying 172.16.117.96...\r\r\nConnected to 172.16.117.96.\r\r\nEscape character is '^]'.\r\r\n\u001b[0m\u001b[2J\u001b[1;1H\u001b[2J\rD\r \n\r DES-3200-26 Fast Ethernet Switch\n\r Command Line Interface\n\r\n\r Firmware: Build 1.60.B009\n\r Copyright(C) 2010 D-Link Corporation. All rights reserved.\n\r\rUserName:father\n\r\rPassWord:**************\n\r\n\rDES-3200-26:5#show switch\n\rCommand: show switch\n\r\n\rDevice Type : DES-3200-26 Fast Ethernet Switch\n\rMAC Address : 1C-BD-B9-60-9B-60\n\rIP Address : 172.16.117.96 (Manual)\n\rVLAN Name : u117\n\rSubnet Mask : 255.255.255.0\n\rDefault Gateway : 172.16.117.1\n\rBoot PROM Version : Build 1.00.B004\n\rFirmware Version : Build 1.60.B009\n\rHardware Version : A1\n\rSerial Number : PVHQ1A5000184\n\rSystem Name : Office-RTI\n\rSystem Location : office 4 mikr 6 dom\n\rSystem Uptime : 7 days, 23 hours, 2 minutes, 13 seconds\n\rSystem Contact : 095-120-13-29\n\rSpanning Tree : Disabled\n\rGVRP : Disabled\n\rIGMP Snooping : Disabled\n\rVLAN Trunk : Disabled\n\r802.1X : Disabled\n\rTelnet : Enabled (TCP 23)\n\rWeb : Enabled (TCP 80)\n\rRMON : Disabled\n\rSSH : Disabled\n\rSSL : Disabled\n\rCLI Paging : Disabled\n\rSyslog Global State: Enabled\n\rDual Image : Supported\n\rPassword Encryption Status : Enabled\n\r\n\rDES-3200-26:5#logout\n\rCommand: logout\n\r\n\rDES-3200-26:5#\u001b[0m\n\r\n\r**********\n\r* Logout *\n\r**********Connection closed by foreign host.\r\r\n53110245175006\r\nshow switch\r\nlogout\r\nexit\r\nquit\r\nshow switch\r\nlogout\r\nexit\r\nquit", "stdout_lines": ["Trying 172.16.117.96...", "", "Connected to 172.16.117.96.", "", "Escape character is '^]'.", "", "\u001b[0m\u001b[2J\u001b[1;1H\u001b[2J", "D", " ", "", " DES-3200-26 Fast Ethernet Switch", "", " Command Line Interface", "", "", " Firmware: Build 1.60.B009", "", " Copyright(C) 2010 D-Link Corporation. All rights reserved.", "", "", "UserName:father", "", "", "PassWord:**************", "", "", "DES-3200-26:5#show switch", "", "Command: show switch", "", "", "Device Type : DES-3200-26 Fast Ethernet Switch", "", "MAC Address : 1C-BD-B9-60-9B-60", "", "IP Address : 172.16.117.96 (Manual)", "", "VLAN Name : u117", "", "Subnet Mask : 255.255.255.0", "", "Default Gateway : 172.16.117.1", "", "Boot PROM Version : Build 1.00.B004", "", "Firmware Version : Build 1.60.B009", "", "Hardware Version : A1", "", "Serial Number : PVHQ1A5000184", "", "System Name : Office-RTI", "", "System Location : office 4 mikr 6 dom", "", "System Uptime : 7 days, 23 hours, 2 minutes, 13 seconds", "", "System Contact : 095-120-13-29", "", "Spanning Tree : Disabled", "", "GVRP : Disabled", "", "IGMP Snooping : Disabled", "", "VLAN Trunk : Disabled", "", "802.1X : Disabled", "", "Telnet : Enabled (TCP 23)", "", "Web : Enabled (TCP 80)", "", "RMON : Disabled", "", "SSH : Disabled", "", "SSL : Disabled", "", "CLI Paging : Disabled", "", "Syslog Global State: Enabled", "", "Dual Image : Supported", "", "Password Encryption Status : Enabled", "", "", "DES-3200-26:5#logout", "", "Command: logout", "", "", "DES-3200-26:5#\u001b[0m", "", "", "**********", "", "* Logout *", "", "**********Connection closed by foreign host.", "", "*********", "show switch", "logout", "exit", "quit", "show switch", "logout", "exit", "quit"]}
  9. ...ignoring
  10.  
  11. TASK [Debug output] *************************************************************************************************************************************************************************************************************************
  12. ok: [172.16.117.96] => {
  13. "telnet_output.stdout_lines": [
  14. "Trying 172.16.117.96...",
  15. "",
  16. "Connected to 172.16.117.96.",
  17. "",
  18. "Escape character is '^]'.",
  19. "",
  20. "\u001b[0m\u001b[2J\u001b[1;1H\u001b[2J",
  21. "D",
  22. " ",
  23. "",
  24. " DES-3200-26 Fast Ethernet Switch",
  25. "",
  26. " Command Line Interface",
  27. "",
  28. "",
  29. " Firmware: Build 1.60.B009",
  30. "",
  31. " Copyright(C) 2010 D-Link Corporation. All rights reserved.",
  32. "",
  33. "",
  34. "UserName:father",
  35. "",
  36. "",
  37. "PassWord:**************",
  38. "",
  39. "",
  40. "DES-3200-26:5#show switch",
  41. "",
  42. "Command: show switch",
  43. "",
  44. "",
  45. "Device Type : DES-3200-26 Fast Ethernet Switch",
  46. "",
  47. "MAC Address : 1C-BD-B9-60-9B-60",
  48. "",
  49. "IP Address : 172.16.117.96 (Manual)",
  50. "",
  51. "VLAN Name : u117",
  52. "",
  53. "Subnet Mask : 255.255.255.0",
  54. "",
  55. "Default Gateway : 172.16.117.1",
  56. "",
  57. "Boot PROM Version : Build 1.00.B004",
  58. "",
  59. "Firmware Version : Build 1.60.B009",
  60. "",
  61. "Hardware Version : A1",
  62. "",
  63. "Serial Number : PVHQ1A5000184",
  64. "",
  65. "System Name : Office-RTI",
  66. "",
  67. "System Location : office 4 mikr 6 dom",
  68. "",
  69. "System Uptime : 7 days, 23 hours, 2 minutes, 13 seconds",
  70. "",
  71. "System Contact : 095-120-13-29",
  72. "",
  73. "Spanning Tree : Disabled",
  74. "",
  75. "GVRP : Disabled",
  76. "",
  77. "IGMP Snooping : Disabled",
  78. "",
  79. "VLAN Trunk : Disabled",
  80. "",
  81. "802.1X : Disabled",
  82. "",
  83. "Telnet : Enabled (TCP 23)",
  84. "",
  85. "Web : Enabled (TCP 80)",
  86. "",
  87. "RMON : Disabled",
  88. "",
  89. "SSH : Disabled",
  90. "",
  91. "SSL : Disabled",
  92. "",
  93. "CLI Paging : Disabled",
  94. "",
  95. "Syslog Global State: Enabled",
  96. "",
  97. "Dual Image : Supported",
  98. "",
  99. "Password Encryption Status : Enabled",
  100. "",
  101. "",
  102. "DES-3200-26:5#logout",
  103. "",
  104. "Command: logout",
  105. "",
  106. "",
  107. "DES-3200-26:5#\u001b[0m",
  108. "",
  109. "",
  110. "**********",
  111. "",
  112. "* Logout *",
  113. "",
  114. "**********Connection closed by foreign host.",
  115. "",
  116. "*********",
  117. "show switch",
  118. "logout",
  119. "exit",
  120. "quit",
  121. "show switch",
  122. "logout",
  123. "exit",
  124. "quit"
  125. ]
  126. }
  127.  
  128. PLAY RECAP **********************************************************************************************************************************************************************************************************************************
  129. 172.16.117.96 : ok=2 changed=1 unreachable=0 failed=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement