Ansible Ad-hoc Commands

Ansible ad-hoc commands will do a quick task but do not want to save that command for later. In below commands “-a” indicates the ad-hoc command.
To see the list of nodes from the master ad-hoc commands.

To create a demo file in node2 from the server using ad-hoc commands.

To install Java in node2 from the server using ad-hoc commands.

To start/manage services by using ad-hoc commands

To copy a file from ansible server to nodes by using ad-hoc commands.

To create a file by using ad-hoc commands

To remove a file by using ad-hoc commands

To create a directory by using ad-hoc commands

Ref:
https://devopssource.blogspot.com/2018/11/ansible-ad-hoc-commands.html

Leave a Reply

avatar
  Subscribe  
Notify of