Yes the hash starts with a $ and includes / as well. I dont follow what you 
mean by escaping them. 

Here is an example hash. So how would I have it read that as one character 
string and swap it with the new hash

 $1$adjkielw$B./Hu9VCs96Zxc3mkVQ35.



On Wednesday, October 12, 2016 at 3:58:25 PM UTC-4, Kai Stian Olstad wrote:
>
> On 12. okt. 2016 21:36, Alan Harkleroad wrote: 
> > So I wrote a short playbook to update our VMs to update the 
> > /boot/grub/grub.conf file to use a new hashed password but the playbook 
> > comes back green with no changes. Not sure what I am doing wrong, any 
> help 
> > is appreciated. 
> > 
> > --- 
> > - host: myhosts 
> >   become: true 
> >   become_method: sudo 
> >   tasks: 
> > 
> >   - name: Update grub.conf file with new passwd hash 
> >     replace: 
> >          dest=/boot/grub/grub.conf 
> >          regexp='password --encrypted currenthash!@#$$$' 
> >          replace='password --encrypted newhash12345667' 
>
> Hard to say without knowing how the current hash looks like, but if the 
> hash contain any regexp special character they need to be escaped. 
> List of them you'll find here 
> https://docs.python.org/2/library/re.html#regular-expression-syntax 
>
> -- 
> Kai Stian Olstad 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/df7e636f-d37a-4f19-8501-fa6b86a9b46b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to