lineinfile - Add alternative backrefs example to docs (#69844)

* lineinfile - Add alternative backrefs example to docs

* Add changelog
pull/69898/head
Sam Doran 4 years ago committed by GitHub
parent 2dbd5dc2ae
commit f5718a354c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- lineinfile - add example of using alternative backrefs syntax (https://github.com/ansible/ansible/issues/42794)

@ -200,6 +200,14 @@ EXAMPLES = r'''
regexp: '^%ADMIN ALL='
line: '%ADMIN ALL=(ALL) NOPASSWD: ALL'
validate: /usr/sbin/visudo -cf %s
# See https://docs.python.org/3/library/re.html for further details on syntax
- name: Use backrefs with alternative group syntax to avoid conflicts with variable values
lineinfile:
path: /tmp/config
regexp: ^(host=).*
line: \g<1>{{ hostname }}
backrefs: yes
'''
import os

Loading…
Cancel
Save