reigster没有使用合理的git任务 [英] reigster is not working with ansible git task
本文介绍了reigster没有使用合理的git任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的可靠的play-book中调试git任务。当我使用 register 关键字时,但它引发了错误。这是我的手册代码
- git:
repo:http://< git url> /< user> /< repo>
dest:/ home / atul / Workplace / test-ansible
版本:{{GIT_TAG}}
refspec:'+ refs / tags / {{GIT_TAG}}:refs / remotes / origin / tags / {{GIT_TAG}}'
update:no
register:克隆
我得到这个错误
任务[git] ************* ************************************************** ************************************************** *******************
致命:[host]:FAILED! =>支持的参数包括:accept_hostkey,bare,clone,depth,dest,可执行文件,强制,key_file,递归,等等。{changed:false,failed:true,msg引用,refspec,remote,repo,ssh_opts,track_submodules,umask,update,verify_commit,version}
重试,使用:--limit @ / home / atul / Workplace / infra-automation / scripts / iquippo-build .retry
播放回放************************************** ************************************************** ****************************************
解决方案
register
是一项任务参数,而不是模块参数,所以请注意填充:
- git:
repo:http://< git url> /< user> /< repo>
dest:/ home / atul / Workplace / test-ansible
版本:{{GIT_TAG}}
refspec:'+ refs / tags / {{GIT_TAG}}:refs / remotes / origin / tags / {{GIT_TAG}}'
更新:无
寄存器:克隆
I want to debug git task in my ansible play-book.When I am using register keyword for that but it is throwing me error .This is my playbook code
- git:
repo: http://<git url>/<user>/<repo>
dest: /home/atul/Workplace/test-ansible
version: "{{ GIT_TAG }}"
refspec: '+refs/tags/{{GIT_TAG}}:refs/remotes/origin/tags/{{GIT_TAG}}'
update: no
register: cloned
I am getting this error
TASK [git] ************************************************************************************************************************************
fatal: [host]: FAILED! => {"changed": false, "failed": true, "msg": "Unsupported parameters for (git) module: register. Supported parameters include: accept_hostkey,bare,clone,depth,dest,executable,force,key_file,recursive,reference,refspec,remote,repo,ssh_opts,track_submodules,umask,update,verify_commit,version"}
to retry, use: --limit @/home/atul/Workplace/infra-automation/scripts/iquippo-build.retry
PLAY RECAP ************************************************************************************************************************************
解决方案
register
is a task parameter, not module parameter, so mind the padding:
- git:
repo: http://<git url>/<user>/<repo>
dest: /home/atul/Workplace/test-ansible
version: "{{ GIT_TAG }}"
refspec: '+refs/tags/{{GIT_TAG}}:refs/remotes/origin/tags/{{GIT_TAG}}'
update: no
register: cloned
这篇关于reigster没有使用合理的git任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文