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

93 lines
3.0 KiB
JSON
Raw Normal View History

{
"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": "lemonldap",
"ubuntu_version": "18.04",
"eole_version": "2.7.2",
"vm_name": "lemonldap-2.7.2",
"image_size": "20480",
"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=var",
"lvsizes=80%FREE",
"lvfssys=ext4",
"lvmntps=/var"
]
},
{
"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"
]
}
]
}