title: pass SSH as argument into ansible-playbook
body: <p>I have Dockerfile:</p>
  
  <pre><code>FROM ubuntu:16.04
  
  ARG ssh_prv_key
  ARG ssh_pub_key
  
  RUN apt-get update &amp;&amp; \
      apt-get install ... USUAL INSTALL STUFF ...
  
  WORKDIR /app/
  
  CMD git clone MY_REPO
  </code></pre>
  
  <p>I build image like this:</p>
  
  <pre><code>$ docker build -t example --build-arg ssh_prv_key="$(cat ~/.ssh/id_rsa)" --build-arg ssh_pub_key="$(cat ~/.ssh/id_rsa.pub)" .
  </code></pre>
  
  <p>When I create container from this image it automaticaly pulls git-repo and save it on host using <code>-v</code> argument and self-destroyes using <code>--rm</code>.</p>
  
  <p>The problem begins when I try to do same things using ansible docker_image module.</p>
  
  <p>playbook looks like this:</p>
  
  <pre><code>---
  - hosts: localhost
    environment:
      PYTHONPATH: /usr/local/lib/python2.7/site-packages/
  
    tasks:
    - name: create image from Dockerfile
      docker_image:
        path: /home/demaunt/Jun/dock_click
        dockerfile: biba.dockerfile
        name: myimage
        buildargs: 
          ssh_pub_key: '{{ pub }}'
          ssh_prv_key: '{{ pvt }}'
  </code></pre>
  
  <p>I start it like this:</p>
  
  <pre><code>ansible-playbook bibansible.yml --extra-vars "pub=$(cat ~/.ssh/id_rsa.pub) pvt=$(cat ~/.ssh/id_rsa)"
  </code></pre>
  
  <p>The image is built succesfully, but when running container I get Permission error (publickey).
  I also tried to pass arguments into .yml file like this:</p>
  
  <pre><code>---
  - hosts: localhost
    environment:
      PYTHONPATH: /usr/local/lib/python2.7/site-packages/
  
    tasks:
    - name: create image from Dockerfile
      docker_image:
        path: /home/demaunt/Jun/dock_click
        dockerfile: biba.dockerfile
        name: myimage
        buildargs: 
          ssh_pub_key:
            command: cat ~/.ssh/id_rsa.pub
          ssh_prv_key: 
            command: cat ~/.ssh/id_rsa
  </code></pre>
  
  <p>P.S. I understand that passing ssh keys into image is not the best option,  but it is acceptable as temporary solution.</p>