# Passing Dictionaries of Dictonaries in Ansible

**URL:** <https://forum.ansible.com/t/passing-dictionaries-of-dictonaries-in-ansible/37391>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [November 28, 2022, 1:07pm UTC](https://forum.ansible.com/t/passing-dictionaries-of-dictonaries-in-ansible/37391 "2022-11-28T13:07:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rameume](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rameume](https://forum.ansible.com/u/rameume)\
**Post date:** [November 28, 2022, 1:07pm UTC](https://forum.ansible.com/t/passing-dictionaries-of-dictonaries-in-ansible/37391/1 "2022-11-28T13:07:16Z")

</div>

I wanted to simulate the JINJA template bheaviour using set\_facts for WIndows Patching using Ansible. I am doing the below however, getting error  
Sorry New to Ansible here. Attcahed Screenshots.

 ![1.PNG](https://us1.discourse-cdn.com/ansible/original/2X/4/48770669eab48ac40ab8255aef3495859b07b7f7.png)

- name: Sample Dictionary for Windows Update Patches  
set\_fact:
- dict\_updates:
- {‘key’: ‘e0951aaf’, ‘value’: {‘title’: ‘Windows KB5017396’, ‘kb’: [‘5017396’], ‘categories’: [‘Security Updates’, ‘Windows Server 2016’], ‘id’: ‘e0951aaf’, ‘downloaded’: True, ‘installed’: True},  
{‘key’: ‘e0951aed’, ‘value’: {‘title’: ‘Windows KB5012356’, ‘kb’: [‘5012356’], ‘categories’: [‘Security Updates’, ‘Windows Server 2019’], ‘id’: ‘e0951aed’, ‘downloaded’: True, ‘installed’: True},  
{‘key’: ‘e0761aag’, ‘value’: {‘title’: ‘Windows KB5016326’, ‘kb’: [‘5016326’], ‘categories’: [‘Security Updates’, ‘Windows Server 2022’], ‘id’: ‘e0761aag’, ‘downloaded’: True, ‘installed’: True},  
{‘key’: ‘e0911aae’, ‘value’: {‘title’: ‘Windows KB5013397’, ‘kb’: [‘5013397’], ‘categories’: [‘Security Updates’, ‘Windows Server 2016’], ‘id’: ‘e0911aae’, ‘downloaded’: True, ‘installed’: True},}

Not in situation to run whole playbook for getting these values automatically for testing JINJA template

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [November 28, 2022, 1:16pm UTC](https://forum.ansible.com/t/passing-dictionaries-of-dictonaries-in-ansible/37391/2 "2022-11-28T13:16:22Z")

</div>

You don’t say what error you are getting, but you have 8 open braces (“{”) and 5 close braces (“}”), so errors are not surprising.

---

<div class="post-metadata">

**Author:** ![rameume](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rameume](https://forum.ansible.com/u/rameume)\
**Post date:** [November 28, 2022, 1:23pm UTC](https://forum.ansible.com/t/passing-dictionaries-of-dictonaries-in-ansible/37391/3 "2022-11-28T13:23:50Z")

</div>

The error even after fixing braces, ERROR! unexpected parameter type in action: \<class ‘ansible.parsing.yaml.objects.AnsibleSequence’\>

---

<div class="post-metadata">

**Author:** ![Walter\_Rowe](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/walter_rowe/32/4506_2.png) [@Walter\_Rowe](https://forum.ansible.com/u/Walter_Rowe)\
**Post date:** [November 28, 2022, 1:32pm UTC](https://forum.ansible.com/t/passing-dictionaries-of-dictonaries-in-ansible/37391/4 "2022-11-28T13:32:53Z")

</div>

Also check your indentation. set\_fact should align with name.

Walter

---

<div class="post-metadata">

**Author:** ![rameume](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rameume](https://forum.ansible.com/u/rameume)\
**Post date:** [November 28, 2022, 1:40pm UTC](https://forum.ansible.com/t/passing-dictionaries-of-dictonaries-in-ansible/37391/5 "2022-11-28T13:40:38Z")

</div>

Thanks you walter, however, no errors found, if i am keeping only one dictonary, problems is coming with dictioanry containing multiple dicotnaries.

 ![1.PNG](https://us1.discourse-cdn.com/ansible/original/2X/b/b8c5ef0b50fa065e261b2d08ee96a5933f2402f6.png)  
The above contains only one screenshot.

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [November 28, 2022, 1:52pm UTC](https://forum.ansible.com/t/passing-dictionaries-of-dictonaries-in-ansible/37391/6 "2022-11-28T13:52:32Z")

</div>

But you didn’t show us — and by “show” I mean copy-n-paste the text, not a picture of — the input. If you’re going to show us errors and not what produced them, and then have us ask you to show us your inputs every time, this is going to take hours.

Email is cheap. Please include all relevant input, “relevant” meaning complete enough so we can run it ourselves, not just what you think must contain the problem. Because if you knew what the problem was, you’d fix it yourself and not need to ask. Far better to include more than less.

---

<div class="post-metadata">

**Author:** ![rameume](https://avatars.discourse-cdn.com/v4/letter/r/45deac/32.png) [@rameume](https://forum.ansible.com/u/rameume)\
**Post date:** [November 28, 2022, 2:11pm UTC](https://forum.ansible.com/t/passing-dictionaries-of-dictonaries-in-ansible/37391/7 "2022-11-28T14:11:41Z")

</div>

Hello Todd,  
Thanks for you reply. Now I have changed this, executing fine. Attached for your references. Only intention is to simulate input values to JINJA template.

[https://goonlinetools.com/snapshot/code/#x0mvce2zjkau2vgfznpaa](https://goonlinetools.com/snapshot/code/#x0mvce2zjkau2vgfznpaa) (or)  
[https://codefile.io/f/wI9DQJIgClyFm0EsYiUP](https://codefile.io/f/wI9DQJIgClyFm0EsYiUP)
