My ansible task exec successfully in shell command line, but when I add it to crontab, it failed with error "No authentication methods available"
* * * * * root ansible all -i /tmp/host -f 10 -m ping 2&1 1>/dev/null
any ideas? thanks a lot.
My ansible task exec successfully in shell command line, but when I add it to crontab, it failed with error "No authentication methods available"
* * * * * root ansible all -i /tmp/host -f 10 -m ping 2&1 1>/dev/null
any ideas? thanks a lot.
Finally, I get this issue solved. It just works after "--private-key=/root/.ssh/id_rsa" added explicitly.
I haven't figure out why it's not essential in command line while on the other hand, it cannot be absent in crontab.
* * * * * root ansible all -i /tmp/host -f 10 -m ping --private-key=/root/.ssh/id_rsa 2&1 1>/dev/null