ansible regex with lineinfile module not updating all host

Esteemed Collegues, I have created a Playbook to replcae the Entry in a file using a lineinfile module, while i tried running it run and replace in entry on the one host while not on the another host, i don’t understand why? as it doesn’t report any error even on the debug mode. Do i need to have some another regex pattern.

You need to account for white space. Try:

regexp: '^passwd:.*files ldap'

Ah! that works John! thnx a mile.