Managing data types
You might need to know, change, or set the data type on a variable. For example, a registered variable might contain a dictionary when your next task needs a list, or a userpromptmight return a string when your playbook needs a boolean value. Use theansible.builtin.type_debug,ansible.builtin.dict2items, andansible.builtin.items2dictfilters to manage data types. You can also use the data type itself to cast a value as a specific data type.