I am probably missing something simple. I have the dictionary in vars.yml
deploy_env:
dev:
schemas:
year1:
- main
- custom
year2:
- main
- custom
- security
year3:
- main
- custom
then in my playbook.yml I have something like
- set_fact:
years: "{{ deploy_env.dev.schemas }}"
- name: Create schemas
shell: "mysql ....params go here... {{ item }}"
with_nested:
- "{{ years }}"
The above works fine if schemas in vars.yml was a simple list ie:
...schemas:
- year1
- year2
- year3
But as soon as I add additional items under each year (making this a dictionary(?) I start getting errors on the line: - "{{ years }}".
I basically want to populate {{ years }} with year1,year2,year3 values for this task.
I've looked at many examples but everything I looked at was soo complex and it was about how to create dictionaries which is not helpful.
Thanks!