{ "variables": { "cm": "puppet", "cm_version": "latest", "cleanup_pause": "", "headless": "{{env `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://centos1.hti.pl/7/isos/x86_64/CentOS-7-x86_64-NetInstall-1511.iso", "iso_checksum": "99d305fa40ec9e28ef8450c3bcc45f85", "disk_size": "4500", "mem_size": "512", "vcpu_num": "1", "cleanup": "true", "ansible_config_path": "/etc/ansible", "ansible_config_file": "ansible.cfg", "ansible_log_file": "/var/tmp/ansible.log" }, "builders": [{ "vm_name": "centos7", "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": [ " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" ], "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", "disk_size": "{{ user `disk_size`}}", "qemuargs": [ [ "-m", "{{user `mem_size`}}M" ], [ "-smp", "{{ user `vcpu_num`}}" ] ] }, { "vm_name": "centos7", "type": "virtualbox-iso", "http_directory": "http", "iso_url": "{{ user `iso_url` }}", "iso_checksum": "{{ user `iso_checksum` }}", "iso_checksum_type": "md5", "guest_os_type": "RedHat_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": [ " text ks=http://{{ .HTTPIP }}:{{ .HTTPPort }}/ks.cfg" ], "shutdown_command": "echo 'vagrant' | sudo -S /sbin/halt -h -p", "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": "shell", "inline": [ "touch /tmp/ansible.cfg", "sudo mv /tmp/ansible.cfg {{ user `ansible_config_path` }}/{{ user `ansible_config_file` }}", "sudo echo '[defaults]' >> {{ user `ansible_config_path` }}/{{ user `ansible_config_file` }}", "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": [ "CM={{user `cm`}}", "CM_VERSION={{user `cm_version`}}", "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/centos/files/update.sh", "playbooks/centos/files/tools.sh", "playbooks/centos/files/cmtool.sh", "playbooks/centos/files/vagrant.sh", "playbooks/centos/files/sshd.sh" ] }, { "type": "shell", "environment_vars": [ "CM=ansible", "CM_VERSION=latest" ], "script": "playbooks/centos/files/cmtool.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", "environment_vars": [ "cleanup={{user `cleanup`}}" ], "execute_command": "echo 'vagrant' | {{.Vars}} sudo -E -S bash '{{.Path}}'", "scripts": [ "playbooks/centos/files/vagrant_fix_nfs.sh", "playbooks/centos/files/vmtool.sh", "playbooks/centos/files/minimize.sh", "playbooks/centos/files/cleanup.sh" ] }], "post-processors": [ [ { "type": "vagrant", "keep_input_artifact": true, "only": ["qemu"], "output": "solar-master-centos-libvirt.box" }, { "type": "vagrant", "keep_input_artifact": false, "only": ["virtualbox-iso"], "output": "solar-master-centos-virtualbox.box" } ] ] }