# failed to parse: LDAP Config Summary

**URL:** <https://forum.ansible.com/t/failed-to-parse-ldap-config-summary/12880>\
**Category:** Ansible Project\
**Created:** [May 29, 2013, 9:26am UTC](https://forum.ansible.com/t/failed-to-parse-ldap-config-summary/12880 "2013-05-29T09:26:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dmitry\_Horbach](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@Dmitry\_Horbach](https://forum.ansible.com/u/Dmitry_Horbach)\
**Post date:** [May 29, 2013, 9:26am UTC](https://forum.ansible.com/t/failed-to-parse-ldap-config-summary/12880/1 "2013-05-29T09:26:54Z")

</div>

Hi,

Our current sudo configuration is using LDAP and has sudoers\_debug 2 which gives a lot of debug output (we can’t change it).  
This is possibly breaks ansible play:

> # fatal: =\> failed to parse: LDAP Config Summary
> 
> # uri …skipped…
> 
> # sudo: ldap\_set\_option: debug → 0 …skipped… LDAP Config Summary
> 
> # uri …skipped…
> 
> sudo: ldap\_set\_option: debug → 0  
> …skipped…  
> sudo: sudo\_ldap\_lookup(0)=0x02  
> {“msg”: “”, “changed”: false, “results”: [“unzip-6.0-1.el6.x86\_64 providing unzip is already installed”, "wget-1.12-1.4.el6.x86\_64 providing w

> get is already installed", “glibc-2.12-1.80.el6\_3.5.i686 providing glibc.i686 is already installed”], “rc”: 0}  
> FATAL: all hosts have already failed – aborting

My playbook:

```auto

> - name: Install packages
> yum: name=${item} state=present
> sudo: yes
> with_items:
> - unzip
> - wget
> - glibc.i686

Are there any workarounds without changing sudo debug level?

Thanks,
Dmitry 

```

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [May 29, 2013, 11:39am UTC](https://forum.ansible.com/t/failed-to-parse-ldap-config-summary/12880/2 "2013-05-29T11:39:01Z")

</div>

So unless there were some terminal copy/paste issues here, I’m not seeing a failed=True in there, nor a non-zero return code.

Was the failure on a different line perhaps or maybe something didn’t get pasted?

Can you show me the Ansible task header above the output where the failure was?

“fatal: =\> failed to parse: LDAP Config Summary”

perhaps it is where the string “LDAP Config Summary” occurs?

---

<div class="post-metadata">

**Author:** ![Dmitry\_Horbach](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@Dmitry\_Horbach](https://forum.ansible.com/u/Dmitry_Horbach)\
**Post date:** [May 29, 2013, 12:23pm UTC](https://forum.ansible.com/t/failed-to-parse-ldap-config-summary/12880/3 "2013-05-29T12:23:19Z")

</div>

Hi Michael,

Start of play:

> PLAY [playbook] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> GATHERING FACTS \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> ok: [hostname1]  
> TASK: [Install packages] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> fatal: [hostname1] =\> failed to parse: LDAP Config Summary

End of play:

> {“msg”: “”, “changed”: false, “results”: [“unzip-6.0-1.el6.x86\_64 providing unzip is already installed”, “wget-1.12-1.4.el6.x86\_64 providing w get is already installed”, “glibc-2.12-1.80.el6\_3.5.i686 providing glibc.i686 is already installed”], “rc”: 0}
> 
> FATAL: all hosts have already failed – aborting  
> PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
> to retry, use: --limit @/var/tmp/ansible/endeca.retry  
> hostname1 : ok=1 changed=0 unreachable=1 failed=0

Some more lines from sudo output around LDAP Config Summary

> # sudo: ldap\_start\_tls\_s() ok sudo: ldap\_sasl\_bind\_s() ok sudo: no default options found in ou=SUDOers,dc=unix,dc=domain,dc=com LDAP Config Summary
> 
> uri ldap://hostname ldap:hostname  
> ldap\_version 3

Regards,  
Dmitry

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [May 29, 2013, 12:33pm UTC](https://forum.ansible.com/t/failed-to-parse-ldap-config-summary/12880/4 "2013-05-29T12:33:15Z")

</div>

Ah, I see. You are getting spewage from the yum process in your standard output for some reason.

Ansible 1.2 contains some code to look for the start of JSON in some events, which may help you in this case. It will skip down and start parsing at the first “{”.

If you are not using 1.2 (and actually this might be in 1.1, but I forget), that might be helpful.

If you are still getting parse errors, let me know, it’s in the _middle_ of the output or already printed a “{” and we may have to do some fiddling.

---

<div class="post-metadata">

**Author:** ![Dmitry\_Horbach](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@Dmitry\_Horbach](https://forum.ansible.com/u/Dmitry_Horbach)\
**Post date:** [May 29, 2013, 12:51pm UTC](https://forum.ansible.com/t/failed-to-parse-ldap-config-summary/12880/5 "2013-05-29T12:51:56Z")

</div>

I’m using latest 1.2  
In sudo output there are no any extra {. Where is this code about catching JSON in ansible? I will try to check that too

Regards,  
Dmitry

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [May 29, 2013, 1:09pm UTC](https://forum.ansible.com/t/failed-to-parse-ldap-config-summary/12880/6 "2013-05-29T13:09:46Z")

</div>

Sure thing, the fact that it’s inline may mean we need to pass more arguments to yum to surpress that output, unless possibly LDAP is doing something like a “broadcast to all terminals” or something, I’d hope redirection and usage of the library was sufficient.

(Also, what OS are you using? If an older yum, is the repoquery binary available? The code takes a bit different track if not.)

Line 242 (at present) here:

[https://github.com/ansible/ansible/blob/devel/lib/ansible/utils/ **init**.py](https://github.com/ansible/ansible/blob/devel/lib/ansible/utils/ __init__.py)

---

<div class="post-metadata">

**Author:** ![Dmitry\_Horbach](https://avatars.discourse-cdn.com/v4/letter/d/c6cbf5/32.png) [@Dmitry\_Horbach](https://forum.ansible.com/u/Dmitry_Horbach)\
**Post date:** [May 30, 2013, 8:29am UTC](https://forum.ansible.com/t/failed-to-parse-ldap-config-summary/12880/7 "2013-05-30T08:29:51Z")

</div>

Just an update - changing sudoers\_debug to 0 solved the problem (as no output during sudo operations)  
OS: redhat 6.3
