ansible as a provisioner with packer and docker

Hi is anyone working with ansible provisioner and playbook ??

We use the ansible provision with packer. It works something like this:

"provisioners": [
      {
      "execute_command": "chmod +x {{ .Path }}; {{ .Vars }} sudo -E sh
'{{ .Path }}'",
      "inline": [
        "sudo yum -y install ansible"
       ],
      "inline_shebang": "/bin/sh -x",
      "type": "shell"
    },
    {
      "type": "ansible-local",
      "playbook_file": "./ansible/playbook.yml",
      "playbook_dir": "./ansible"
    },
  ]

Yes, I use the Ansible provisioner to build Vagrant boxes with Packer usinge Virtualbox. Here is one example. I imagine it would work against Docker as that is just another Builder to Packer, but I haven’t used it in that way specifically.