Sometimes, roles need different mandatory variables that needs to be defined when calling them. For instance
- hosts: localhost
remote_user: root
roles:
- role: ansible-aks
name: myaks
resource_group: myresourcegroup
Inside the role, it can be controlled like this:
- name: Assert AKS Variables
assert:
that: "{{ item }} is defined"
msg: "{{ item }} is not defined"
with_items:
- name
- resource_group
I want to pass a list or dictionary to my role instead of a string. How can I assert that a variable contains a dictionary or a list?