try the YAML '>' escaping mechanism ( http://yaml.org/spec/current.html#id2503232):
lineinfile: > dest="{{deploy_root}}/{{instance}}/{{project}}/{{project}}/local_settings.py" regexp='^NAME' line="NAME: {{db_name}}," The lines following the '>' to be interpreted as a scalar and not a potential YAML structure. K Kahlil (Kal) Hodgson GPG: C9A02289 Head of Technology (m) +61 (0) 4 2573 0382 DealMax Pty Ltd (w) +61 (0) 3 9008 5281 Suite 1415 401 Docklands Drive Docklands VIC 3008 Australia "All parts should go together without forcing. You must remember that the parts you are reassembling were disassembled by you. Therefore, if you can't get them together again, there must be a reason. By all means, do not use a hammer." -- IBM maintenance manual, 1925 On Wed, Jan 15, 2014 at 9:02 PM, Philippe Eveque <philippe.eve...@gmail.com>wrote: > That should help > > vars: > - a_column: "\x3A" > > and use {{ a_column}} in the expression > > There should be a proper/better way to escape it, > I think the point is arround the " " (<white space>) that is after > the ':' so Yaml consider this a a mapping > > HTH > > 2014/1/13 Stas Oskin <stas.os...@gmail.com>: > > Hi, > > > > I'm trying to use an instruction with lineinfile: > > - lineinfile: > > > dest="{{deploy_root}}/{{instance}}/{{project}}/{{project}}/local_settings.py" > > regexp='^NAME' line="'NAME': '{{db_name}}'," > > > > No matter what I try, the column does not work. > > > > Any ideas will be appreciated! > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Ansible Project" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to ansible-project+unsubscr...@googlegroups.com. > > To post to this group, send email to ansible-project@googlegroups.com. > > For more options, visit https://groups.google.com/groups/opt_out. > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to ansible-project+unsubscr...@googlegroups.com. > To post to this group, send email to ansible-project@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.