You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At least one way to use backreferences in lineinfile module that will work in both stable and dev version of Ansible.
That way should be the same (or YAML equivalent) way as in the documentation at http://docs.ansible.com/lineinfile_module.html#examples - the documentation is correct for v1.6, but there's no mention of the incompatibility with previous versions
Actual Results:
The resulting line was copypasted from vim, comments added:
# single quotes in 1.5.4
auto_prepend_file = \1 \auto_prepend_file = \\1 /vagrant/scripts/inc.prepend.php
# single quotes in 1.6
^A auto_prepend_file = \^A \1 /vagrant/scripts/inc.prepend.php
# double quotes in 1.5.4
auto_prepend_file = auto_prepend_file = \1 \1 /vagrant/scripts/inc.prepend.php
# double quotes in 1.6
^A ^A auto_prepend_file = auto_prepend_file = /vagrant/scripts/inc.prepend.php
The CTRL+A character in 1.6 is weird and most likely a bug
There is no way to insert a backslash in the resulting line using v1.6 with double quotes
Can't find any backward compatibility even if I try really really hard :)
The text was updated successfully, but these errors were encountered:
The change seems to originate from 2bfaacd according to git-bisect. #5679#6448
2bfaacd17063ed52ceca53f55861acb7ff655c66 is the first bad commit
commit 2bfaacd17063ed52ceca53f55861acb7ff655c66
Author: Jakub Jirutka <jakub@jirutka.cz>
Date: Wed Mar 12 18:21:53 2014 +0100
Fix #5679 again after recent changes in core
:040000 040000 00d76a0298764193e6c0faecafd3def05f1bca74 caf72582641059c85c5453f9720869967c88c842 M library
:040000 040000 209a0f0242229d90669d59f3ca0616964df0c424 b4eb84a557be36a5c282558c9be3f1520df5121f M test
I've gone ahead and reverted the above commit, due to the fact that when using the decode() call things like \1 are interpretted as an octal escape sequence, so we can't really use that function effectively there. Thanks!
Issue Type:
Bug Report
Ansible Version:
Environment:
Ubuntu 12.04 (both)
Summary:
There seems to be no way to use backreferences in the lineinfile module that works in both current stable and devel versions (see above).
Number of backslashes to correctly use a positional (numbered) backref:
Steps To Reproduce:
Use the lineinfile module with backrefs=yes like this:
Expected Results:
Actual Results:
The resulting line was copypasted from vim, comments added:
The text was updated successfully, but these errors were encountered: