Member-only story

Ansible Ad-Hoc command — ansible command

How to use the ping module, execute a command and retrieve the Ansible Facts from a target node via the ansible command line.

Luca Berton
4 min readOct 27, 2022

What does the ansible command?

I’m going to show you a live demo.

I’m Luca Berton, and welcome to today’s episode of Ansible Pilot.

ansible command

  • Included in Ansible installation
  • command line
  • Ansible ad-hoc

The `ansible` command is probably the first helpful command to learn when you start your journey with Ansible.
It is included in every Ansible installation for the most modern operating system.
It relies on Python language and some libraries such as Jinja2, YAML, WinRM, etc.
It is a command line tool so interact with that using your terminal.
Using the `ansible` command, you could perform some operation to your target node(s), for example, executing single modules or retrieving system information (AKA Ansible Facts).
Each command in the Ansible jargon is called a module. Each module has its own parameter for the execution that you could read in the documentation…

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet