Hi ,
I'm using the following to set the environment for an already extracted
package to append to PATH
- name: Set Environment
lineinfile: dest='/etc/environment' state=present backrefs=yes regexp=
'PATH=(["]*)((?!.*?{{append_var}}).*?)(["]*)$' line=
"PATH=\1\2:{{append_var}}\3"
The append_var has been declared as follows
append_var:
'/srv/chat/erlang/bin:/srv/chat/erlang/lib:/srv/chat/ejabberd/bin:/srv/chat/ejabberd/etc:/srv/chat/ejabberd/lib:/srv/chat/ejabberd/sbin:/srv/chat/ejabberd/share:/srv/chat/ejabberd/var/'
While the playbook is executed it returns the below error
Note: The error may actually appear before this position: line 7, column 15
- name: Set Environment
lineinfile: dest='/etc/environment' state=present backrefs=yes regexp=
'PATH=(["]*)((?!.*?{{append_var}}).*?)(["]*)$' line=
"PATH=\1\2:{{append_var}}\3"
^
We could be wrong, but this one looks like it might be an issue with
missing quotes. Always quote template expression brackets when they
start a value. For instance:
with_items:
- {{ foo }}
Should be written as:
with_items:
- "{{ foo }}"
Please guide if I'm missing some expressions
--
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/f44812fe-efbd-425e-9e2f-cc4a890559f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.