Hello,

Finally we made it work using the following approach:

Inventory file:
Host1 mygroups='["groupA","groupB"]'

Created two playbook files one with the tasks (PlaybookTasks.yml) and one that 
does an iteration (Playbook.yml)
Playbook.yml:
---
- hosts: all
  tasks:
    - include: PlaybookTasks.yml mygroup="{{ item }}"
      with_items: "{{ mygroups}}"

PlaybookTasks.yml:
- name: Include vars
  include: "group_vars/{{ group}}/vars.yml"
- name: Download application
 .....

The structure of the host_vars and group_vars remained as I initially explained.

Thank you all for the support and your prompt answers.

Best Regards,
Konstantinos

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9837e3b6-5cc7-4189-9491-a5789133a7aa%40googlegroups.com.

Reply via email to