title: Using Ansible to download a single file from a private github repo to a remote host
body: <p>Example scenario: config files for a certain service are kept under version control on a private github repo. I want to write a playbook that fetches one of these files on the remote node and puts it into the desired location.</p>
  
  <p>I can think of several solutions to this:</p>
  
  <ol>
  <li>do a checkout on the machine that runs ansible (<code>local_action</code>) and then use the <code>copy</code> module</li>
  <li>do a checkout on the remote node (with the <code>git</code> module), copy the files to the desired location with <code>command: cp src dest creates=dest</code> (perhaps do this with a handler - only when repo has changes to be pulled)</li>
  <li>use the url module or <code>command: wget https://raw.github.com/repo/.../file creates=file</code> in the playbook to only download the file of interest. Is the <code>command</code> module actually going to check if the file to be created is different from the one that may already exist or does it just check the file exists? </li>
  <li>use wget on the machine that runs ansible (<code>local_action</code>) and then use the copy module to push it to the remote node</li>
  </ol>
  
  <p>What are the advantages/disadvantages of these. Which (if any) of these could be considered good practice. What is the best general solution to this?</p>