I have a role whose main.yml file includes several *.yml files, e.g.,
main.yml
---
- include: tasks1.yml
- include: tasks2.yml
tasks1.yml
---
- name: Create dir
file; path=/tmp/dir1 state=dir
- name: Create file from template
template: src=my_script.sh.j2 dest=/tmp/dir1/my_script.sh mode=0755
- name: Execute script
command: /tmp/dir1/my_script.sh
I want to execute EVERYTHING in tasks1.yml on my local machine, but tasks2.yml on the target machine. Besides using local_action on all the tasks, what's a more global way to do it?