Stas_Oskin
(Stas Oskin)
January 13, 2014, 3:37pm
1
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!
PhilEv
(PhilEv)
January 15, 2014, 10:02am
2
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