blob: b1a7171a622585053d2ed0ba56ee2a3fa4f995e9 [file] [log] [blame]
{
"variables": {
"user": "root",
"password": "r00tme",
"do_api_token": "{{ env `DO_API_TOKEN` }}",
"image_name": "{{ env `IMAGE_NAME` }}",
"VM_IMAGE": "{{ env `VM_IMAGE` }}",
"floating_ip_pool": "{{ env `VM_FLOATING_IP_POOL` }}",
"VM_FLAVOR": "{{ env `VM_FLAVOR` }}",
"disk_size": "150000",
"cluster_model": "{{ env `CLUSTER_MODEL` }}",
"cluster_model_ref": "{{ env `CLUSTER_MODEL_REF` }}",
"cluster_name": "{{ env `CLUSTER_NAME` }}",
"formula_version": "{{ env `FORMULA_VERSION` }}",
"mcp_version": "{{ env `MCP_VERSION` }}",
"ubuntu_baseurl": "{{ env `UBUNTU_BASEURL` }}",
"saltstack_gpg": "{{ env `SALTSTACK_GPG` }}",
"saltstack_repo": "{{ env `SALTSTACK_REPO` }}",
"apt_mirantis_gpg": "{{ env `APT_MIRANTIS_GPG` }}",
"apt_mirantis_salt_repo": "{{ env `APT_MIRANTIS_SALT_REPO` }}",
"git_salt_formulas_scripts": "{{ env `GIT_SALT_FORMULAS_SCRIPTS` }}",
"apt_repository": "{{ env `APT_REPOSITORY` }}",
"apt_repository_gpg": "{{ env `APT_REPOSITORY_GPG` }}"
},
"provisioners": [
{
"type": "file",
"source": "files/root/interfaces",
"destination": "/root/interfaces"
},
{
"type": "file",
"source": "files/root/minion.conf",
"destination": "/root/minion.conf"
},
{
"type": "file",
"source": "files/tmp/bootstrap.saltstack.com.sh",
"destination": "/tmp/bootstrap.saltstack.com.sh"
},
{
"environment_vars": [
"CLUSTER_MODEL={{ user `cluster_model` }}",
"CLUSTER_MODEL_REF={{ user `cluster_model_ref` }}",
"CLUSTER_NAME={{ user `cluster_name` }}",
"FORMULA_VERSION={{ user `formula_version` }}",
"UBUNTU_BASEURL={{ user `ubuntu_baseurl` }}",
"SALTSTACK_GPG={{ user `saltstack_gpg` }}",
"SALTSTACK_REPO={{ user `saltstack_repo` }}",
"APT_MIRANTIS_GPG={{ user `apt_mirantis_gpg` }}",
"APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}",
"GIT_SALT_FORMULAS_SCRIPTS={{ user `git_salt_formulas_scripts` }}",
"APT_REPOSITORY={{ user `apt_repository` }}",
"APT_REPOSITORY_GPG={{ user `apt_repository_gpg` }}",
"PACKER_OFFLINE_BUILD=true"
],
"type": "shell",
"expect_disconnect": "true",
"scripts": [
"scripts/base.sh",
"scripts/network.sh",
"scripts/salt_bootstrap.sh"
]
},
{
"environment_vars": [
"APT_MIRANTIS_SALT_REPO={{ user `apt_mirantis_salt_repo` }}"
],
"type": "shell",
"expect_disconnect": "true",
"scripts": [
"scripts/salt.sh"
]
},
{
"environment_vars": [
"HOME=/root",
"MCP_VERSION={{ user `mcp_version` }}"
],
"type": "shell",
"pause_before": "120s",
"scripts": [
"scripts/mirrors.sh",
"scripts/security.sh",
"scripts/cleanup.sh"
]
},
{
"type": "file",
"source": "files/etc/cloud/cloud.cfg.d/99_tcp.cfg",
"destination": "/etc/cloud/cloud.cfg.d/99_tcp.cfg"
},
{
"type": "file",
"source": "files/etc/cloud/cloud.cfg",
"destination": "/etc/cloud/cloud.cfg"
}
],
"builders": [
{
"type": "openstack",
"ssh_username": "{{user `user`}}",
"ssh_password": "{{user `password`}}",
"image_name": "{{user `image_name`}}",
"floating_ip_pool": "{{user `floating_ip_pool`}}",
"reuse_ips": "true",
"security_groups": [
"open_all"
],
"source_image": "{{ user `VM_IMAGE` }}",
"flavor": "{{ user `VM_FLAVOR` }}",
"user_data_file": "config-drive/user-data.yaml"
},
{
"type": "qemu",
"qemuargs": [
[
"-m",
"8096M"
],
[
"-fda",
"config-drive/cloudata.iso"
],
[
"-smp",
"4"
]
],
"vm_name": "{{ user `image_name` }}-{{ isotime \"200601021504\" }}",
"output_directory": "images/{{ user `image_name`}}",
"format": "qcow2",
"accelerator": "kvm",
"disk_size": "{{ user `disk_size`}}",
"iso_url": "http://cloud-images.ubuntu.com/xenial/20180224/xenial-server-cloudimg-amd64-disk1.img",
"iso_target_path": "/root/isos/xenial-server-cloudimg-amd64-disk1.img",
"iso_checksum_type": "md5",
"disk_image": true,
"iso_checksum": "697d8f9058ad118cea699d14ae414f8b",
"http_directory": "http",
"headless": true,
"ssh_username": "{{user `user`}}",
"ssh_password": "{{user `password`}}",
"shutdown_command": "sync; shutdown -P now",
"vnc_bind_address": "0.0.0.0",
"vnc_port_max": "5956",
"vnc_port_min": "5956",
"ssh_host_port_min": 2223,
"ssh_host_port_max": 2223,
"boot_wait": "2s",
"ssh_wait_timeout": "360s"
}
]
}