Advertisement
Guest User

Untitled

a guest
Mar 4th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.52 KB | None | 0 0
  1. ---
  2. - hosts: Switches
  3. gather_facts: no
  4. connection: network_cli
  5.  
  6. tasks:
  7.  
  8. - name: save backup
  9. ios_config:
  10. username: "ansible"
  11. authorize: yes
  12. auth_pass: "ansiblepass"
  13. backup: yes
  14. register: config
  15.  
  16. [Switches]
  17. Switch01 ansible_host=192.168.100.66
  18.  
  19. [Switches:vars]
  20. ansible_become=yes
  21. ansible_become_method=enable
  22. ansible_network_os=ios
  23. ansible_user=ansible
  24. ansible_ssh_pass=ansiblepass
  25. ansible_authorize=yes
  26. ansible_auth_pass=authpass
  27.  
  28. ansible-playbook 2.7.0
  29. config file = /etc/ansible/ansible.cfg
  30. configured module search path = [u'/home/acalero/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  31. ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  32. executable location = /usr/bin/ansible-playbook
  33. python version = 2.7.9 (default, Sep 25 2018, 20:42:16) [GCC 4.9.2]
  34. Using /etc/ansible/ansible.cfg as config file
  35. setting up inventory plugins
  36. Set default localhost to localhost
  37. Parsed /etc/ansible/hosts inventory source with ini plugin
  38. Loading callback plugin default of type stdout, v2.0 from /usr/lib/python2.7/dist-packages/ansible/plugins/callback/default.pyc
  39.  
  40. PLAYBOOK: switches_backup.yaml.old ****************************************************************************************************************************************************************************
  41. 1 plays in switches_backup.yaml.old
  42.  
  43. PLAY [Switches] ********************************************************************************************************************************************************************************************
  44. META: ran handlers
  45.  
  46. TASK [save backup] ********************************************************************************************************************************************************************************************
  47. task path: /home/acalero/ansible-playbooks/switches_backup/switches_backup.yaml.old:8
  48. <192.168.100.66> attempting to start connection
  49. <192.168.100.66> using connection plugin network_cli
  50. <192.168.100.66> local domain socket does not exist, starting it
  51. <192.168.100.66> control socket path is /home/acalero/.ansible/pc/d8fb3c670b
  52. <192.168.100.66> <192.168.100.66> ESTABLISH CONNECTION FOR USER: ansible on PORT 22 TO 192.168.100.66
  53. <192.168.100.66> <192.168.100.66> ssh connection done, setting terminal
  54. <192.168.100.66> <192.168.100.66> loaded terminal plugin for network_os ios
  55. <192.168.100.66> <192.168.100.66> loaded cliconf plugin for network_os ios
  56. <192.168.100.66> <192.168.100.66> firing event: on_open_shell()
  57. <192.168.100.66> <192.168.100.66> firing event: on_become
  58. <192.168.100.66> <192.168.100.66> ssh connection has completed successfully
  59. <192.168.100.66> connection to remote device started successfully
  60. <192.168.100.66> local domain socket listeners started successfully
  61. <192.168.100.66>
  62. <192.168.100.66> local domain socket path is /home/acalero/.ansible/pc/d8fb3c670b
  63. <192.168.100.66> ESTABLISH LOCAL CONNECTION FOR USER: acalero
  64. <192.168.100.66> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /home/acalero/.ansible/tmp/ansible-local-20795jNEN9Z/ansible-tmp-1551716732.29-125541186030584 `" && echo ansible-tmp-1551716732.29-125541186030584="` echo /home/acalero/.ansible/tmp/ansible-local-20795jNEN9Z/ansible-tmp-1551716732.29-125541186030584 `" ) && sleep 0'
  65. Using module file /usr/lib/python2.7/dist-packages/ansible/modules/network/ios/ios_config.py
  66. <192.168.100.66> PUT /home/acalero/.ansible/tmp/ansible-local-20795jNEN9Z/tmpGBmqu8 TO /home/acalero/.ansible/tmp/ansible-local-20795jNEN9Z/ansible-tmp-1551716732.29-125541186030584/AnsiballZ_ios_config.py
  67. <192.168.100.66> EXEC /bin/sh -c 'chmod u+x /home/acalero/.ansible/tmp/ansible-local-20795jNEN9Z/ansible-tmp-1551716732.29-125541186030584/ /home/acalero/.ansible/tmp/ansible-local-20795jNEN9Z/ansible-tmp-1551716732.29-125541186030584/AnsiballZ_ios_config.py && sleep 0'
  68. <192.168.100.66> EXEC /bin/sh -c '/usr/bin/python /home/acalero/.ansible/tmp/ansible-local-20795jNEN9Z/ansible-tmp-1551716732.29-125541186030584/AnsiballZ_ios_config.py && sleep 0'
  69. <192.168.100.66> EXEC /bin/sh -c 'rm -f -r /home/acalero/.ansible/tmp/ansible-local-20795jNEN9Z/ansible-tmp-1551716732.29-125541186030584/ > /dev/null 2>&1 && sleep 0'
  70. The full traceback is:
  71. WARNING: The below traceback may *not* be related to the actual failure.
  72. File "/tmp/ansible_ios_config_payload_o28p8l/ansible_ios_config_payload.zip/ansible/module_utils/network/ios/ios.py", line 114, in get_config
  73. out = connection.get_config(flags=flags)
  74. File "/tmp/ansible_ios_config_payload_o28p8l/ansible_ios_config_payload.zip/ansible/module_utils/connection.py", line 173, in __rpc__
  75. raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
  76.  
  77. [DEPRECATION WARNING]: Param 'username' is deprecated. See the module docs for more information. This feature will be removed in version 2.9. Deprecation warnings can be disabled by setting
  78. deprecation_warnings=False in ansible.cfg.
  79. [DEPRECATION WARNING]: Param 'auth_pass' is deprecated. See the module docs for more information. This feature will be removed in version 2.9. Deprecation warnings can be disabled by setting
  80. deprecation_warnings=False in ansible.cfg.
  81. fatal: [Switch01]: FAILED! => {
  82. "changed": false,
  83. "invocation": {
  84. "module_args": {
  85. "after": null,
  86. "auth_pass": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
  87. "authorize": true,
  88. "backup": true,
  89. "before": null,
  90. "defaults": false,
  91. "diff_against": null,
  92. "diff_ignore_lines": null,
  93. "force": false,
  94. "host": null,
  95. "intended_config": null,
  96. "lines": null,
  97. "match": "line",
  98. "multiline_delimiter": "@",
  99. "parents": null,
  100. "password": null,
  101. "port": null,
  102. "provider": null,
  103. "replace": "line",
  104. "running_config": null,
  105. "save": false,
  106. "save_when": "never",
  107. "src": null,
  108. "ssh_keyfile": null,
  109. "timeout": null,
  110. "username": "ansible"
  111. }
  112. },
  113. "msg": "show running-configrn ^rn% Invalid input detected at '^' marker.rnrnSW01-01#"
  114. }
  115. to retry, use: --limit @/home/acalero/ansible-playbooks/switches_backup/switches_backup.yaml.retry
  116.  
  117. PLAY RECAP ****************************************************************************************************************************************************************************************************
  118. SW01-01 : ok=0 changed=0 unreachable=0 failed=1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement