ansible delete the “u” from the list output

https://stackoverflow.com/questions/21413613/convert-ansible-variable-from-unicode-to-ascii

if you really do have an array:

[u'string1', u'string2', u'string3']

And you want your template/whatever result to be NOT:

ABC=[u'string1', u'string2', u'string3']

But you prefer:

ABC=["string1", "string2", "string3"]

Then, this will do the trick:

ABC=["{{ iscsiname.stdout_lines | list | join("\", \"") }}"]

你可能感兴趣的:(python)