2021-03-18 16:11:35 +01:00
|
|
|
{
|
|
|
|
"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": "eolebase",
|
|
|
|
"ubuntu_version": "18.04",
|
|
|
|
"eole_version": "2.7.2",
|
|
|
|
"vm_name": "eolebase-2.7.2",
|
|
|
|
"image_size": "10240",
|
|
|
|
"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/ubuntu/{{user `ubuntu_version`}}/ubuntu-{{ user `ubuntu_version` }}.img",
|
|
|
|
"iso_checksum": "none",
|
|
|
|
"disk_image": true,
|
|
|
|
"format": "qcow2",
|
2021-03-24 11:11:40 +01:00
|
|
|
"vnc_bind_address": "0.0.0.0",
|
2021-03-18 16:11:35 +01:00
|
|
|
"disk_size": "{{ user `image_size` }}",
|
|
|
|
"ssh_username": "root",
|
|
|
|
"ssh_password": "cadoles",
|
|
|
|
"http_directory": "{{ template_dir }}",
|
|
|
|
"accelerator": "kvm",
|
|
|
|
"net_device": "virtio-net",
|
|
|
|
"disk_interface": "virtio",
|
2021-03-23 17:30:50 +01:00
|
|
|
"ssh_wait_timeout": "45m",
|
2021-03-18 16:11:35 +01:00
|
|
|
"boot_wait": "5s",
|
|
|
|
"output_directory": "{{ user `output_dir` }}",
|
|
|
|
"vm_name": "{{ user `image_name` }}.img",
|
|
|
|
"headless": true,
|
2021-03-23 17:30:50 +01:00
|
|
|
"cpus": "2",
|
|
|
|
"memory" : "4096"
|
2021-03-18 16:11:35 +01:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"provisioners": [
|
|
|
|
{
|
|
|
|
"type": "file",
|
|
|
|
"source": "{{ user `eole_provisionning` }}/onecontext/net-99-eole",
|
|
|
|
"destination": "/root/net-99-eole"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "file",
|
|
|
|
"source": "{{ user `eole_provisionning` }}/{{ user `eole_version` }}/modif/00-eole.yaml",
|
|
|
|
"destination": "/root/00-eole.yaml"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "file",
|
|
|
|
"source": "{{ user `eole_provisionning` }}/{{ user `eole_version` }}/netplan/01-netcfg.yaml",
|
|
|
|
"destination": "/etc/netplan/01-netcfg.yaml"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type":"file",
|
|
|
|
"source":"{{user `provisionning_dir` }}/ssl",
|
|
|
|
"destination":"/usr/local/share/ca-certificates/rapidssl"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "ansible",
|
|
|
|
"playbook_file": "{{user `eole_playbooks`}}/eole.yml",
|
2021-03-24 11:41:40 +01:00
|
|
|
"extra_arguments": [
|
|
|
|
"--extra-vars",
|
|
|
|
"VM_NAME={{ user `vm_name` }} EOLE_VERSION={{ user `eole_version` }}",
|
|
|
|
"--extra-vars",
|
|
|
|
"HTTP_PROXY={{ user `HTTP_PROXY` }} HTTPS_PROXY={{ user `HTTPS_PROXY` }} http_proxy={{ user `http_proxy` }} https_proxy={{ user `https_proxy` }}"
|
|
|
|
]
|
2021-03-18 16:11:35 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"type":"ansible",
|
|
|
|
"playbook_file":"{{ user `eole_playbooks` }}/provision.yml",
|
2021-03-24 11:41:40 +01:00
|
|
|
"extra_arguments": [
|
|
|
|
"--extra-vars",
|
|
|
|
"VM_NAME={{ user `vm_name` }} EOLE_VERSION={{ user `eole_version` }}",
|
|
|
|
"--extra-vars",
|
|
|
|
"HTTP_PROXY={{ user `HTTP_PROXY` }} HTTPS_PROXY={{ user `HTTPS_PROXY` }} http_proxy={{ user `http_proxy` }} https_proxy={{ user `https_proxy` }}"
|
|
|
|
]
|
2021-03-18 16:11:35 +01:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"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"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|