Оскорбительные строки появляются при запуске ansible playbook для git клонирования проекта

Привет, я пытаюсь клонировать проект с помощью ansible, но продолжаю получать следующую ошибку.

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://[email protected]:/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://[email protected]:/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 задача у меня есть

  - git: repo=ssh://[email protected]:/component/exact/repo.git
         dest=/home/
         accept_hostkey = true
         version= {{someversion}}
         accept_hostkey = true

У меня есть и другие задачи в моем playbook, но они работают нормально, но всякий раз, когда я включаю git, он терпит неудачу.


person user_dev    schedule 24.08.2016    source источник


Ответы (1)


Синтаксис со знаком равенства используется только при использовании однострочного формата для модулей; когда вы разбиваете их на несколько строк, вы должны передать хэш YAML, используя синтаксис key: value:

- git:
    repo: ssh://[email protected]:/component/exact/repo.git
    dest: /home/
    accept_hostkey: true
    version: "{{someversion}}"
person Xiong Chiamiov    schedule 24.08.2016
comment
@ smiller171 Вы были не согласны со мной или с уже удаленным комментарием? - person Xiong Chiamiov; 25.08.2016
comment
нет, другой комментарий удалили. Не могу редактировать комментарии, поэтому удалю. - person MillerGeek; 25.08.2016