“ msg”:“无效/不正确的用户名/密码。验证失败。”在cisco-ios ansible中进行备份时

时间:2019-07-26 10:33:37

标签: ansible backup cisco-ios

我正在尝试执行备份剧本,但备份时遇到错误。

这是我的代码:

ignore_unreachable: true

错误显示密码无效,但我使用了正确的密码

---
- hosts: cisco
  gather_facts: true
  vars:
    ansible_become: yes
    ansible_become_method: enable
    ansible_user: translab
    ansible_password: cisco
    ansible_become_pass: cisco
    ansible_network_os: ios
    ansible_connection: network_cli
  tasks:
   - ios_command:
        commands: show run
     register: show_run
   - copy:
        content: "{{ show_run.stdout[0]}}"
        host: ansibletower
        username: root
        password: root@123
        dest: "/etc/ansible/backup/'{{ inventory_hostname }}'.txt"
     delegate_to: ansibletower

0 个答案:

没有答案