One of the simplest operations that we can do with Ansible is to execute ad-hoc commands, so let's go ahead and execute a command on the host that we added in the inventory.
Executing ad-hoc commands
How to do it...
To execute an ad-hoc command on any host, we need to do the following:
- We need to go to the Inventories tab from the top navigation bar and select the cookbook inventory.
- Once the inventory section opens up, we need to go to the Hosts tab and select the host on which we want to execute the command.
- After selecting the host, click on the RUN COMMANDS button.
- A form for executing commands will open up. We can choose the module to execute the command. For this example, we will select the shell module from the...