Unable to pass the value for a variable in included playbook via another variable in the calling playbook

11 views
Skip to first unread message

ishan jain

unread,
Oct 24, 2016, 11:36:40 AM10/24/16
to Ansible Project
I have a playbook which requires to perform some actions for each string in a comma separated list. So i put the repeatable tasks in another playbook and included that in a master playbook using with_items:


     - include:included.yaml module="{{item}}"
       with_items: "{{modules.split(',')}}"


The included playbook uses the value of module but with the way i am calling it, it is not getting the value in var module. I have tried many variations to this like:

     - include: install_service.yaml 
       vars:
          module="{{item}}"
       with_items: "{{modules.split(',')}}"




But none of them works. What is it that i am doing wrong here ?
Reply all
Reply to author
Forward
0 new messages