421d0ac06e
Qemu image may be used with fuel-devops for tests Change-Id: I7cdaed0ee127012fea74e3fa38e470cfdb87d10c
183 lines
6.0 KiB
JSON
183 lines
6.0 KiB
JSON
{
|
|
"variables": {
|
|
"cleanup_pause": "",
|
|
"headless": "",
|
|
"update": "true",
|
|
"ssh_username": "vagrant",
|
|
"ssh_password": "vagrant",
|
|
"install_vagrant_key": "true",
|
|
"http_proxy": "{{env `http_proxy`}}",
|
|
"https_proxy": "{{env `https_proxy`}}",
|
|
"ftp_proxy": "{{env `ftp_proxy`}}",
|
|
"rsync_proxy": "{{env `rsync_proxy`}}",
|
|
"no_proxy": "{{env `no_proxy`}}",
|
|
"iso_url": "http://releases.ubuntu.com/14.04/ubuntu-14.04.3-server-amd64.iso",
|
|
"iso_checksum": "9e5fecc94b3925bededed0fdca1bd417",
|
|
"custom_script": ".",
|
|
"disk_size": "4000",
|
|
"mem_size": "512",
|
|
"vcpu_num": "1",
|
|
"ansible_config_path": "/etc/ansible",
|
|
"ansible_config_file": "ansible.cfg",
|
|
"ansible_log_file": "/var/tmp/ansible.log"
|
|
},
|
|
"builders": [{
|
|
"vm_name": "ubuntu1404",
|
|
"type": "qemu",
|
|
"format": "qcow2",
|
|
"accelerator": "kvm",
|
|
"http_directory": "http",
|
|
"iso_url": "{{ user `iso_url` }}",
|
|
"iso_checksum": "{{ user `iso_checksum` }}",
|
|
"iso_checksum_type": "md5",
|
|
"ssh_username": "{{ user `ssh_username` }}",
|
|
"ssh_password": "{{ user `ssh_password` }}",
|
|
"ssh_wait_timeout": "10000s",
|
|
"headless": "{{ user `headless` }}",
|
|
"boot_wait": "30s",
|
|
"boot_command": [
|
|
"<esc><esc><enter><wait>",
|
|
"/install/vmlinuz auto",
|
|
" console-setup/ask_detect=false",
|
|
" console-setup/layoutcode=us",
|
|
" console-setup/modelcode=SKIP",
|
|
" debconf/frontend=noninteractive",
|
|
" debian-installer=en_US",
|
|
" fb=false",
|
|
" initrd=/install/initrd.gz",
|
|
" keymap=us debian-installer/keymap=us",
|
|
" kbd-chooser/method=us",
|
|
" keyboard-configuration/layout=USA",
|
|
" keyboard-configuration/variant=USA",
|
|
" locale=en_US",
|
|
" netcfg/get_domain=vm",
|
|
" netcfg/get_hostname=vagrant",
|
|
" noapic" ,
|
|
" preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
|
|
" -- ",
|
|
"<enter>"
|
|
],
|
|
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
|
|
"disk_size": "{{ user `disk_size`}}",
|
|
"qemuargs": [
|
|
[
|
|
"-m",
|
|
"{{user `mem_size`}}M"
|
|
],
|
|
[
|
|
"-smp",
|
|
"{{ user `vcpu_num`}}"
|
|
]
|
|
]
|
|
},
|
|
{
|
|
"vm_name": "ubuntu1404",
|
|
"type": "virtualbox-iso",
|
|
"http_directory": "http",
|
|
"iso_url": "{{ user `iso_url` }}",
|
|
"iso_checksum": "{{ user `iso_checksum` }}",
|
|
"iso_checksum_type": "md5",
|
|
"guest_os_type": "Ubuntu_64",
|
|
"guest_additions_path": "VBoxGuestAdditions_{{.Version}}.iso",
|
|
"virtualbox_version_file": ".vbox_version",
|
|
"headless": "{{ user `headless` }}",
|
|
"ssh_username": "{{ user `ssh_username` }}",
|
|
"ssh_password": "{{ user `ssh_password` }}",
|
|
"ssh_wait_timeout": "10000s",
|
|
"boot_wait": "30s",
|
|
"boot_command": [
|
|
"<esc><esc><enter><wait>",
|
|
"/install/vmlinuz noapic ",
|
|
"preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg ",
|
|
"debian-installer=en_US auto locale=en_US kbd-chooser/method=us ",
|
|
"hostname={{ .Name }} ",
|
|
"fb=false debconf/frontend=noninteractive ",
|
|
"keyboard-configuration/modelcode=SKIP keyboard-configuration/layout=USA ",
|
|
"keyboard-configuration/variant=USA console-setup/ask_detect=false ",
|
|
"keymap=us debian-installer/keymap=us ",
|
|
"initrd=/install/initrd.gz -- <enter>"
|
|
],
|
|
"shutdown_command": "echo 'vagrant'|sudo -S shutdown -P now",
|
|
"disk_size": "{{ user `disk_size`}}",
|
|
"vboxmanage": [
|
|
["modifyvm", "{{.Name}}", "--memory", "{{ user `mem_size`}}"],
|
|
["modifyvm", "{{.Name}}", "--cpus", "{{ user `vcpu_num`}}"]
|
|
]
|
|
}],
|
|
"provisioners": [{
|
|
"type": "shell",
|
|
"execute_command": "echo '{{user `ssh_password`}}' | {{ .Vars }} sudo -E -S sh '{{ .Path }}'",
|
|
"inline": [
|
|
"echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers"
|
|
]}, {
|
|
"type": "shell",
|
|
"inline": ["sudo mkdir -p {{ user `ansible_config_path` }}"]
|
|
}, {
|
|
"type": "file",
|
|
"source": "ansible.cfg",
|
|
"destination": "/tmp/ansible.cfg"
|
|
}, {
|
|
"type": "shell",
|
|
"inline": ["sudo mv /tmp/ansible.cfg {{ user `ansible_config_path` }}/{{ user `ansible_config_file` }}"]
|
|
}, {
|
|
"type": "shell",
|
|
"inline": [
|
|
"sudo echo 'log_path = {{ user `ansible_log_file` }}' >> {{ user `ansible_config_path` }}/{{ user `ansible_config_file` }}",
|
|
"sudo touch {{ user `ansible_log_file` }}",
|
|
"sudo chmod 666 {{ user `ansible_log_file` }}"
|
|
]}, {
|
|
"type": "shell",
|
|
"environment_vars": [
|
|
"CLEANUP_PAUSE={{user `cleanup_pause`}}",
|
|
"UPDATE={{user `update`}}",
|
|
"INSTALL_VAGRANT_KEY={{user `install_vagrant_key`}}",
|
|
"SSH_USERNAME={{user `ssh_username`}}",
|
|
"SSH_PASSWORD={{user `ssh_password`}}",
|
|
"http_proxy={{user `http_proxy`}}",
|
|
"https_proxy={{user `https_proxy`}}",
|
|
"ftp_proxy={{user `ftp_proxy`}}",
|
|
"rsync_proxy={{user `rsync_proxy`}}",
|
|
"no_proxy={{user `no_proxy`}}"
|
|
],
|
|
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
|
|
"scripts": [
|
|
"playbooks/files/update.sh",
|
|
"playbooks/files/vagrant.sh",
|
|
"playbooks/files/sshd.sh"
|
|
]
|
|
}, {
|
|
"type": "shell",
|
|
"script": "playbooks/files/ubuntu-ansible.sh",
|
|
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'"
|
|
}, {
|
|
"type": "ansible-local",
|
|
"playbook_dir": "playbooks",
|
|
"playbook_file": "playbooks/build-main.yaml",
|
|
"extra_arguments": ["--verbose"]
|
|
}, {
|
|
"type": "shell",
|
|
"execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'",
|
|
"scripts": [
|
|
"playbooks/files/vmtool.sh",
|
|
"playbooks/files/minimize.sh",
|
|
"playbooks/files/cleanup.sh"
|
|
]
|
|
}],
|
|
"post-processors": [
|
|
[
|
|
{
|
|
"type": "vagrant",
|
|
"keep_input_artifact": true,
|
|
"only": ["qemu"],
|
|
"output": "solar-master-libvirt.box"
|
|
},
|
|
{
|
|
"type": "vagrant",
|
|
"keep_input_artifact": false,
|
|
"only": ["virtualbox-iso"],
|
|
"output": "solar-master-virtualbox.box"
|
|
}
|
|
]
|
|
]
|
|
}
|