lineinfile able to change all occurrences of pattern?
15 views
Skip to first unread message
Ryan Groten
unread,
Sep 6, 2016, 12:13:29 PM9/6/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Ansible Project
If a regexp matches multiple lines in a file, lineinfile will only change the first occurrence. Is there a way to make change them all? I saw someone used another task to count the number of occurrences of a pattern and then loop using with_sequence in the lineinfile task but I'm wondering if there's a cleaner way.