forked from entercloudsuite/ansible-example
-
Notifications
You must be signed in to change notification settings - Fork 0
/
packer-docker.json
43 lines (43 loc) · 1.08 KB
/
packer-docker.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
"builders": [
{
"type": "docker",
"image": "ubuntu:16.04",
"commit": "true",
"changes": [
"CMD [\"nginx\", \"-g\", \"daemon off;\"]"
]
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"apt-get update && apt-get install -y python2.7 python && apt-get clean"
]
},
{
"type": "ansible",
"playbook_file": "./molecule/default/playbook.yml",
"ansible_env_vars": [ "ANSIBLE_ROLES_PATH=:/home/travis/build/entercloudsuite/", "ANSIBLE_HOST_KEY_CHECKING=False", "ANSIBLE_SSH_ARGS='-o ForwardAgent=yes -o ControlMaster=auto -o ControlPersist=60s'", "ANSIBLE_NOCOLOR=True" ]
}
],
"post-processors": [
[{
"type": "docker-tag",
"repository": "{{user `image_name`}}",
"tag": "latest"
},
{
"type": "docker-push",
"login": "true",
"login_username": "{{user `docker_username`}}",
"login_password": "{{user `docker_password`}}"
}]
],
"variables": {
"image_name": "fminzoni/ecs-example",
"docker_username": "{{env `DOCKER_USERNAME`}}",
"docker_password": "{{env `DOCKER_PASSWORD`}}"
}
}