Hi All
I am getting the error "Failed to create temporary directory.In Some Cases,you may have been able to authenticate and did not have permission on the target directory.Consider changing the remote tmp path in ansible.cfg to a path rooted in "/tmp"
I think you need a “delegate: localhost” on your task assuming your local control node has a /tmp. The idea is you want the ping to be executed on the localhost (control node).
control node (localhost) => pings => remote device 1
control node (localhost) => pings => remote device …
control node (localhost) => pings => remote device N
You should not create /tmp directories on Cisco devices that don’t already have them.
We don’t know what Cisco devices you have. Typically, you run Cisco modules using the task level “delegate:” parameter to run them on either the local host (the ansible controller) or some other host that has appropriate network access. The modules use the appropriate API to access the Cisco devices from the delegated host.
The “ping” module you used before is not an ICMP ping. It’s a “yes I can ssh into the remote host and there’s an appropriate python installed there” test. Which for Cisco devices is totally inappropriate anyway.
Walter asked if you were delegating to localhost, and whether your Cisco devices have a /tmp. You answered “yes”, but didn’t say which question you were answering.
If you aren’t delegating to either localhost or some other host with appropriate network access to the Cisco APIs, you will likely not have success. The Cisco devices I’m aware of will not play nicely with attempted ssh connections, which is what your “ping” attempt was trying to do.
Some hosts can be managed by ssh’ing in and using password-less sudo commands – that’s the common paradigm. Not so with many dedicated network devices like Cisco. Those you access via an authenticated API from a designated host (“delegate:”) and modules that speak those APIs.