# Mapping values are not allows in this context when trying to loop a playbook

**URL:** <https://forum.ansible.com/t/mapping-values-are-not-allows-in-this-context-when-trying-to-loop-a-playbook/26372>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [December 23, 2017, 6:46pm UTC](https://forum.ansible.com/t/mapping-values-are-not-allows-in-this-context-when-trying-to-loop-a-playbook/26372 "2017-12-23T18:46:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Philip\_Gregory](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/philip_gregory/32/3105_2.png) [@Philip\_Gregory](https://forum.ansible.com/u/Philip_Gregory)\
**Post date:** [December 23, 2017, 6:46pm UTC](https://forum.ansible.com/t/mapping-values-are-not-allows-in-this-context-when-trying-to-loop-a-playbook/26372/1 "2017-12-23T18:46:12Z")

</div>

I have created the below update\_windows.yml playbook. I am trying to loop Windows updates until no updates are found because of the broken nature of windows updates.  
When I try to run the playbook, I get the following error:

> ERROR! Syntax Error while loading YAML.  
> The error appears to have been in ‘/home/ben/playbooks/update-windows\_full.yml’: line 8, column 22, but may  
> be elsewhere in the file depending on the exact syntax problem.  
> The offending line appears to be:  
> – name: Check for missing updates.  
> win\_updates: state=searched  
> ^ here  
> exception type: \<class ‘yaml.scanner.ScannerError’\>  
> exception: mapping values are not allowed in this context  
> in “”, line 8, column 22

- name: Update Windows  
hosts: all  
tasks:
- name: Check for missing updates.  
win\_updates: state=searched  
register: update\_count
- name: Install all found updates.  
win\_updates:  
category\_names:
- Application
- Connectors
- DefinitionUpdates
- DeveloperKits
- FeaturePacks
- Guidance
- ServicePacks
- Tools
- UpdateRollups
- CriticalUpdates
- SecurityUpdates  
register: update\_result
- name: Reboot, if needed.  
win\_reboot:  
when: update\_result.reboot\_required  
until: update\_count.found\_update\_count|int=0
