Last updated 8 months ago
At times, we require an Ansible Playbook to run locally on the host server. Few examples are given below -
ansible-playbook --connection=local --inventory 127.0.0.1, playbook_name.yml
We can also, add the host in an inventory file such as -
127.0.0.1 ansible_connection=local
[defaults] transport = local
- hosts: 127.0.0.1 connection: local
Source:
Reference(s):