user_dev user_dev - 3 months ago 29
Git Question

Offending lines appears while running ansible playbook to git clone a project

Hi I am trying to clone a project with ansible but I keep getting the below error

ERROR! this task 'git' has extra params, which is only allowed in the following modules: command, shell, script, include, include_vars, add_host, group_by, set_fact, raw, meta

The error appears to have been in '/vagrant/ansible/roles/rolename/tasks/main.yml': line 67, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:

- git: repo=ssh://git@git.example.sample.net:/component/exact/repo.git
^ here


The error appears to have been in '/vagrant/ansible/roles/rolename/tasks/main.yml': line 67, column 5, but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- git: repo=ssh://git@git.example.sample.net:/component/exact/repo.git
^ here

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.


Ansible task I have is

- git: repo=ssh://git@git.example.sample.net:/component/exact/repo.git
dest=/home/
accept_hostkey = true
version= {{someversion}}
accept_hostkey = true


I have other tasks in my playbook as well but those works fine but whenever I am including git it fails.

Answer

take out the extra spaces in the accept_hostkey = true, i.e. make it accept_hostkey=true

Also, you have it specified twice but that's not the issue I don't think.

Do the same with version=