assigning an array using set_fact

17 views
Skip to first unread message

Cyril Scetbon

unread,
Dec 31, 2015, 11:52:59 AM12/31/15
to Ansible Project
Hi,

I'm trying to assign an array to a variable using set_fact as proposed at http://stackoverflow.com/a/23522774. However, it doesn't work as expected :

TASK: [set_fact roles="['dddd', 'eeeew', 'pffff', 'sssss']"] ************
ok: [master]

TASK: [set_fact roles="{{ roles + ['xxxx'] }}"] *******************************
fatal: [master] => Failed to template roles="{{ roles + ['xxxx'] }}": an unexpected type error occurred. Error was coercing to Unicode: need string or buffer, list found


The first set_fact assign a string to roles and not an array as expected ...
Reply all
Reply to author
Forward
0 new messages