I have a playbook, which I use for key: value definitions, like this:
x_interfaces:
- eno1
- eno2
And in another playbook (which includes that one, I would like to make a conditional check, like this:
- name: debug message
debug:
msg: There is more then 1 interface in the machine
when: x_interfaces|length > '1'
But it does not work. I get this error message:
The error was: Unexpected templating type error occurred on ({% if x_interfaces|length > '1' %} True {% else %} False {% endif %}): '>' not supported between instances of 'int' and 'str'
What am I doing wrong? If I use x_interfaces|int > '1' it will also fails.