How do I do an anywhere match for a string and replace with some text?

The below playbook doesnt work. But just looking for example to search for 
part of green - reen and replace this with jabba.

How do I do that? Thanks

List


red
blahstuffcans
buns
buns
grey
green
brown
red
grey
grey



Playbook - 

---
- hosts: local
  tasks:
    - name: Line In File
      lineinfile:
        dest: /home/ansible/test.txt
        regexp: '%reen%'
        line: '%jabba%'
      register: foundstuff
    - debug: var=foundstuff


-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/a7d8fe69-7133-406f-8502-25c41fc7213c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to