I have a playbook test_loop.yml, which includes another playbook and uses loop, which then includes one more playbook as shown below. I need to run the tasks under 3.yml only once per test_loop.yml execution. I tried like below but 3.yml contents are getting executed for each iteration of the loop. Any way I can limit the execution of 3.yml to only once?
test_loop.yml
- hosts: all
tasks:
- include: one.yml
loop:
- 1
- 2
one.yml
- debug:
msg: "I'm one.yml item {{ item }}"
- include: 3.yml
3.yml
- debug:
msg: "I'm a task"
run_once: true