Create cinde-volume on all slaves.

This commit is contained in:
Łukasz Oleś 2015-07-22 13:50:54 +00:00
parent 4957dd9d30
commit dad6d3ffab
2 changed files with 15 additions and 1 deletions

2
Vagrantfile vendored
View File

@ -16,7 +16,7 @@ slave_script = <<SCRIPT
apt-get update
apt-get -y install python-pip python-dev
pip install ansible
ansible-playbook -i "localhost," -c local /vagrant/main.yml /vagrant/docker.yml /vagrant/slave.yml
ansible-playbook -i "localhost," -c local /vagrant/main.yml /vagrant/docker.yml /vagrant/slave.yml /vagrant/slave_cinder.yml
SCRIPT
master_celery = <<SCRIPT

14
slave_cinder.yml Normal file
View File

@ -0,0 +1,14 @@
---
- hosts: all
sudo: yes
tasks:
- apt: name=lvm2 state=present
- command: sudo truncate -s 10G /root/cinder.img creates=/root/cinder.img
- shell: sudo losetup -a|grep cinder
register: loop_created
ignore_errors: True
- command: sudo losetup /dev/loop0 /root/cinder.img
when: loop_created|failed
- lvg: vg=cinder-volumes pvs=/dev/loop0
when: loop_created|failed