Ad hoc commands in Ansible are used to perform tasks or operations that are needed on an ad hoc basis or only once based upon the requirement. In other words, these are tasks that a user wants to be performed on the fly but doesn’t want to be saved for later use. A quick example of an use case for Ansible ad hoc commands could be to quickly fetch the version information of the group of managed nodes for some other use as a one time task. As this is a quick information need and does not need to be repeated, we would use an ad hoc task to perform this request.
As we proceed with the chapter, there will be some additional switches (extra options that we pass to Ansible commands), that would be introduced based ...