Ansible and Wget

Don't use shell-module when there is specialized modules available. In your case:

Create directories with file-module:

- name: create project directory {{ common.project_dir }}
  file: state=directory path={{ common.project_dir }}

Download files with get_url-module:

- name: download sources
  get_url: url={{ opencv.url }} dest={{ common.project_dir }}/{{ opencv.file }}

Note the new module call syntax in the examples above.

If you have to use sudo with password remember to give --ask-sudo-pass when needed (see e.g. Remote Connection Information).

Tags:

Ansible