Welcome, Guest! Registration

loc2log

Sunday, 2024-12-22
Main » 2024 » March » 25
To make Ansible execute a local task, just add corresponding value to hosts directive:
- name: Local task
  hosts: localhost
  ...
Then, playbook can be executed simply by calling
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,
Views: 362 | Added by: ep | Date: 2024-03-24 | Comments (0)