Skip to content

Instantly share code, notes, and snippets.

@stevenscg
Last active March 8, 2017 15:33
Show Gist options
  • Save stevenscg/bd13ecf1b130c581656fb24157befbdd to your computer and use it in GitHub Desktop.
Save stevenscg/bd13ecf1b130c581656fb24157befbdd to your computer and use it in GitHub Desktop.
packer-ansible-docker demo

Project tree:

foo-app

  • composer.json
  • app
    • file1.txt
    • foo
      • bar.txt
  • provision
    • nginx
      • nginx.conf
    • packer
      • nginx.json
      • nginx.yml

Packer build command:

packer build provision/packer/nginx.json
{
"variables": {
"version": "latest",
"ansible_host": "packer-ansible-demo",
"ansible_connection": "docker"
},
"builders": [{
"type": "docker",
"image": "nginx:1.11.10-alpine",
"commit": true,
"run_command": [
"-d", "-i", "-t", "--name", "{{user `ansible_host`}}",
"{{.Image}}", "/bin/sh"
]
}],
"provisioners": [
{
"type": "shell",
"inline": [
"apk --update --no-cache add python"
]
},
{
"type": "ansible",
"ansible_env_vars": [
"ANSIBLE_ROLES_PATH={{user `ansible_roles_path` }}"
],
"user": "root",
"playbook_file": "./provision/packer/nginx.yml",
"extra_arguments": [
"-vvvv",
"-e", "ansible_host={{user `ansible_host`}}",
"-e", "ansible_connection={{user `ansible_connection`}}"
]
}
],
"post-processors": [
[
{
"type": "docker-tag",
"repository": "{{ user `ansible_host` }}",
"tag": "{{ user `version` }}"
}
]
]
}
---
#
# Ansible playbook to create base images using Packer
#
# Notes:
# This is designed to the run from the root of the project repo.
# Local paths are relative to the playbook directory.
#
# Usage:
# packer build provision/packer/nginx.json
#
- hosts: all
gather_facts: yes
vars:
# Trailing slash works:
deploy_path: /var/www/html/
# NO trailing slash does NOT work:
# deploy_path: /var/www/html
tasks:
- name: Ensure the nginx configuration is installed (works)
template:
src: ../nginx/nginx.conf
dest: /etc/nginx/nginx.conf
owner: root
group: root
- name: Copy a single file to the release path (works)
copy:
src: ../../composer.json
dest: "{{ deploy_path }}"
- name: Copy multiple files to the release path (hangs indefinitely)
copy:
src: ../../app
dest: "{{ deploy_path }}"
docker output will be in this color.
==> docker: Creating a temporary directory for sharing data...
==> docker: Pulling Docker image: nginx:1.11.10-alpine
 docker: 1.11.10-alpine: Pulling from library/nginx
 docker: Digest: sha256:aa0daf2b17c370a1da371a767110a43b390a9db90b90d2d1b07862dc81754d61
 docker: Status: Image is up to date for nginx:1.11.10-alpine
==> docker: Starting docker container...
 docker: Run command: docker run -v /Users/cstevens/.packer.d/tmp/packer-docker659261751:/packer-files -d -i -t --name packer-ansible-demo nginx:1.11.10-alpine /bin/sh
 docker: Container ID: 621978f8de1fb63bc9ba2004e1ac7258b6530d57175c9f7526bc03e1cf035568
==> docker: Provisioning with shell script: /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/packer-shell013178910
 docker: fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
 docker: fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
 docker: fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
 docker: fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
 docker: (1/10) Installing libbz2 (1.0.6-r5)
 docker: (2/10) Installing expat (2.2.0-r0)
 docker: (3/10) Installing libffi (3.2.1-r2)
 docker: (4/10) Installing gdbm (1.11-r1)
 docker: (5/10) Installing ncurses-terminfo-base (6.0-r7)
 docker: (6/10) Installing ncurses-terminfo (6.0-r7)
 docker: (7/10) Installing ncurses-libs (6.0-r7)
 docker: (8/10) Installing readline (6.3.008-r4)
 docker: (9/10) Installing sqlite-libs (3.13.0-r0)
 docker: (10/10) Installing python (2.7.12-r0)
 docker: Executing busybox-1.24.2-r13.trigger
 docker: OK: 100 MiB in 34 packages
