Answers: <p>It seems that there is some <a href="https://github.com/hashicorp/packer/issues/5885" rel="nofollow noreferrer">bug</a> in Hashicorps Packer 1.2.0, consider downgrading or upgrading to v1.2.1, comments in GH issue page confirm that the deployed fix is working.</p>
  
Answers: CC BY-SA 3.0
Answers: 2018-02-28T14:28:20.437Z
Answers: 2018-02-28T14:28:20.437Z
Answers: storm
Body: <p>I'm getting an error when running the <code>ansible-local</code> provisioner with a docker builder in Hashicorps Packer.</p>
  
  <p>My template (template.json):</p>
  
  <pre><code>{
    "builders": [
          {
              "type": "docker",
              "image": "ubuntu",
              "commit": "true"
          }
      ],
     "provisioners": [
          {
              "type": "shell",
              "inline": ["sudo apt-get update"]
          },
          {
              "type": "shell",
              "script": "setup_ansible.sh"
          },
          {
              "type": "ansible-local",
              "playbook_file": "./kubeadm.yml"
          }
     ]
  }
  </code></pre>
  
  <p>The error:</p>
  
  <pre><code>docker: Executing Ansible: cd /tmp/packer-provisioner-ansible-local/5a8f3bad-8413-16c3-b255-6a06a9076ef3 &amp;&amp; ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/packer-provisioner-ansible-local/5a8f3bad-8413-16c3-b255-6a06a9076ef3/kubeadm.yml --extra-vars \"packer_build_name=docker packer_builder_type=docker packer_http_addr=\"  -c local -i /tmp/packer-provisioner-ansible-local/5a8f3bad-8413-16c3-b255-6a06a9076ef3/packer-provisioner-ansible-local135505282
  docker: ERROR! the playbook: packer_builder_type=docker could not be found
  </code></pre>
  
Tags: <docker><ansible><packer>
Title: Error when using 'ansible-local' provisioner with Docker container
UserDisplayName: David West
ThreadText: # Error when using 'ansible-local' provisioner with Docker container
  
  (Asked by: username_0 on 2018-02-22)
  
  I'm getting an error when running the `ansible-local` provisioner with a docker builder in Hashicorps Packer.
  
  My template (template.json):
  
  ```
  {
    "builders": [
          {
              "type": "docker",
              "image": "ubuntu",
              "commit": "true"
          }
      ],
     "provisioners": [
          {
              "type": "shell",
              "inline": ["sudo apt-get update"]
          },
          {
              "type": "shell",
              "script": "setup_ansible.sh"
          },
          {
              "type": "ansible-local",
              "playbook_file": "./kubeadm.yml"
          }
     ]
  }
  
  ```
  
  The error:
  
  ```
  docker: Executing Ansible: cd /tmp/packer-provisioner-ansible-local/5a8f3bad-8413-16c3-b255-6a06a9076ef3 && ANSIBLE_FORCE_COLOR=1 PYTHONUNBUFFERED=1 ansible-playbook /tmp/packer-provisioner-ansible-local/5a8f3bad-8413-16c3-b255-6a06a9076ef3/kubeadm.yml --extra-vars \"packer_build_name=docker packer_builder_type=docker packer_http_addr=\"  -c local -i /tmp/packer-provisioner-ansible-local/5a8f3bad-8413-16c3-b255-6a06a9076ef3/packer-provisioner-ansible-local135505282
  docker: ERROR! the playbook: packer_builder_type=docker could not be found
  
  ```
  
  **Tags:** docker, ansible, packer
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-02-28. Score: 1
  
  It seems that there is some [bug](https://github.com/hashicorp/packer/issues/5885) in Hashicorps Packer 1.2.0, consider downgrading or upgrading to v1.2.1, comments in GH issue page confirm that the deployed fix is working.
  
  
  ---
  
  