]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Changes to allow ceph-ansible and vagrant to work on Openstack VMs
authorJim Curtis <jicurtis@Jims-MacBook-Pro.local>
Thu, 4 Feb 2016 20:24:56 +0000 (12:24 -0800)
committerSébastien Han <seb@redhat.com>
Thu, 24 Mar 2016 15:18:46 +0000 (16:18 +0100)
Vagrantfile [deleted file]
Vagrantfile.openstack [new file with mode: 0644]
Vagrantfile.sample [new file with mode: 0644]
group_vars/all.docker [deleted file]
group_vars/all.docker.sample [new file with mode: 0644]
roles/ceph-mds/tasks/docker/pre_requisite.yml
roles/ceph-mon/tasks/docker/start_docker_monitor.yml
roles/ceph-osd/tasks/docker/start_docker_osd.yml
vagrant_variables.yml.openstack [new file with mode: 0644]

diff --git a/Vagrantfile b/Vagrantfile
deleted file mode 100644 (file)
index dcfe2fc..0000000
+++ /dev/null
@@ -1,295 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-require 'yaml'
-VAGRANTFILE_API_VERSION = '2'
-
-config_file=File.expand_path(File.join(File.dirname(__FILE__), 'vagrant_variables.yml'))
-settings=YAML.load_file(config_file)
-
-NMONS      = settings['mon_vms']
-NOSDS      = settings['osd_vms']
-NMDSS      = settings['mds_vms']
-NRGWS      = settings['rgw_vms']
-CLIENTS    = settings['client_vms']
-SUBNET     = settings['subnet']
-BOX        = settings['vagrant_box']
-MEMORY     = settings['memory']
-STORAGECTL = settings['vagrant_storagectl']
-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
-
-  # Note: Can't do ranges like mon[0-2] in groups because
-  # these aren't supported by Vagrant, see
-  # https://github.com/mitchellh/vagrant/issues/3539
-  ansible.groups = {
-    'mons'        => (0..NMONS - 1).map { |j| "mon#{j}" },
-    'restapis'    => (0..NMONS - 1).map { |j| "mon#{j}" },
-    'osds'        => (0..NOSDS - 1).map { |j| "osd#{j}" },
-    'mdss'        => (0..NMDSS - 1).map { |j| "mds#{j}" },
-    'rgws'        => (0..NRGWS - 1).map { |j| "rgw#{j}" },
-    'clients'     => (0..CLIENTS - 1).map { |j| "client#{j}" }
-  }
-
-  # In a production deployment, these should be secret
-  if DOCKER then
-    ansible.extra_vars = {
-      mon_containerized_deployment: 'true',
-      osd_containerized_deployment: 'true',
-      mds_containerized_deployment: 'true',
-      rgw_containerized_deployment: 'true',
-      restapi_containerized_deployment: 'true',
-      ceph_mon_docker_interface: ETH,
-      ceph_mon_docker_subnet: "#{SUBNET}.0/24",
-      ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK,OSD_JOURNAL_SIZE=100",
-      ceph_osd_docker_devices: settings['disks'],
-      ceph_rgw_civetweb_port: 8080
-    }
-  else
-    ansible.extra_vars = {
-      "ceph_#{settings['ceph_install_source']}"=> 'true',
-      journal_collocation: 'true',
-      journal_size: 100,
-      monitor_interface: ETH,
-      cluster_network: "#{SUBNET}.0/24",
-      public_network: "#{SUBNET}.0/24",
-      devices: settings['disks'],
-      os_tuning_params: settings['os_tuning_params']
-    }
-  end
-  ansible.limit = 'all'
-end
-
-def create_vmdk(name, size)
-  dir = Pathname.new(__FILE__).expand_path.dirname
-  path = File.join(dir, '.vagrant', name + '.vmdk')
-  `vmware-vdiskmanager -c -s #{size} -t 0 -a scsi #{path} \
-   2>&1 > /dev/null` unless File.exist?(path)
-end
-
-Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
-  config.vm.box = BOX
-  config.ssh.insert_key = false # workaround for https://github.com/mitchellh/vagrant/issues/5048
-
-  # Faster bootup.  Disable if you need this for libvirt
-  config.vm.provider :libvirt do |v,override|
-    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}"
-      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}"]
-      end
-
-      # VMware
-      client.vm.provider :vmware_fusion do |v|
-        v.vmx['memsize'] = "#{MEMORY}"
-      end
-
-      # Libvirt
-      client.vm.provider :libvirt do |lv|
-        lv.memory = MEMORY
-      end
-
-      # Parallels
-      client.vm.provider "parallels" do |prl|
-        prl.name = "ceph-client#{i}"
-        prl.memory = "#{MEMORY}"
-      end
-    end
-  end
-
-  (0..NRGWS - 1).each do |i|
-    config.vm.define "rgw#{i}" do |rgw|
-      rgw.vm.hostname = "ceph-rgw#{i}"
-      if !OSVM
-        rgw.vm.network :private_network, ip: "#{SUBNET}.5#{i}"
-      end
-
-      # Virtualbox
-      rgw.vm.provider :virtualbox do |vb|
-        vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
-      end
-
-      # VMware
-      rgw.vm.provider :vmware_fusion do |v|
-        v.vmx['memsize'] = "#{MEMORY}"
-      end
-
-      # Libvirt
-      rgw.vm.provider :libvirt do |lv|
-        lv.memory = MEMORY
-      end
-
-      # Parallels
-      rgw.vm.provider "parallels" do |prl|
-        prl.name = "ceph-rgw#{i}"
-        prl.memory = "#{MEMORY}"
-      end
-    end
-  end
-
-  (0..NMDSS - 1).each do |i|
-    config.vm.define "mds#{i}" do |mds|
-      mds.vm.hostname = "ceph-mds#{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}"]
-      end
-
-      # VMware
-      mds.vm.provider :vmware_fusion do |v|
-        v.vmx['memsize'] = "#{MEMORY}"
-      end
-
-      # Libvirt
-      mds.vm.provider :libvirt do |lv|
-        lv.memory = MEMORY
-      end
-      # Parallels
-      mds.vm.provider "parallels" do |prl|
-        prl.name = "ceph-mds#{i}"
-        prl.memory = "#{MEMORY}"
-      end
-    end
-  end
-
-  (0..NMONS - 1).each do |i|
-    config.vm.define "mon#{i}" do |mon|
-      mon.vm.hostname = "ceph-mon#{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}"]
-      end
-
-      # VMware
-      mon.vm.provider :vmware_fusion do |v|
-        v.vmx['memsize'] = "#{MEMORY}"
-      end
-
-      # Libvirt
-      mon.vm.provider :libvirt do |lv|
-        lv.memory = MEMORY
-      end
-
-      # Parallels
-      mon.vm.provider "parallels" do |prl|
-        prl.name = "ceph-mon#{i}"
-        prl.memory = "#{MEMORY}"
-      end
-    end
-  end
-
-  (0..NOSDS - 1).each do |i|
-    config.vm.define "osd#{i}" do |osd|
-      osd.vm.hostname = "ceph-osd#{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|
-          vb.customize ['createhd',
-                        '--filename', "disk-#{i}-#{d}",
-                        '--size', '11000'] unless File.exist?("disk-#{i}-#{d}.vdi")
-          # Controller names are dependent on the VM being built.
-          # It is set when the base box is made in our case ubuntu/trusty64.
-          # Be careful while changing the box.
-          vb.customize ['storageattach', :id,
-                        '--storagectl', STORAGECTL,
-                        '--port', 3 + d,
-                        '--device', 0,
-                        '--type', 'hdd',
-                        '--medium', "disk-#{i}-#{d}.vdi"]
-        end
-        vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
-      end
-
-      # VMware
-      osd.vm.provider :vmware_fusion do |v|
-        (0..1).each do |d|
-          v.vmx["scsi0:#{d + 1}.present"] = 'TRUE'
-          v.vmx["scsi0:#{d + 1}.fileName"] =
-            create_vmdk("disk-#{i}-#{d}", '11000MB')
-        end
-        v.vmx['memsize'] = "#{MEMORY}"
-      end
-
-      # Libvirt
-      driverletters = ('b'..'z').to_a
-      osd.vm.provider :libvirt do |lv|
-        (0..1).each do |d|
-          lv.storage :file, :device => "vd#{driverletters[d]}", :path => "disk-#{i}-#{d}.disk", :size => '11G'
-        end
-        lv.memory = MEMORY
-      end
-
-      # Parallels
-      osd.vm.provider "parallels" do |prl|
-        prl.name = "ceph-osd#{i}"
-        prl.memory = "#{MEMORY}"
-        (0..1).each do |d|
-          prl.customize ["set", :id,
-                         "--device-add",
-                         "hdd",
-                         "--iface",
-                         "sata"]
-        end
-      end
-
-      # Run the provisioner after the last machine comes up
-      osd.vm.provision 'ansible', &ansible_provision if i == (NOSDS - 1)
-    end
-  end
-end
diff --git a/Vagrantfile.openstack b/Vagrantfile.openstack
new file mode 100644 (file)
index 0000000..52fa4e6
--- /dev/null
@@ -0,0 +1,111 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+require 'yaml'
+require 'vagrant-openstack-provider'
+VAGRANTFILE_API_VERSION = '2'
+
+config_file=File.expand_path(File.join(File.dirname(__FILE__), 'vagrant_variables.yml'))
+settings=YAML.load_file(config_file)
+
+NMONS      = settings['mon_vms']
+NOSDS      = settings['osd_vms']
+NMDSS      = settings['mds_vms']
+NRGWS      = settings['rgw_vms']
+CLIENTS    = settings['client_vms']
+SUBNET     = settings['subnet']
+BOX        = settings['vagrant_box']
+MEMORY     = settings['memory']
+STORAGECTL = settings['vagrant_storagectl']
+ETH        = settings['eth']
+USER       = settings['os_ssh_username']
+
+ansible_provision = proc do |ansible|
+  ansible.playbook = 'site.yml'
+  if settings['skip_tags']
+    ansible.skip_tags = settings['skip_tags']
+  end
+
+  # Note: Can't do ranges like mon[0-2] in groups because
+  # these aren't supported by Vagrant, see
+  # https://github.com/mitchellh/vagrant/issues/3539
+  ansible.groups = {
+    'mons'        => (0..NMONS - 1).map { |j| "mon#{j}" },
+    'restapis'    => (0..NMONS - 1).map { |j| "mon#{j}" },
+    'osds'        => (0..NOSDS - 1).map { |j| "osd#{j}" },
+    'mdss'        => (0..NMDSS - 1).map { |j| "mds#{j}" },
+    'rgws'        => (0..NRGWS - 1).map { |j| "rgw#{j}" },
+    'clients'     => (0..CLIENTS - 1).map { |j| "client#{j}" }
+  }
+
+  # In a production deployment, these should be secret
+  ansible.extra_vars = {
+    ceph_stable: 'true',
+    journal_collocation: 'true',
+    fsid: '4a158d27-f750-41d5-9e7f-26ce4c9d2d45',
+    monitor_secret: 'AQAWqilTCDh7CBAAawXt6kyTgLFCxSvJhTEmuw==',
+    journal_size: 100,
+    monitor_interface: ETH,
+    cluster_network: "#{SUBNET}.0/24",
+    public_network: "#{SUBNET}.0/24",
+    devices: settings['disks'],
+    os_tuning_params: settings['os_tuning_params']
+  }
+  ansible.limit = 'all'
+end
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+  config.vm.synced_folder ".", "/home/#{USER}/vagrant", disabled: true
+  config.vm.box = BOX
+  config.ssh.insert_key = false # workaround for https://github.com/mitchellh/vagrant/issues/5048
+
+  # OpenStack VMs
+  config.vm.provider :openstack do |os|
+    config.ssh.username = settings['os_ssh_username']
+    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']
+  end
+
+  config.vm.provision "shell", inline: "true", upload_path: "/home/#{USER}/vagrant-shell"
+
+  (0..CLIENTS - 1).each do |i|
+    config.vm.define "client#{i}" do |client|
+      client.vm.hostname = "ceph-client#{i}"
+    end
+  end
+
+  (0..NRGWS - 1).each do |i|
+    config.vm.define "rgw#{i}" do |rgw|
+      rgw.vm.hostname = "ceph-rgw#{i}"
+    end
+  end
+
+  (0..NMDSS - 1).each do |i|
+    config.vm.define "mds#{i}" do |mds|
+      mds.vm.hostname = "ceph-mds#{i}"
+    end
+  end
+
+  (0..NMONS - 1).each do |i|
+    config.vm.define "mon#{i}" do |mon|
+      mon.vm.hostname = "ceph-mon#{i}"
+    end
+  end
+
+  (0..NOSDS - 1).each do |i|
+    config.vm.define "osd#{i}" do |osd|
+      osd.vm.hostname = "ceph-osd#{i}"
+      # Run the provisioner after the last machine comes up
+      osd.vm.provision 'ansible', &ansible_provision if i == (NOSDS - 1)
+    end
+  end
+end
diff --git a/Vagrantfile.sample b/Vagrantfile.sample
new file mode 100644 (file)
index 0000000..dcfe2fc
--- /dev/null
@@ -0,0 +1,295 @@
+# -*- mode: ruby -*-
+# vi: set ft=ruby :
+
+require 'yaml'
+VAGRANTFILE_API_VERSION = '2'
+
+config_file=File.expand_path(File.join(File.dirname(__FILE__), 'vagrant_variables.yml'))
+settings=YAML.load_file(config_file)
+
+NMONS      = settings['mon_vms']
+NOSDS      = settings['osd_vms']
+NMDSS      = settings['mds_vms']
+NRGWS      = settings['rgw_vms']
+CLIENTS    = settings['client_vms']
+SUBNET     = settings['subnet']
+BOX        = settings['vagrant_box']
+MEMORY     = settings['memory']
+STORAGECTL = settings['vagrant_storagectl']
+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
+
+  # Note: Can't do ranges like mon[0-2] in groups because
+  # these aren't supported by Vagrant, see
+  # https://github.com/mitchellh/vagrant/issues/3539
+  ansible.groups = {
+    'mons'        => (0..NMONS - 1).map { |j| "mon#{j}" },
+    'restapis'    => (0..NMONS - 1).map { |j| "mon#{j}" },
+    'osds'        => (0..NOSDS - 1).map { |j| "osd#{j}" },
+    'mdss'        => (0..NMDSS - 1).map { |j| "mds#{j}" },
+    'rgws'        => (0..NRGWS - 1).map { |j| "rgw#{j}" },
+    'clients'     => (0..CLIENTS - 1).map { |j| "client#{j}" }
+  }
+
+  # In a production deployment, these should be secret
+  if DOCKER then
+    ansible.extra_vars = {
+      mon_containerized_deployment: 'true',
+      osd_containerized_deployment: 'true',
+      mds_containerized_deployment: 'true',
+      rgw_containerized_deployment: 'true',
+      restapi_containerized_deployment: 'true',
+      ceph_mon_docker_interface: ETH,
+      ceph_mon_docker_subnet: "#{SUBNET}.0/24",
+      ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK,OSD_JOURNAL_SIZE=100",
+      ceph_osd_docker_devices: settings['disks'],
+      ceph_rgw_civetweb_port: 8080
+    }
+  else
+    ansible.extra_vars = {
+      "ceph_#{settings['ceph_install_source']}"=> 'true',
+      journal_collocation: 'true',
+      journal_size: 100,
+      monitor_interface: ETH,
+      cluster_network: "#{SUBNET}.0/24",
+      public_network: "#{SUBNET}.0/24",
+      devices: settings['disks'],
+      os_tuning_params: settings['os_tuning_params']
+    }
+  end
+  ansible.limit = 'all'
+end
+
+def create_vmdk(name, size)
+  dir = Pathname.new(__FILE__).expand_path.dirname
+  path = File.join(dir, '.vagrant', name + '.vmdk')
+  `vmware-vdiskmanager -c -s #{size} -t 0 -a scsi #{path} \
+   2>&1 > /dev/null` unless File.exist?(path)
+end
+
+Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
+  config.vm.box = BOX
+  config.ssh.insert_key = false # workaround for https://github.com/mitchellh/vagrant/issues/5048
+
+  # Faster bootup.  Disable if you need this for libvirt
+  config.vm.provider :libvirt do |v,override|
+    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}"
+      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}"]
+      end
+
+      # VMware
+      client.vm.provider :vmware_fusion do |v|
+        v.vmx['memsize'] = "#{MEMORY}"
+      end
+
+      # Libvirt
+      client.vm.provider :libvirt do |lv|
+        lv.memory = MEMORY
+      end
+
+      # Parallels
+      client.vm.provider "parallels" do |prl|
+        prl.name = "ceph-client#{i}"
+        prl.memory = "#{MEMORY}"
+      end
+    end
+  end
+
+  (0..NRGWS - 1).each do |i|
+    config.vm.define "rgw#{i}" do |rgw|
+      rgw.vm.hostname = "ceph-rgw#{i}"
+      if !OSVM
+        rgw.vm.network :private_network, ip: "#{SUBNET}.5#{i}"
+      end
+
+      # Virtualbox
+      rgw.vm.provider :virtualbox do |vb|
+        vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
+      end
+
+      # VMware
+      rgw.vm.provider :vmware_fusion do |v|
+        v.vmx['memsize'] = "#{MEMORY}"
+      end
+
+      # Libvirt
+      rgw.vm.provider :libvirt do |lv|
+        lv.memory = MEMORY
+      end
+
+      # Parallels
+      rgw.vm.provider "parallels" do |prl|
+        prl.name = "ceph-rgw#{i}"
+        prl.memory = "#{MEMORY}"
+      end
+    end
+  end
+
+  (0..NMDSS - 1).each do |i|
+    config.vm.define "mds#{i}" do |mds|
+      mds.vm.hostname = "ceph-mds#{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}"]
+      end
+
+      # VMware
+      mds.vm.provider :vmware_fusion do |v|
+        v.vmx['memsize'] = "#{MEMORY}"
+      end
+
+      # Libvirt
+      mds.vm.provider :libvirt do |lv|
+        lv.memory = MEMORY
+      end
+      # Parallels
+      mds.vm.provider "parallels" do |prl|
+        prl.name = "ceph-mds#{i}"
+        prl.memory = "#{MEMORY}"
+      end
+    end
+  end
+
+  (0..NMONS - 1).each do |i|
+    config.vm.define "mon#{i}" do |mon|
+      mon.vm.hostname = "ceph-mon#{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}"]
+      end
+
+      # VMware
+      mon.vm.provider :vmware_fusion do |v|
+        v.vmx['memsize'] = "#{MEMORY}"
+      end
+
+      # Libvirt
+      mon.vm.provider :libvirt do |lv|
+        lv.memory = MEMORY
+      end
+
+      # Parallels
+      mon.vm.provider "parallels" do |prl|
+        prl.name = "ceph-mon#{i}"
+        prl.memory = "#{MEMORY}"
+      end
+    end
+  end
+
+  (0..NOSDS - 1).each do |i|
+    config.vm.define "osd#{i}" do |osd|
+      osd.vm.hostname = "ceph-osd#{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|
+          vb.customize ['createhd',
+                        '--filename', "disk-#{i}-#{d}",
+                        '--size', '11000'] unless File.exist?("disk-#{i}-#{d}.vdi")
+          # Controller names are dependent on the VM being built.
+          # It is set when the base box is made in our case ubuntu/trusty64.
+          # Be careful while changing the box.
+          vb.customize ['storageattach', :id,
+                        '--storagectl', STORAGECTL,
+                        '--port', 3 + d,
+                        '--device', 0,
+                        '--type', 'hdd',
+                        '--medium', "disk-#{i}-#{d}.vdi"]
+        end
+        vb.customize ['modifyvm', :id, '--memory', "#{MEMORY}"]
+      end
+
+      # VMware
+      osd.vm.provider :vmware_fusion do |v|
+        (0..1).each do |d|
+          v.vmx["scsi0:#{d + 1}.present"] = 'TRUE'
+          v.vmx["scsi0:#{d + 1}.fileName"] =
+            create_vmdk("disk-#{i}-#{d}", '11000MB')
+        end
+        v.vmx['memsize'] = "#{MEMORY}"
+      end
+
+      # Libvirt
+      driverletters = ('b'..'z').to_a
+      osd.vm.provider :libvirt do |lv|
+        (0..1).each do |d|
+          lv.storage :file, :device => "vd#{driverletters[d]}", :path => "disk-#{i}-#{d}.disk", :size => '11G'
+        end
+        lv.memory = MEMORY
+      end
+
+      # Parallels
+      osd.vm.provider "parallels" do |prl|
+        prl.name = "ceph-osd#{i}"
+        prl.memory = "#{MEMORY}"
+        (0..1).each do |d|
+          prl.customize ["set", :id,
+                         "--device-add",
+                         "hdd",
+                         "--iface",
+                         "sata"]
+        end
+      end
+
+      # Run the provisioner after the last machine comes up
+      osd.vm.provision 'ansible', &ansible_provision if i == (NOSDS - 1)
+    end
+  end
+end
diff --git a/group_vars/all.docker b/group_vars/all.docker
deleted file mode 100644 (file)
index 12ae373..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
----
-dummy:
-cephx_require_signatures: false # Kernel RBD does NOT support signatures!
-cephx_cluster_require_signatures: false
-restapi_group_name: restapis
-fetch_directory: fetch/
-mon_containerized_deployment: true
-mon_docker_privileged: true
-ceph_mon_docker_username: hchen
-ceph_mon_docker_imagename: rhceph
-ceph_mon_docker_interface: "{{ monitor_interface }}"
-ceph_mon_docker_subnet: "{{ public_network }}" # subnet of the ceph_mon_docker_interface
-ceph_mon_extra_envs: "MON_NAME={{ ansible_hostname }}" # comma separated variables
-osd_containerized_deployment: true
-ceph_osd_docker_username: hchen
-ceph_osd_docker_imagename: rhceph
-ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK_ACTIVATE" # comma separated variables
-ceph_osd_docker_prepare_env: "CEPH_DAEMON=OSD_CEPH_DISK_PREPARE,OSD_FORCE_ZAP=1" # comma separated variables
-ceph_osd_docker_devices:
- - /dev/sdb
-rgw_containerized_deployment: true
-ceph_rgw_docker_username: hchen
-ceph_rgw_docker_imagename: rhceph
-ceph_rgw_civetweb_port: 80
-ceph_rgw_docker_extra_env: "RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}" # comma separated variables
-rbd_client_directories: false
-ceph_stable_release: hammer
-
-
-
diff --git a/group_vars/all.docker.sample b/group_vars/all.docker.sample
new file mode 100644 (file)
index 0000000..12ae373
--- /dev/null
@@ -0,0 +1,30 @@
+---
+dummy:
+cephx_require_signatures: false # Kernel RBD does NOT support signatures!
+cephx_cluster_require_signatures: false
+restapi_group_name: restapis
+fetch_directory: fetch/
+mon_containerized_deployment: true
+mon_docker_privileged: true
+ceph_mon_docker_username: hchen
+ceph_mon_docker_imagename: rhceph
+ceph_mon_docker_interface: "{{ monitor_interface }}"
+ceph_mon_docker_subnet: "{{ public_network }}" # subnet of the ceph_mon_docker_interface
+ceph_mon_extra_envs: "MON_NAME={{ ansible_hostname }}" # comma separated variables
+osd_containerized_deployment: true
+ceph_osd_docker_username: hchen
+ceph_osd_docker_imagename: rhceph
+ceph_osd_docker_extra_env: "CEPH_DAEMON=OSD_CEPH_DISK_ACTIVATE" # comma separated variables
+ceph_osd_docker_prepare_env: "CEPH_DAEMON=OSD_CEPH_DISK_PREPARE,OSD_FORCE_ZAP=1" # comma separated variables
+ceph_osd_docker_devices:
+ - /dev/sdb
+rgw_containerized_deployment: true
+ceph_rgw_docker_username: hchen
+ceph_rgw_docker_imagename: rhceph
+ceph_rgw_civetweb_port: 80
+ceph_rgw_docker_extra_env: "RGW_CIVETWEB_PORT={{ ceph_rgw_civetweb_port }}" # comma separated variables
+rbd_client_directories: false
+ceph_stable_release: hammer
+
+
+
index 8e40aa963ab2eae0e1dbf61bd178b2dcb2233dc9..176bdf52bfa6a899269cf7b907b7ccc64eff88fe 100644 (file)
     ansible_os_family == 'RedHat' and
     ansible_pkg_mgr == "dnf"
 
