1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/test/utils/docker/httptester/packer.json

48 lines
1.6 KiB
JSON
Raw Normal View History

{
2018-03-08 22:58:30 +01:00
"variables": {
"docker_image": "nginx:1.13.8-alpine"
},
"builders": [
{
"type": "docker",
2018-03-08 22:58:30 +01:00
"image": "{{user `docker_image`}}",
"commit": true,
"run_command": [
"-d",
"-i",
"-t",
"{{.Image}}",
"/bin/sh"
]
}
],
"provisioners": [
{
"type": "shell",
"inline": [
"set -x",
"[ -f /sbin/apk ] && /sbin/apk add -U ansible || true",
"[ -f /usr/bin/dnf ] && /usr/bin/dnf -y install ansible python2-dnf || true",
"[ ! -f /usr/bin/dnf -a -f /usr/bin/yum ] && /usr/bin/yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-`grep -o [0-9] /etc/redhat-release | head -1`.noarch.rpm || true",
"[ ! -f /usr/bin/dnf -a -f /usr/bin/yum ] && /usr/bin/yum -y install ansible || true",
2018-03-08 22:58:30 +01:00
"[ -f /usr/bin/apt-get ] && /usr/bin/apt-get update && /usr/bin/apt-get -y install software-properties-common && /usr/bin/add-apt-repository ppa:ansible/ansible && /usr/bin/apt-get update && /usr/bin/apt-get -y install ansible || true"
]
},
{
"type": "ansible-local",
"playbook_file": "httptester.yml",
"playbook_dir": "{{template_dir}}",
"extra_arguments": [
"-v"
]
}
],
"post-processors": [
{
"type": "docker-tag",
"repository": "ansible/ansible",
"tag": "httptester"
}
]
}