Ending a line with a backslash in Ansible YAML


  • Thu 16 June 2016
  • misc

Ansible's lineinfile: doesn't make it easy to end a line with a backslash

my use case (yes, the line goes off the right side, so cut and paste to see that line="..." ends with \x5C"... {% raw %} - lineinfile: dest=/opt/local/lib/svc/method/mysqld state=present line=" --basedir=/opt/local --bind-address=127.0.0.1 \x5C" regexp="basedir"

Probably easier and less insane than trying to experiment with escaping backslashes off into oblivion...