title: How to pull while deployment in ansible
body: <p>I am using <a href="http://www.ansible.com/" rel="noreferrer">Ansible</a> for configuration management and the following task to clone a Git repo:</p>
  
  <pre><code># Example git checkout from Ansible Playbooks
  - git: repo=git://foosball.example.org/path/to/repo.git
         dest=/srv/checkout
         version=release-0.22
  </code></pre>
  
  <p>This clones the repo with the particular version.</p>
  
  <p>Does it do a <code>git pull</code> when run again if the repo already exists? Or does it simply clone the repo all the time? How to do a <code>git pull</code> in Ansible if the repo already exists and how can we run a specific command if the repo exists and same if the repo is cloned for the first time?</p>