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

87 lines
2.8 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": "zephir",
"ubuntu_version": "18.04",
"eole_version": "2.7.2",
"vm_name": "{{ user `module_name` }}-2.7.2",
"image_size": "40960",
"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=home var",
"lvsizes=5%FREE 80%FREE",
"lvfssys=ext4 ext4",
"lvmntps=/home /var"
]
},
{
"type": "shell",
"inline": [ "reboot" ],
"expect_disconnect": true
},
{
"type": "ansible",
"pause_before": "45s",
"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"
]
}
]
}