50 lines
1.4 KiB
JSON
50 lines
1.4 KiB
JSON
{
|
|
"variables": {
|
|
"ansible_config_path": "/etc/ansible",
|
|
"ansible_config_file": "ansible.cfg",
|
|
"ansible_log_file": "/var/tmp/ansible.log"
|
|
},
|
|
"builders": [{
|
|
"type": "virtualbox-ovf",
|
|
"source_path": "trusty64/box.ovf",
|
|
"ssh_username": "vagrant",
|
|
"ssh_password": "vagrant",
|
|
"shutdown_command": "echo 'vagrant' | sudo -S shutdown -P now"
|
|
}],
|
|
"provisioners": [
|
|
{
|
|
"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` }}",
|
|
"touch {{ user `ansible_log_file` }}",
|
|
"chmod 666 {{ user `ansible_log_file` }}"
|
|
]
|
|
},
|
|
{
|
|
"type": "shell",
|
|
"script": "playbooks/files/ubuntu-ansible.sh"
|
|
}, {
|
|
"type": "ansible-local",
|
|
"playbook_dir": "playbooks",
|
|
"playbook_file": "playbooks/build-main.yaml",
|
|
"extra_arguments": ["--verbose"]
|
|
}],
|
|
"post-processors": [{
|
|
"type": "vagrant",
|
|
"output": "solar-master.box"
|
|
}]
|
|
}
|