fabrica/packer/recipes/eole/2.7.2/minio.json

93 lines
3.1 KiB
JSON

{
"variables": {
"HTTP_PROXY": "{{ env `HTTP_PROXY` }}",
"HTTPS_PROXY": "{{ env `HTTPS_PROXY` }}",
"http_proxy": "{{ env `http_proxy` }}",
"https_proxy": "{{ env `https_proxy` }}",
"provisionning_dir": "{{ template_dir }}/../../../provisioning",
"eole_provisionning": "{{ user `provisionning_dir`}}/eole",
"eole_playbooks": "{{ user `provisionning_dir` }}/playbooks/eole",
"module_name": "minio",
"ubuntu_version": "18.04",
"eole_version": "2.7.2",
"vm_name": "minio-2.7.2",
"image_size": "102400",
"output_dir": "{{ template_dir }}/../../../images/eole/2.7.2/{{ user `module_name` }}",
"image_name": "{{ user `vm_name` }}-{{ isotime \"20060102\" }}"
},
"builders": [
{
"name": "{{ user `vm_name` }}",
"type": "qemu",
"iso_url": "{{ template_dir }}/../../../images/eole/{{user `eole_version`}}/eolebase/eolebase-{{ user `eole_version` }}.img",
"iso_checksum": "none",
"disk_image": true,
"format": "qcow2",
"disk_size": "{{ user `image_size` }}",
"ssh_username": "root",
"ssh_password": "cadoles",
"http_directory": "{{ template_dir }}",
"accelerator": "kvm",
"net_device": "virtio-net",
"disk_interface": "virtio",
"ssh_wait_timeout": "5m",
"boot_wait": "5s",
"output_directory": "{{ user `output_dir` }}",
"vm_name": "{{ user `image_name` }}.img",
"headless": true,
"qemuargs": [
[
"-m",
"2048"
]
]
}
],
"provisioners": [
{
"type": "ansible",
"playbook_file": "{{ user `eole_playbooks` }}/partitions.yml",
"ansible_env_vars": [
"VM_NAME={{ user `vm_name` }}",
"HTTP_PROXY={{ user `HTTP_PROXY` }}",
"HTTPS_PROXY={{ user `HTTPS_PROXY` }}",
"http_proxy={{ user `http_proxy` }}",
"https_proxy={{ user `https_proxy` }}",
"vgname=main",
"lvnames=ds1 ds2 ds3 ds4 ds5 ds6 ds7 ds8",
"lvsizes=10G 10G 10G 10G 10G 10G 10G 10G",
"lvfssys=ext4 ext4 ext4 ext4 ext4 ext4 ext4 ext4",
"lvmntps=/srv/ds1 /srv/ds2 /srv/ds3 /srv/ds4 /srv/ds5 /srv/ds6 /srv/ds7 /srv/ds8"
]
},
{
"type": "shell",
"inline": [ "reboot" ],
"expect_disconnect": true
},
{
"type": "ansible",
"playbook_file": "{{ user `eole_playbooks` }}/{{ user `module_name` }}.yml",
"extra_arguments": [ "--extra-vars", "VM_NAME={{ user `vm_name` }} HTTP_PROXY={{ user `HTTP_PROXY` }} HTTPS_PROXY={{ user `HTTPS_PROXY` }} http_proxy={{ user `http_proxy` }} https_proxy={{ user `https_proxy` }}"]
}
],
"post-processors": [
{
"type": "shell-local",
"inline": [
"sleep 5",
"qemu-img convert -O qcow2 -c {{ user `output_dir` }}/{{ user `image_name` }}.img {{ user `output_dir` }}/{{ user `vm_name` }}.img",
"rm -rf {{ user `output_dir` }}/{{ user `image_name` }}.img"
]
},
{
"type": "shell-local",
"inline": [
"sleep 5",
"qemu-img convert -O vdi {{ user `output_dir` }}/{{ user `vm_name` }}.img {{ user `output_dir` }}/{{ user `vm_name` }}.vdi"
]
}
]
}