+- name: install six
+  pip:
+    name: six
+    version: 1.9.0
+
 # NOTE (leseb): for version 1.1.0 because https://github.com/ansible/ansible-modules-core/issues/1227
 - name: install docker-py
   pip:
index 3dad4f710124577cf96502a12f2e8707f7663d7d..8bc4a84c741a71fe0f3190f48d9177e828e96bf2 100644 (file)
@@ -55,6 +55,7 @@
     image: "{{ ceph_mon_docker_username }}/{{ ceph_mon_docker_imagename }}"
     name: "{{ ansible_hostname }}"
     net: "host"
+    pid: "host"
     state: "running"
     privileged: "{{ mon_docker_privileged }}"
     env: "MON_IP={{ hostvars[inventory_hostname]['ansible_' + ceph_mon_docker_interface]['ipv4']['address'] }},CEPH_DAEMON=MON,CEPH_PUBLIC_NETWORK={{ ceph_mon_docker_subnet }},{{ ceph_mon_extra_envs }}"
index a19c0e220a09166a434a7c9d4bc626f2c95c5b42..7ce75e18ec8f34f191fcff79820c2d74c9d5ed77 100644 (file)
@@ -1,4 +1,10 @@
 ---
+# For openstack VMs modify the mount point below depending on if the Openstack
+# VM deploy tool defaults to mounting ephemeral disks
+- name: umount ceph disk (if on openstack)
+  shell: "umount /mnt"
+  when: ceph_docker_on_openstack
+  
 # (rootfs) for reasons I haven't figured out, docker pull and run will fail.
 - name: pull ceph daemon image
   shell: "docker pull {{ ceph_osd_docker_username }}/{{ ceph_osd_docker_imagename }}"
diff --git a/vagrant_variables.yml.openstack b/vagrant_variables.yml.openstack
new file mode 100644 (file)
index 0000000..64e4d25
--- /dev/null
@@ -0,0 +1,37 @@
+---
+
+# 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
+# Use whatever private subnet your Openstack VMs are given
+subnet: 172.17.72 
+
+# For Openstack VMs, the disk will depend on what you are allocated
+disks: "[ '/dev/vdb' ]"
+
+# For Openstack VMs, the lan is usually eth0
+eth: 'eth0'
+
+# For Openstack VMs, choose the following box instead
+vagrant_box: 'openstack'
+
+# For Atomic (RHEL or Cento) uncomment the line below
+skip_tags: 'with_pkg'
+
+# For deploying on OpenStack VMs uncomment these vars and assign values.  
+# You can use env vars for the values if it makes sense.
+#os_ssh_username : 
+#os_ssh_private_key_path : 
+#os_openstack_auth_url : 
+#os_username : 
+#os_password : 
+#os_tenant_name : 
+#os_region : 
+#os_flavor : 
+#os_image : 
+#os_keypair_name :