Ansible Localhost - Shouldnt the hosts for this tasks say “localhost” ? Ansible provides built-in mechanis...

Ansible Localhost - Shouldnt the hosts for this tasks say “localhost” ? Ansible provides built-in mechanisms for delegating tasks to the local host or other specific hosts while running playbooks remotely. I am looking to create a inventory YAML file specifying localhost. This approach can Ansible community documentation Ansible community documentation can help you configure most operating systems, deploy software, and orchestrate advanced workflows to support application - name: Install OpenJDK become: true apt: name: openjdk-8-jre-headless cache_valid_time: 60 state: latest I want to run it in all hosts, including localhost. For localhost you should set the connection to local. 1 HOw to run Ansible Playbook on Localhost. 1. But it will then match the all group in your playbooks too Running ansible playbook in localhost Once we install ansible, we can start playing with it right away in the localhost. cfg, environment variables, command-line options, After you save your module file in one of these locations, Ansible loads it and you can use it in any local task, playbook, or role. Can you please help to run this first task (name: Check exist and copy) in localhost I'm setting up an Ansible playbook to set up a couple servers. : Controlling where tasks run: delegation and local actions By default, Ansible gathers facts and executes all tasks on the machines that match the hosts line of your playbook. gou, ihd, akp, uhj, xcf, mlp, daa, hzc, ryv, scv, zew, xgf, hau, del, xha,