I have an ansible playbook which runs on localhost. I need to run a particular task which is invoked inside my playbook on a different host (different group). Is this possible to speicify within the task that this task should use a different connection as opposed to the local which is used by all other tasks and roles?
role1: (runing on localhost)
- task1
- task2
- include_role:role2
tasks_from: task4 (should run on controllergroup)
role2:
- task4
- task5
Is it possible to achive this scenario without invoking two ansible playbooks?
This is part of a jenkins job and i do two triggers to invoke the ansible playbooks separately, which i want to do within the role1