Advertisement
cyberbob61

Untitled

Oct 30th, 2019
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.05 KB | None | 0 0
  1. huawei.yml:
  2.  
  3. - name: test
  4. hosts: test
  5. gather_facts: no
  6.  
  7. tasks:
  8. - name: checking version
  9. ce_command:
  10. commands: display version
  11. register: version
  12.  
  13. - name: debug
  14. debug:
  15. msg: version.stdout
  16. when: '"Huawei" in version.stdout_lines'
  17.  
  18.  
  19. $ ansible-playbook huawei.yml -i testhosts -vvvv
  20.  
  21. ansible-playbook 2.8.6
  22. config file = /etc/ansible/ansible.cfg
  23. configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  24. ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  25. executable location = /usr/bin/ansible-playbook
  26. python version = 2.7.15+ (default, Oct 7 2019, 17:39:04) [GCC 7.4.0]
  27. Using /etc/ansible/ansible.cfg as config file
  28. setting up inventory plugins
  29. host_list declined parsing /home/user/git_root/ansible/testhosts as it did not pass it's verify_file() method
  30. script declined parsing /home/user/git_root/ansible/testhosts as it did not pass it's verify_file() method
  31. auto declined parsing /home/user/git_root/ansible/testhosts as it did not pass it's verify_file() method
  32. Parsed /home/user/git_root/ansible/testhosts inventory source with ini plugin
  33. Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/default.pyc
  34.  
  35. PLAYBOOK: huawei.yml *************************************************************************************************
  36. Positional arguments: huawei.yml
  37. become_method: sudo
  38. inventory: (u'/home/user/git_root/ansible/testhosts',)
  39. forks: 5
  40. tags: (u'all',)
  41. verbosity: 4
  42. connection: smart
  43. timeout: 10
  44. 1 plays in huawei.yml
  45.  
  46. PLAY [Run show commands on routers] **********************************************************************************
  47. META: ran handlers
  48.  
  49. TASK [checking version] **********************************************************************************************
  50. task path: /home/user/git_root/ansible/huawei.yml:27
  51. <10.0.0.1> attempting to start connection
  52. <10.0.0.1> using connection plugin network_cli
  53. <10.0.0.1> local domain socket does not exist, starting it
  54. <10.0.0.1> control socket path is /home/user/.ansible/pc/3d86766b90
  55. <10.0.0.1> <10.0.0.1> ESTABLISH PARAMIKO SSH CONNECTION FOR USER: user on PORT 22 TO 10.0.0.1
  56. <10.0.0.1> connection to remote device started successfully
  57. <10.0.0.1> local domain socket listeners started successfully
  58. <10.0.0.1> loaded cliconf plugin for network_os ce
  59. <10.0.0.1> ssh connection done, setting terminal
  60. <10.0.0.1> loaded terminal plugin for network_os ce
  61. <10.0.0.1> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
  62. <10.0.0.1> firing event: on_open_shell()
  63. <10.0.0.1> Response received, triggered 'persistent_buffer_read_timeout' timer of 0.1 seconds
  64. <10.0.0.1> ssh connection has completed successfully
  65. <10.0.0.1>
  66. <10.0.0.1> local domain socket path is /home/user/.ansible/pc/3d86766b90
  67. <10.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: user
  68. <10.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/user/.ansible/tmp/ansible-local-273775BiaX3/ansible-tmp-1572443165.56-28530366068558 `" && echo ansible-tmp-1572443165.56-28530366068558="` echo /home/user/.ansible/tmp/ansible-local-273775BiaX3/ansible-tmp-1572443165.56-28530366068558 `" ) && sleep 0'
  69. <10.0.0.1> Attempting python interpreter discovery
  70. <10.0.0.1> EXEC /bin/sh -c 'echo PLATFORM; uname; echo FOUND; command -v '"'"'/usr/bin/python'"'"'; command -v '"'"'python3.7'"'"'; command -v '"'"'python3.6'"'"'; command -v '"'"'python3.5'"'"'; command -v '"'"'python2.7'"'"'; command -v '"'"'python2.6'"'"'; command -v '"'"'/usr/libexec/platform-python'"'"'; command -v '"'"'/usr/bin/python3'"'"'; command -v '"'"'python'"'"'; echo ENDFOUND && sleep 0'
  71. <10.0.0.1> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
  72. Using module file /usr/lib/python2.7/dist-packages/ansible/modules/network/cloudengine/ce_command.py
  73. <10.0.0.1> PUT /home/user/.ansible/tmp/ansible-local-273775BiaX3/tmp5wPg0i TO /home/user/.ansible/tmp/ansible-local-273775BiaX3/ansible-tmp-1572443165.56-28530366068558/AnsiballZ_ce_command.py
  74. <10.0.0.1> EXEC /bin/sh -c 'chmod u+x /home/user/.ansible/tmp/ansible-local-273775BiaX3/ansible-tmp-1572443165.56-28530366068558/ /home/user/.ansible/tmp/ansible-local-273775BiaX3/ansible-tmp-1572443165.56-28530366068558/AnsiballZ_ce_command.py && sleep 0'
  75. <10.0.0.1> EXEC /bin/sh -c '/usr/bin/python /home/user/.ansible/tmp/ansible-local-273775BiaX3/ansible-tmp-1572443165.56-28530366068558/AnsiballZ_ce_command.py && sleep 0'
  76. <10.0.0.1> EXEC /bin/sh -c 'rm -f -r /home/user/.ansible/tmp/ansible-local-273775BiaX3/ansible-tmp-1572443165.56-28530366068558/ > /dev/null 2>&1 && sleep 0'
  77. ok: [10.0.0.1] => {
  78. "ansible_facts": {
  79. "discovered_interpreter_python": "/usr/bin/python"
  80. },
  81. "changed": false,
  82. "invocation": {
  83. "module_args": {
  84. "commands": [
  85. "display version"
  86. ],
  87. "host": null,
  88. "interval": 1,
  89. "match": "all",
  90. "password": null,
  91. "port": null,
  92. "provider": null,
  93. "retries": 10,
  94. "ssh_keyfile": null,
  95. "timeout": null,
  96. "transport": null,
  97. "use_ssl": null,
  98. "username": null,
  99. "validate_certs": null,
  100. "wait_for": null
  101. }
  102. },
  103. "stdout": [
  104. "Huawei Versatile Routing Platform Software\nVRP (R) software, Version 5.150 (AR1200 V200R005C10)\nCopyright (C) 2011-2013 HUAWEI TECH CO., LTD\nHuawei AR1220V Router uptime is 3 weeks, 3 days, 4 hours, 42 minutes\n\nMPU 0(Master) : uptime is 3 weeks, 3 days, 4 hours, 42 minutes\nSDRAM Memory Size : 512 M bytes\nFlash Memory Size : 256 M bytes\nNVRAM Memory Size : 512 K bytes\nMPU version information : \n1. PCB Version : AR01SRU1B VER.C\n2. MAB Version : 0\n3. Board Type : AR1220V\n4. CPLD0 Version : 104\n5. BootROM Version : 753\n\nLPU 1 : uptime is 3 weeks, 3 days, 4 hours, 41 minutes\nSDRAM Memory Size : 256 M bytes\nFlash Memory Size : 16 M bytes\nLPU version information : \n1. PCB Version : AR01SVA4B1A VER.C\n2. MAB Version : 0\n3. Board Type : 4FXS1FXO\n4. BootROM Version : 516\n5. BootLoad Version : 626"
  105. ],
  106. "stdout_lines": [
  107. [
  108. "Huawei Versatile Routing Platform Software",
  109. "VRP (R) software, Version 5.150 (AR1200 V200R005C10)",
  110. "Copyright (C) 2011-2013 HUAWEI TECH CO., LTD",
  111. "Huawei AR1220V Router uptime is 3 weeks, 3 days, 4 hours, 42 minutes",
  112. "",
  113. "MPU 0(Master) : uptime is 3 weeks, 3 days, 4 hours, 42 minutes",
  114. "SDRAM Memory Size : 512 M bytes",
  115. "Flash Memory Size : 256 M bytes",
  116. "NVRAM Memory Size : 512 K bytes",
  117. "MPU version information : ",
  118. "1. PCB Version : AR01SRU1B VER.C",
  119. "2. MAB Version : 0",
  120. "3. Board Type : AR1220V",
  121. "4. CPLD0 Version : 104",
  122. "5. BootROM Version : 753",
  123. "",
  124. "LPU 1 : uptime is 3 weeks, 3 days, 4 hours, 41 minutes",
  125. "SDRAM Memory Size : 256 M bytes",
  126. "Flash Memory Size : 16 M bytes",
  127. "LPU version information : ",
  128. "1. PCB Version : AR01SVA4B1A VER.C",
  129. "2. MAB Version : 0",
  130. "3. Board Type : 4FXS1FXO",
  131. "4. BootROM Version : 516",
  132. "5. BootLoad Version : 626"
  133. ]
  134. ]
  135. }
  136.  
  137. TASK [debug] *********************************************************************************************************
  138. task path: /home/user/git_root/ansible/huawei.yml:54
  139. skipping: [10.0.0.1] => {}
  140. META: ran handlers
  141. META: ran handlers
  142.  
  143. PLAY RECAP ***********************************************************************************************************
  144. 10.0.0.1 : ok=1 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement