Hello all,
Got a question regarding the following 3 ad-hoc syntax:
1) ansible hostname -m command -a uptime
2) ansible hostname -m shell -a uptime
3) ansible hostname -a uptime
Okay, I get the same outupt - same results from running either command. My question
is, other than saving some keystrokes with the 3rd format, is there any other benefit to
using this (3rd item) syntax vs. the first two?
Thanks all.
Hello, @Trevor
There is no difference between ansible hostname -m command -a uptime and ansible hostname -a uptime. The command module is used by default for the -m option. But the big difference between them both and ansible hostname -m shell -a uptime The shell is not used to execute the command for the command module, but the shell is run for the shell module. Compare: ansible hostname -a set and ansible hostname -m shell -a set
Hello, @Trevor
There is no difference between ansible hostname -m command -a uptime and ansible hostname -a uptime. The command module is used by default for the -m option. But the big difference between them both and ansible hostname -m shell -a uptime The shell is not used to execute the command for the command module, but the shell is run for the shell module. Compare: ansible hostname -a set and ansible hostname -m shell -a set
Hello Alexandre
Thank you for the very nice explanation.
Hope you're safe and well.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.