ETH = settings['eth']
DOCKER = settings['docker']
+if BOX == 'openstack'
+ require 'vagrant-openstack-provider'
+ OSVM = true
+ USER = settings['os_ssh_username']
+else
+ OSVM = false
+end
+
ansible_provision = proc do |ansible|
if DOCKER then
ansible.playbook = 'site-docker.yml'
+ if settings['skip_tags']
+ ansible.skip_tags = settings['skip_tags']
+ end
else
ansible.playbook = 'site.yml'
end
override.vm.synced_folder '.', '/home/vagrant/sync', disabled: true
end
+ if BOX == 'openstack'
+ # OpenStack VMs
+ config.vm.provider :openstack do |os|
+ config.vm.synced_folder ".", "/home/#{USER}/vagrant", disabled: true
+ config.ssh.username = USER
+ config.ssh.private_key_path = settings['os_ssh_private_key_path']
+ config.ssh.pty = true
+ os.openstack_auth_url = settings['os_openstack_auth_url']
+ os.username = settings['os_username']
+ os.password = settings['os_password']
+ os.tenant_name = settings['os_tenant_name']
+ os.region = settings['os_region']
+ os.flavor = settings['os_flavor']
+ os.image = settings['os_image']
+ os.keypair_name = settings['os_keypair_name']
+ os.security_groups = ['default']
+ config.vm.provision "shell", inline: "true", upload_path: "/home/#{USER}/vagrant-shell"
+ end
+ end
+
(0..CLIENTS - 1).each do |i|
config.vm.define "client#{i}" do |client|
client.vm.hostname = "ceph-client#{i}"
- client.vm.network :private_network, ip: "#{SUBNET}.4#{i}"
-
+ if !OSVM
+ client.vm.network :private_network, ip: "#{SUBNET}.4#{i}"
+ end
# Virtualbox
client.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
(0..NRGWS - 1).each do |i|
config.vm.define "rgw#{i}" do |rgw|
rgw.vm.hostname = "ceph-rgw#{i}"
- rgw.vm.network :private_network, ip: "#{SUBNET}.5#{i}"
+ if !OSVM
+ rgw.vm.network :private_network, ip: "#{SUBNET}.5#{i}"
+ end
# Virtualbox
rgw.vm.provider :virtualbox do |vb|
(0..NMDSS - 1).each do |i|
config.vm.define "mds#{i}" do |mds|
mds.vm.hostname = "ceph-mds#{i}"
- mds.vm.network :private_network, ip: "#{SUBNET}.7#{i}"
-
+ if !OSVM
+ mds.vm.network :private_network, ip: "#{SUBNET}.7#{i}"
+ end
# Virtualbox
mds.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
mds.vm.provider :libvirt do |lv|
lv.memory = MEMORY
end
-
# Parallels
mds.vm.provider "parallels" do |prl|
prl.name = "ceph-mds#{i}"
(0..NMONS - 1).each do |i|
config.vm.define "mon#{i}" do |mon|
mon.vm.hostname = "ceph-mon#{i}"
- mon.vm.network :private_network, ip: "#{SUBNET}.1#{i}"
-
+ if !OSVM
+ mon.vm.network :private_network, ip: "#{SUBNET}.1#{i}"
+ end
# Virtualbox
mon.vm.provider :virtualbox do |vb|
vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
(0..NOSDS - 1).each do |i|
config.vm.define "osd#{i}" do |osd|
osd.vm.hostname = "ceph-osd#{i}"
- osd.vm.network :private_network, ip: "#{SUBNET}.10#{i}"
- osd.vm.network :private_network, ip: "#{SUBNET}.20#{i}"
-
+ if !OSVM
+ osd.vm.network :private_network, ip: "#{SUBNET}.10#{i}"
+ osd.vm.network :private_network, ip: "#{SUBNET}.20#{i}"
+ end
# Virtualbox
osd.vm.provider :virtualbox do |vb|
(0..1).each do |d|
prl.name = "ceph-osd#{i}"
prl.memory = "#{MEMORY}"
(0..1).each do |d|
- prl.customize ["set", :id,
- "--device-add",
- "hdd",
- "--iface",
+ prl.customize ["set", :id,
+ "--device-add",
+ "hdd",
+ "--iface",
"sata"]
end
end
when:
(ceph_origin == "distro" or ceph_stable_rh_storage) and
mon_group_name in group_names and
- ansible_pkg_mgr == "yum" and
- ceph_stable and
- ceph_stable_release not in ceph_stable_releases
+ ansible_pkg_mgr == "yum"
- name: install distro or red hat storage ceph mon
dnf:
when:
(ceph_origin == "distro" or ceph_stable_rh_storage) and
mon_group_name in group_names and
- ansible_pkg_mgr == "dnf" and
- ceph_stable and
- ceph_stable_release not in ceph_stable_releases
+ ansible_pkg_mgr == "dnf"
- name: install distro or red hat storage ceph osd
yum:
when:
(ceph_origin == "distro" or ceph_stable_rh_storage) and
osd_group_name in group_names and
- ansible_pkg_mgr == "yum" and
- ceph_stable and
- ceph_stable_release not in ceph_stable_releases
+ ansible_pkg_mgr == "yum"
- name: install distro or red hat storage ceph osd
dnf:
when:
(ceph_origin == "distro" or ceph_stable_rh_storage) and
osd_group_name in group_names and
- ansible_pkg_mgr == "dnf" and
- ceph_stable and
- ceph_stable_release not in ceph_stable_releases
+ ansible_pkg_mgr == "dnf"
- name: install ceph-test
yum:
--- /dev/null
+---
+
+# DEFINE THE NUMBER OF VMS TO RUN
+mon_vms: 1
+osd_vms: 1
+mds_vms: 0
+rgw_vms: 0
+client_vms: 0
+
+# SUBNET TO USE FOR THE VMS
+subnet: 192.168.0
+
+# MEMORY
+memory: 1024
+
+disks: "[ '/dev/sdb', '/dev/sdc' ]"
+
+eth: 'enp0s3'
+# VAGRANT BOX
+# Fedora: https://download.fedoraproject.org/pub/fedora/linux/releases/22/Cloud/x86_64/Images/Fedora-Cloud-Base-Vagrant-22-20150521.x86_64.vagrant-virtualbox.box
+# Ubuntu: ubuntu/trusty64
+# CentOS: chef/centos-7.0
+# Debian: deb/jessie-amd64 - be careful the storage controller is named 'SATA Controller'
+# For more boxes have a look at:
+# - https://atlas.hashicorp.com/boxes/search?utf8=✓&sort=&provider=virtualbox&q=
+# - https://download.gluster.org/pub/gluster/purpleidea/vagrant/
+
+vagrant_box: centos/atomic-host
+
+# if vagrant fails to attach storage controller, add the storage controller name by:
+# VBoxManage storagectl `VBoxManage list vms |grep ceph-ansible-osd|awk '{print $1}'|tr \" ' '` --name "LsiLogic" --add scsi
+# and "vagrant up" again
+vagrant_storagectl: 'LsiLogic'
+skip_tags: 'with_pkg'
\ No newline at end of file