mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50:22 -07:00
Fix quoting issues in lineinfile for individual single-quotes
Fixes #8806
This commit is contained in:
parent
1c3039f079
commit
dc9482d548
2 changed files with 25 additions and 2 deletions
|
@ -337,4 +337,22 @@
|
|||
that:
|
||||
- "result.stat.md5 == '29f349baf1b9c6703beeb346fe8dc669'"
|
||||
|
||||
- name: insert a line into the quoted file with a single quote
|
||||
lineinfile: dest={{output_dir}}/test_quoting.txt line="import g'"
|
||||
register: result
|
||||
|
||||
- name: assert that the quoted file was changed
|
||||
assert:
|
||||
that:
|
||||
- result.changed
|
||||
|
||||
- name: stat the quote test file
|
||||
stat: path={{output_dir}}/test_quoting.txt
|
||||
register: result
|
||||
|
||||
- name: assert test md5 matches after backref line was replaced
|
||||
assert:
|
||||
that:
|
||||
- "result.stat.md5 == 'fbe9c4ba2490f70eb1974ce31ec4a39f'"
|
||||
|
||||
###################################################################
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue