Ansible is a suite of software tools that enables infrastructure as code. It is open-source and includes functionality for software provisioning, configuration management, and application deployment. Originally written by Michael DeHaan in 2012 and acquired by Red Hat in 2015, Ansible is designed to configure both Unix-like systems and Microsoft Windows.
Ansible is agentless, meaning it relies on temporary remote connections via SSH or Windows Remote Management for PowerShell execution, rather than requiring agents to be installed on managed nodes. The Ansible control node runs on most Unix-like systems that can run Python. System configuration is defined using its own declarative language, with reusable system descriptions expressed in YAML files known as Playbooks.
To execute ansible play locally, we could create an inventory file with localhost included. And then execute the ansible playbook with connection option as local.
# ansible-localhost
[localhost]
127.0.0.1
ansible-playbook --connection=local -i ansible-localhost {playbook}.yaml