Jim
Jim

Reputation: 14270

Ansible command module concatenate variable and string?

Is it possible to do something like this with Ansible's command module?

- command: {{ venv_path }}/bin/python {{ repo_path }}/manage.py runserver

Since there are no double quotes around the first set of braces, I get the usual "We could be wrong..." syntax error. But none of the following work either:

- command "{{ venv_path }}"/bin/python ... # Error
- command "{{ venv_path }}/bin/python" ... # Error
- command: "{{ venv_path }}/bin/python {{ repo_path }}/manage.py runserver" # Error

Thanks.

Upvotes: 0

Views: 2440

Answers (1)

Ankit Gupta
Ankit Gupta

Reputation: 565

try shell: "{{ venv_path }}/bin/python {{ repo_path }}/manage.py runserver"

Upvotes: 1

Related Questions