template Text Area value from AWX survey

42 views
Skip to first unread message

guhan kumar

unread,
Apr 4, 2019, 7:47:20 AM4/4/19
to Ansible Project
Hi All,

I have to create the variable in group vars as below

disk:
    - { device: /dev/sdb  pvname: /dev/sdb1 }
    - { device: /dev/sdc  pvname: /dev/sdc1 }

i am getting disks name from job template survey i textarea , while templating it with below i am getting the error as list cant mapped to disk

block_dev  is the variable name from survey and passing the disk like  /dev/sdb /dev/sbc  (with single space)


disktemp: "{{ block_dev.split(' ')}}

disk: "{% for item in  disktemp} - device: {{ item }} pvname:  {{ item }}1 {% endfor %}


could you please help me to ender this format?
Reply all
Reply to author
Forward
0 new messages