==> docker: Provisioning with Ansible...
 docker: No config file found; using defaults
 docker: Loading callback plugin default of type stdout, v2.0 from /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/plugins/callback/__init__.pyc
 docker:
 docker: PLAYBOOK: nginx.yml ************************************************************
 docker: 1 plays in /Users/cstevens/Dev/packer-ansible-demo/provision/packer/nginx.yml
 docker:
 docker: PLAY [all] *********************************************************************
 docker:
 docker: TASK [setup] *******************************************************************
 docker: Using module file /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/modules/core/system/setup.py
 docker: <packer-ansible-demo> ESTABLISH DOCKER CONNECTION FOR USER: root
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u'/bin/sh -c \'( umask 77 && mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1488986528.96-188329250962403 `" && echo ansible-tmp-1488986528.96-188329250962403="` echo ~/.ansible/tmp/ansible-tmp-1488986528.96-188329250962403 `" ) && sleep 0\'']
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmptwxGdJ TO /root/.ansible/tmp/ansible-tmp-1488986528.96-188329250962403/setup.py
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986528.96-188329250962403/ /root/.ansible/tmp/ansible-tmp-1488986528.96-188329250962403/setup.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u'/bin/sh -c \'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1488986528.96-188329250962403/setup.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1488986528.96-188329250962403/" > /dev/null 2>&1 && sleep 0\'']
 docker: ok: [default]
 docker:
 docker: TASK [Ensure the nginx configuration is installed (works)] *********************
 docker: task path: /Users/cstevens/Dev/packer-ansible-demo/provision/packer/nginx.yml:21
 docker: <packer-ansible-demo> ESTABLISH DOCKER CONNECTION FOR USER: root
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u'/bin/sh -c \'( umask 77 && mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327 `" && echo ansible-tmp-1488986532.88-207023179912327="` echo ~/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327 `" ) && sleep 0\'']
 docker: Using module file /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/modules/core/files/stat.py
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmpi1wrMo TO /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/stat.py
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/ /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/stat.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/stat.py && sleep 0'"]
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmpUIOc7y TO /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/source
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/ /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/source && sleep 0'"]
 docker: Using module file /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/modules/core/files/copy.py
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmpUyp8k_ TO /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/copy.py
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/ /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/copy.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/copy.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/ > /dev/null 2>&1 && sleep 0'"]
 docker: changed: [default] => {
 docker: "changed": true,
 docker: "checksum": "edcaed0c824d7f65e33c9eb2adf8c65f3ba25242",
 docker: "dest": "/etc/nginx/nginx.conf",
 docker: "gid": 0,
 docker: "group": "root",
 docker: "invocation": {
 docker: "module_args": {
 docker: "backup": false,
 docker: "content": null,
 docker: "delimiter": null,
 docker: "dest": "/etc/nginx/nginx.conf",
 docker: "directory_mode": null,
 docker: "follow": true,
 docker: "force": true,
 docker: "group": "root",
 docker: "mode": null,
 docker: "original_basename": "nginx.conf",
 docker: "owner": "root",
 docker: "regexp": null,
 docker: "remote_src": null,
 docker: "selevel": null,
 docker: "serole": null,
 docker: "setype": null,
 docker: "seuser": null,
 docker: "src": "/root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/source",
 docker: "unsafe_writes": null,
 docker: "validate": null
 docker: }
 docker: },
 docker: "md5sum": "251f55d4290d0ddbca96f5548854a665",
 docker: "mode": "0664",
 docker: "owner": "root",
 docker: "size": 2916,
 docker: "src": "/root/.ansible/tmp/ansible-tmp-1488986532.88-207023179912327/source",
 docker: "state": "file",
 docker: "uid": 0
 docker: }
 docker:
 docker: TASK [Copy a single file to the release path (works)] **************************
 docker: task path: /Users/cstevens/Dev/packer-ansible-demo/provision/packer/nginx.yml:28
 docker: Using module file /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/modules/core/files/stat.py
 docker: <packer-ansible-demo> ESTABLISH DOCKER CONNECTION FOR USER: root
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u'/bin/sh -c \'( umask 77 && mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1488986534.62-40126083855048 `" && echo ansible-tmp-1488986534.62-40126083855048="` echo ~/.ansible/tmp/ansible-tmp-1488986534.62-40126083855048 `" ) && sleep 0\'']
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmpCINPPB TO /root/.ansible/tmp/ansible-tmp-1488986534.62-40126083855048/stat.py
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986534.62-40126083855048/ /root/.ansible/tmp/ansible-tmp-1488986534.62-40126083855048/stat.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u'/bin/sh -c \'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1488986534.62-40126083855048/stat.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1488986534.62-40126083855048/" > /dev/null 2>&1 && sleep 0\'']
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u'/bin/sh -c \'( umask 77 && mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437 `" && echo ansible-tmp-1488986535.28-199049501986437="` echo ~/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437 `" ) && sleep 0\'']
 docker: <packer-ansible-demo> PUT /Users/cstevens/Dev/packer-ansible-demo/composer.json TO /root/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437/source
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437/ /root/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437/source && sleep 0'"]
 docker: Using module file /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/modules/core/files/copy.py
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmpodvipg TO /root/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437/copy.py
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437/ /root/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437/copy.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u'/bin/sh -c \'/usr/bin/python /root/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437/copy.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437/" > /dev/null 2>&1 && sleep 0\'']
 docker: changed: [default] => {
 docker: "changed": true,
 docker: "checksum": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
 docker: "dest": "/var/www/html/composer.json",
 docker: "gid": 0,
 docker: "group": "root",
 docker: "invocation": {
 docker: "module_args": {
 docker: "backup": false,
 docker: "content": null,
 docker: "delimiter": null,
 docker: "dest": "/var/www/html/composer.json",
 docker: "directory_mode": null,
 docker: "follow": false,
 docker: "force": true,
 docker: "group": null,
 docker: "mode": null,
 docker: "original_basename": "composer.json",
 docker: "owner": null,
 docker: "regexp": null,
 docker: "remote_src": null,
 docker: "selevel": null,
 docker: "serole": null,
 docker: "setype": null,
 docker: "seuser": null,
 docker: "src": "/root/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437/source",
 docker: "unsafe_writes": null,
 docker: "validate": null
 docker: }
 docker: },
 docker: "md5sum": "d41d8cd98f00b204e9800998ecf8427e",
 docker: "mode": "0644",
 docker: "owner": "root",
 docker: "size": 0,
 docker: "src": "/root/.ansible/tmp/ansible-tmp-1488986535.28-199049501986437/source",
 docker: "state": "file",
 docker: "uid": 0
 docker: }
 docker:
 docker: TASK [Copy multiple files to the release path (hangs indefinitely)] ************
 docker: task path: /Users/cstevens/Dev/packer-ansible-demo/provision/packer/nginx.yml:35
 docker: <packer-ansible-demo> ESTABLISH DOCKER CONNECTION FOR USER: root
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u'/bin/sh -c \'( umask 77 && mkdir -p "` echo ~/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696 `" && echo ansible-tmp-1488986536.26-47021364981696="` echo ~/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696 `" ) && sleep 0\'']
 docker: Using module file /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/modules/core/files/stat.py
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmpidl2TI TO /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/stat.py
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/ /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/stat.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/stat.py && sleep 0'"]
 docker: <packer-ansible-demo> PUT /Users/cstevens/Dev/packer-ansible-demo/app/file1.txt TO /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/source
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/ /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/source && sleep 0'"]
 docker: Using module file /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/modules/core/files/copy.py
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmp2ya87k TO /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/copy.py
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/ /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/copy.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/copy.py && sleep 0'"]
 docker: Using module file /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/modules/core/files/stat.py
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmp4oYrQO TO /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/stat.py
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/ /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/stat.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/stat.py && sleep 0'"]
 docker: <packer-ansible-demo> PUT /Users/cstevens/Dev/packer-ansible-demo/app/foo/bar.txt TO /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/source
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/ /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/source && sleep 0'"]
 docker: Using module file /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/modules/core/files/copy.py
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmpKkNQfE TO /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/copy.py
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/ /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/copy.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/copy.py && sleep 0'"]
 docker: Using module file /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/modules/core/files/stat.py
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmpOegUHC TO /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/stat.py
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/ /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/stat.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/stat.py && sleep 0'"]
 docker: Using module file /usr/local/Cellar/ansible/2.2.1.0_1/libexec/lib/python2.7/site-packages/ansible/modules/core/files/file.py
 docker: <packer-ansible-demo> PUT /var/folders/r4/fnw3gjwn7s77y36x6nfbgd400000gn/T/tmpwdHTnF TO /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/file.py
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/ /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/file.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/file.py && sleep 0'"]
 docker: <packer-ansible-demo> EXEC ['/usr/local/bin/docker', 'exec', '-u', u'root', '-i', u'packer-ansible-demo', u'/bin/sh', '-c', u"/bin/sh -c 'rm -f -r /root/.ansible/tmp/ansible-tmp-1488986536.26-47021364981696/ > /dev/null 2>&1 && sleep 0'"]
 docker: changed: [default] => {
 docker: "changed": true,
 docker: "dest": "/var/www/html/",
 docker: "invocation": {
 docker: "module_args": {
 docker: "dest": "/var/www/html/",
 docker: "src": "../../app"
 docker: },
 docker: "module_name": "copy"
 docker: },
 docker: "src": "/Users/cstevens/Dev/packer-ansible-demo/provision/packer/../../app"
 docker: }
 docker:
 docker: PLAY RECAP *********************************************************************
 docker: default : ok=4 changed=3 unreachable=0 failed=0
 docker:
==> docker: Committing the container
 docker: Image ID: sha256:310d6286606633ea7c394e9f50e34f03872e9491b617d70e3bf750262a89084b
==> docker: Killing the container: 621978f8de1fb63bc9ba2004e1ac7258b6530d57175c9f7526bc03e1cf035568
==> docker: Running post-processor: docker-tag
 docker (docker-tag): Tagging image: sha256:310d6286606633ea7c394e9f50e34f03872e9491b617d70e3bf750262a89084b
 docker (docker-tag): Repository: packer-ansible-demo:latest
Build 'docker' finished.
==> Builds finished. The artifacts of successful builds are:
--> docker: Imported Docker image: sha256:310d6286606633ea7c394e9f50e34f03872e9491b617d70e3bf750262a89084b
--> docker: Imported Docker image: packer-ansible-demo:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment