creating a list in a var file, for use in jijna template?

I realize strings are only allowed currently it seems, but I am wondering if there is another way to accomplish the same thing.
This is for file creation, so I realize I can loop thru with with_items, but then I can only loop on 1 list. With the ability to have lists or dictionaries in var files, I think the options become significantly greater, without any more complication of current abilities.

This is all to create start with a single file, on a single box, but to have many loops, with potential for more then 1 or 2 layers.

ERROR: must be stored as dictionary/hash: <type ‘str’>

vars file

First thing, don’t use item in your for loop, it is reserved for ansible loops and will cause confusion.

What is base_vars? how does it get loaded?if it were a yaml file you can do it 2 ways:

mgmt_access_networks: [‘172.22.161.0/24’, ‘172.27.0.0/16’, ‘172.28.0.0/16’, ‘198.18.0.0/15’]

or

mgmt_access_networks:

Brian Coca

" realize strings are only allowed currently it seems, "

This is not correct.

Variables files, such as group_vars/groupname, host_vars/hostname, anything loaded with vars_files or “include_vars” can be YAML or JSON, we prefer YAML, and it can be structured and typed.