Partner links

Debugging a failed Ansible ad hoc command

Ansible IT automation

Ansible is an IT automation and configuration management tool. Of all the most popular Free Software applications of its kind, it is the only one that operates in agentless mode. Chef, CFEngine and Puppet need agents on the client nodes to function.

Ansible operates via SSH, so you don’t need to install any code on the client nodes.

A few minutes ago I was testing a connection to one of the client nodes that I intend to manage with Ansible when it returned the message shown in this screenshot. I was using SSH keys for authentication.
Ansible IT automation

Unfortunately, Ansible does not write to a log file by default, so the error message you see on the screen is all you get. Even when logging is enabled, what’s written to standard output is also what’s written to the log file. Ansible-gurus will likely recognize right away what the cause was, but I had to spend a few minutes looking things over before I figured out what the heck was up: I ran the command from the wrong user account.

Yep, I could still have run the command as root, but use the -u switch to have it run as a specific user, like so: <strong>ansible all -m ping -u finid</strong>. That would have done the trick.

Share:

Share on facebook
Facebook
Share on twitter
Twitter
Share on pinterest
Pinterest
Share on linkedin
LinkedIn

Partner links

Newsletter: Subscribe for updates

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments

Get the latest

On social media

Security distros

Hacker
Linux distros for hacking and pentesting

Crypto mining OS

Bitcoin
Distros for mining bitcoin and other cryptocurrencies

Crypto hardware

MSI GeForce GTX 1070
Installing Nvidia GTX 1070 GPU drivers on Ubuntu

Disk guide

LVM
Beginner's guide to disks & disk partitions in Linux

Bash guide

Bash shell terminal
How to set the PATH variable in Bash
Categories
Archives
0
Hya, what do you think? Please comment.x
()
x