How to remove 'u' from list output in Ansible

There will be an additional 'u' character in list output of Ansible.

The 'u' is not really modifying the list, it is mostly to signify that it is a Python 'unicode string', you can use the list normally with out issues.

We can convert this unicode to ASCII in-order to remove the 'u' character using any of the following Ansible filters.

to_json

to_yaml

This filter can be selected according to the requirements.

That's all…

Leave a Reply