Main » 2024 March 25 » Execute Ansible for Local Tasks
11:10 PM Execute Ansible for Local Tasks |
To make Ansible execute a local task, just add corresponding value to hosts directive:
- name: Local task
Then, playbook can be executed simply by calling
hosts: localhost ...
ansible-playbook playbook.yml
More flexible approach is
- name: Do anywhere task
hosts: all
...
And execute with
ansible-playbook playbook.yml --connection=local -i localhost,
|
|
Total comments: 0 | |