Need assist with Ansible conn to Cisco router

50 views
Skip to first unread message

Sharon Day

unread,
Jan 12, 2022, 4:32:44 PM1/12/22
to Ansible Project
It's pretty basic playbook so not sure why its not working.  

- name: Config Sys
  hosts: router2
  vars:

   ansible_network_os: ios
   ansible_connection: network_cli
   ansible_user: Mxxxxx
   ansible_password: password
   ansible_become: yes
   ansible_become_password: enablepass
   ansible_become_method: enable


  tasks:

    - name: Do not gather hardware facts
      ios_facts:
        gather_subset:
         - "!hardware"

This is the error output:

The full traceback is:
WARNING: The below traceback may *not* be related to the actual failure.
  File "/tmp/ansible_ios_facts_payload_Hc8MOY/ansible_ios_facts_payload.zip/ansible/module_utils/network/common/network.py", line 229, in get_capabilities
    capabilities = Connection(module._socket_path).get_capabilities()
  File "/tmp/ansible_ios_facts_payload_Hc8MOY/ansible_ios_facts_payload.zip/ansible/module_utils/connection.py", line 185, in __rpc__
    raise ConnectionError(to_text(msg, errors='surrogate_then_replace'), code=code)
fatal: [stage-2]: FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    },
    "changed": false,
    "invocation": {
        "module_args": {
            "auth_pass": null,
            "authorize": null,
            "gather_network_resources": null,
            "gather_subset": [
                "!hardware"
            ],
            "host": null,
            "password": null,
            "port": null,
            "provider": null,
            "ssh_keyfile": null,
            "timeout": null,
            "username": null
        }
    },
    "msg": "Internal error"
}

dulh...@mailbox.org

unread,
Jan 13, 2022, 3:03:41 AM1/13/22
to ansible...@googlegroups.com, Sharon Day
hi Sharon

not being very well versed with Ansible myself yet this has cought my attention

ansible_become: yes

I would have though this should be only:

become: yes



--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/74a50bd6-9462-439a-8933-4e7931f160e4n%40googlegroups.com.

Sharon Day

unread,
Jan 13, 2022, 7:44:01 AM1/13/22
to Ansible Project
Thanks for the response but I did confirm with the Network Automation Cookbook that it is indeed supposed to be ansible_become.  I did try it though and got this error message.

[WARNING]: Found variable using reserved name: become

Reply all
Reply to author
Forward
0 new messages