Merge pull request #82 from Mirantis/cgenie/fix_vagrantfile

Fix vagrantfile
This commit is contained in:
Bogdan Dobrelya 2015-09-01 12:38:47 +02:00
commit 3c2c2f2255
6 changed files with 46 additions and 13 deletions

20
Vagrantfile vendored
View File

@ -5,21 +5,17 @@
VAGRANTFILE_API_VERSION = "2"
SLAVES_COUNT = 2
solar_script = <<SCRIPT
ansible-playbook -i "localhost," -c local /vagrant/bootstrap/playbooks/solar.yml
SCRIPT
def ansible_playbook_command(filename, args=[])
"ansible-playbook -v -i \"localhost,\" -c local /vagrant/bootstrap/playbooks/#{filename} #{args.join ' '}"
end
slave_script = <<SCRIPT
ansible-playbook -i "localhost," -c local /vagrant/bootstrap/playbooks/custom-configs.yml -e master_ip=10.0.0.2
SCRIPT
solar_script = ansible_playbook_command("solar.yml")
master_celery = <<SCRIPT
ansible-playbook -i "localhost," -c local /vagrant/bootstrap/playbooks/celery.yml --skip-tags slave
SCRIPT
slave_script = ansible_playbook_command("custom-configs.yml", ["-e", "master_ip=10.0.0.2"])
slave_celery = <<SCRIPT
ansible-playbook -i "localhost," -c local /vagrant/bootstrap/playbooks/celery.yml --skip-tags master
SCRIPT
master_celery = ansible_playbook_command("celery.yml", ["--skip-tags", "slave"])
slave_celery = ansible_playbook_command("celery.yml", ["--skip-tags", "master"])
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

2
bootstrap/ansible.cfg Normal file
View File

@ -0,0 +1,2 @@
[defaults]
host_key_checking = False

View File

@ -9,3 +9,4 @@
- include: tasks/docker.yml
#- include: celery.yml tags=['master'] celery_dir=/var/run/celery
- include: tasks/cinder.yml
- include: tasks/cloud_archive.yml

View File

@ -0,0 +1,7 @@
---
- shell: apt-get update
- shell: apt-get -y upgrade
- shell: add-apt-repository -y cloud-archive:juno
- shell: apt-get update
- shell: apt-get update --fix-missing

View File

@ -1,4 +1,9 @@
{
"variables": {
"ansible_config_path": "/etc/ansible",
"ansible_config_file": "ansible.cfg",
"ansible_log_file": "/tmp/ansible.log"
},
"builders": [{
"type": "virtualbox-ovf",
"source_path": "trusty64/box.ovf",
@ -7,13 +12,33 @@
"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` }}"
]
},
{
"type": "shell",
"script": "playbooks/files/ubuntu-ansible.sh"
}, {
"type": "ansible-local",
"playbook_dir": "playbooks",
"playbook_file": "playbooks/build-main.yml"
"playbook_file": "playbooks/build-main.yml",
"extra_arguments": ["--verbose"]
}],
"post-processors": [{
"type": "vagrant",

View File

@ -1,3 +1,5 @@
#!/usr/bin/env python
import click
import sys
import time