Column does not work in lineinfile module

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!

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

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