diff --git a/Vagrantfile b/Vagrantfile index b47088ff..9db8bce8 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -51,6 +51,7 @@ def ansible_playbook_command(filename, args=[]) end solar_script = ansible_playbook_command("solar.yaml") +solar_agent_script = ansible_playbook_command("solar-agent.yaml") master_pxe = ansible_playbook_command("pxe.yaml") @@ -61,10 +62,8 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = MASTER_IMAGE config.vm.provision "shell", inline: solar_script, privileged: true - config.vm.provision "shell", inline: "cd /vagrant && docker-compose up -d" , privileged: true config.vm.provision "shell", inline: master_pxe, privileged: true unless PREPROVISIONED config.vm.provision "file", source: "~/.vagrant.d/insecure_private_key", destination: "/vagrant/tmp/keys/ssh_private" - config.vm.provision "file", source: "bootstrap/ansible.cfg", destination: "/home/vagrant/.ansible.cfg" config.vm.host_name = "solar-dev" config.vm.provider :virtualbox do |v| @@ -118,7 +117,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| if PREPROVISIONED config.vm.provision "file", source: "bootstrap/ansible.cfg", destination: "/home/vagrant/.ansible.cfg" - config.vm.provision "shell", inline: solar_script, privileged: true + config.vm.provision "shell", inline: solar_agent_script, privileged: true #TODO(bogdando) figure out how to configure multiple interfaces when was not PREPROVISIONED ind = 0 SLAVES_IPS.each do |ip| diff --git a/bootstrap/playbooks/solar-agent.yaml b/bootstrap/playbooks/solar-agent.yaml new file mode 100644 index 00000000..66f484e4 --- /dev/null +++ b/bootstrap/playbooks/solar-agent.yaml @@ -0,0 +1,10 @@ +--- + +- hosts: all + sudo: yes + vars: + ssh_ip_mask: "10.0.0.*" + tasks: + # upgrade pbr first, old version throws strange errors + - shell: pip install pbr -U + - shell: pip install git+git://github.com/Mirantis/solar-agent.git diff --git a/bootstrap/playbooks/solar.yaml b/bootstrap/playbooks/solar.yaml index b93e6e9a..714df06b 100644 --- a/bootstrap/playbooks/solar.yaml +++ b/bootstrap/playbooks/solar.yaml @@ -47,8 +47,11 @@ line: eval "$(_SOLAR_COMPLETE=source solar)" state: present -- hosts: all - tasks: - file: path=/var/lib/solar/repositories state=directory - file: src=/vagrant/resources dest=/var/lib/solar/repositories/resources state=link - file: src=/vagrant/templates dest=/var/lib/solar/repositories/templates state=link + + - name: Starting docker containers + shell: docker-compose up -d chdir=/vagrant + - name: configuring Ansible + copy: src=/vagrant/bootstrap/ansible.cfg dest=/home/vagrant/.ansible.cfg