Hello,
I am new to ansible tower, and I am trying to migrate my playbooks into ansible tower environment.
in my playbook, I have variable like
db_list:
- { dbid: 1, dbname: abc}
- { dbid: 2, dbname: xyz}
in tower survey, I can put similar info as textarea in survey
dbid: 1, dbname: abc
dbid: 2, dbname: xyz
How can I convert my textarea data into a list of dictionary ? I can’t find any suitable jinj2 filter for conversion, below playbook failed as it complains dbname is undefined.
<br> - name: display textaera <br> debug: <br> msg: "{{item.dbname}}" <br> with_items: "{{var_textarea.splitlines() }}" <br>
<br><br><br>
<br>any help is appreciated ! <br>
|
- |
thanks
Xiangli