0

I have an existing playbook that suddenly seems to be having an odd problem I cant identify.

There are a series of API calls to our password manager, then setting specific facts based on those calls. Finally I get to this command.

- name: Backup configuration from switch stacks....
  cisco.ios.ios_config:
    backup: true
    backup_options:
      filename: "{{  file_string  }}.txt"
      dir_path: "/home/user_account/backups/{{  inventory_hostname  }}"

Which gives me a super odd verbose output of:

The full traceback is:
  File "/home/user_account/.local/lib/python3.10/site-packages/ansible_collections/cisco/ios/plugins/module_utils/network/ios/ios.py", line 60, in get_capabilities
    capabilities = Connection(module._socket_path).get_capabilities()
  File "/home/user_account/.local/lib/python3.10/site-packages/ansible/module_utils/connection.py", line 193, in __rpc__
    response = self._exec_jsonrpc(name, *args, **kwargs)
  File "/home/user_account/.local/lib/python3.10/site-packages/ansible/module_utils/connection.py", line 140, in _exec_jsonrpc
    raise ConnectionError(
fatal: [hostname]: FAILED! => changed=false
  invocation:
    module_args:
      after: null
      backup: true
      backup_options:
        dir_path: /home/user_account/backups/hostname
        filename: hostname_20240822T195858.txt
      before: null
      defaults: false
      diff_against: null
      diff_ignore_lines: null
      intended_config: null
      lines: null
      match: line
      multiline_delimiter: '@'
      parents: null
      replace: line
      running_config: null
      save_when: never
      src: null
  msg: socket path /home/user_account/.ansible/pc/e1b79382e1 does not exist or cannot be found. See Troubleshooting socket path issues in the Network Debug and Troubleshooting Guide

...for each host that the play is running against. I found a couple suggestions that didn't make much sense. The first being to use LibSSH, but I have found a ton of problems when not using Paramiko, and am hesitant to change back. The second being to downgrade to Ansible 2.14 due to some unspecified "issues" with .15-.17.

This seems super odd to me as the path the error is providing seems to be a fake or temporary path for something Ansible is doing in the background which leaves me very little to work with.

I am currently running Ansible core 2.17.0, with Python 3.10.12, on Ubuntu 22.04.

4
  • 2
    It is not a fake path, persistent connection sockets are stored in ~/.ansible/pc for all network devices. Commented Aug 23, 2024 at 1:51
  • It looked kind of odd, but now that I understand what its doing that makes more sense. Any idea what could be causing this randomly? The playbook was working until suddenly it was not, heh. Commented Aug 23, 2024 at 13:28
  • 1
    As written clearly in your pasted log: See Troubleshooting socket path issues in the Network Debug and Troubleshooting Guide Commented Aug 23, 2024 at 13:52
  • Well I already had most of that enabled. What I didn't, I have since turned on, but the network debug log has no smoking guns that I can see. It goes straight from importing the Cisco module, to immediately failing with the same traceback I provided. Commented Aug 23, 2024 at 15:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.