官网地址: http://docs.ansible.com/ansible/git_module.html 有时候我们需要操作git相关操作 看一下这个例子:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# Example git checkout from Ansible Playbooks - git: repo=git://foosball.example.org/path/to/repo.git dest=/srv/checkout version=release-0.22 # Example read-write git checkout from github - git: repo=ssh://git@github.com/mylogin/hello.git dest=/home/mylogin/hello # Example just ensuring the repo checkout exists - git: repo=git://foosball.example.org/path/to/repo.git dest=/srv/checkout update=no # Example just get information about the repository whether or not it has # already been cloned locally. - git: repo=git://foosball.example.org/path/to/repo.git dest=/srv/checkout clone=no update=no # Example checkout a github repo and use refspec to fetch all pull requests - git: repo=https://github.com/ansible/ansible-examples.git dest=/src/ansible-examples refspec=+refs/pull/*:refs/heads/* |
完整的参数列表 parameter required default choices comment……