mirror of https://github.com/ceph/ceph-ansible.git
commit
32bf2313d0
|
@ -5,7 +5,9 @@ VAGRANTFILE_API_VERSION = '2'
|
||||||
|
|
||||||
NMONS = 3
|
NMONS = 3
|
||||||
NOSDS = 3
|
NOSDS = 3
|
||||||
|
NMDSS = 0
|
||||||
NRGWS = 0
|
NRGWS = 0
|
||||||
|
SUBNET = '192.168.42'
|
||||||
|
|
||||||
ansible_provision = proc do |ansible|
|
ansible_provision = proc do |ansible|
|
||||||
ansible.playbook = 'site.yml'
|
ansible.playbook = 'site.yml'
|
||||||
|
@ -15,8 +17,8 @@ ansible_provision = proc do |ansible|
|
||||||
ansible.groups = {
|
ansible.groups = {
|
||||||
'mons' => (0..NMONS - 1).map { |j| "mon#{j}" },
|
'mons' => (0..NMONS - 1).map { |j| "mon#{j}" },
|
||||||
'osds' => (0..NOSDS - 1).map { |j| "osd#{j}" },
|
'osds' => (0..NOSDS - 1).map { |j| "osd#{j}" },
|
||||||
'mdss' => [],
|
'mdss' => (0..NMDSS - 1).map { |j| "mds#{j}" },
|
||||||
'rgws' => ['rgw']
|
'rgws' => (0..NRGWS - 1).map { |j| "rgw#{j}" }
|
||||||
}
|
}
|
||||||
|
|
||||||
# In a production deployment, these should be secret
|
# In a production deployment, these should be secret
|
||||||
|
@ -30,16 +32,30 @@ end
|
||||||
def create_vmdk(name, size)
|
def create_vmdk(name, size)
|
||||||
dir = Pathname.new(__FILE__).expand_path.dirname
|
dir = Pathname.new(__FILE__).expand_path.dirname
|
||||||
path = File.join(dir, '.vagrant', name + '.vmdk')
|
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)
|
`vmware-vdiskmanager -c -s #{size} -t 0 -a scsi #{path} \
|
||||||
|
2>&1 > /dev/null` unless File.exist?(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
config.vm.box = 'hashicorp/precise64'
|
config.vm.box = 'hashicorp/precise64'
|
||||||
|
|
||||||
(0..NRGWS - 1).each do |i|
|
(0..NRGWS - 1).each do |i|
|
||||||
config.vm.define :rgw do |rgw|
|
config.vm.define "rgw#{i}" do |rgw|
|
||||||
rgw.vm.network :private_network, ip: '192.168.42.2'
|
rgw.vm.hostname = "ceph-rgw#{i}"
|
||||||
rgw.vm.host_name = 'ceph-rgw'
|
rgw.vm.network :private_network, ip: "#{SUBNET}.4#{i}"
|
||||||
|
rgw.vm.provider :virtualbox do |vb|
|
||||||
|
vb.customize ['modifyvm', :id, '--memory', '192']
|
||||||
|
end
|
||||||
|
rgw.vm.provider :vmware_fusion do |v|
|
||||||
|
v.vmx['memsize'] = '192'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
(0..NMDSS - 1).each do |i|
|
||||||
|
config.vm.define "mds#{i}" do |rgw|
|
||||||
|
rgw.vm.hostname = "ceph-mds#{i}"
|
||||||
|
rgw.vm.network :private_network, ip: "#{SUBNET}.7#{i}"
|
||||||
rgw.vm.provider :virtualbox do |vb|
|
rgw.vm.provider :virtualbox do |vb|
|
||||||
vb.customize ['modifyvm', :id, '--memory', '192']
|
vb.customize ['modifyvm', :id, '--memory', '192']
|
||||||
end
|
end
|
||||||
|
@ -52,7 +68,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
(0..NMONS - 1).each do |i|
|
(0..NMONS - 1).each do |i|
|
||||||
config.vm.define "mon#{i}" do |mon|
|
config.vm.define "mon#{i}" do |mon|
|
||||||
mon.vm.hostname = "ceph-mon#{i}"
|
mon.vm.hostname = "ceph-mon#{i}"
|
||||||
mon.vm.network :private_network, ip: "192.168.42.1#{i}"
|
mon.vm.network :private_network, ip: "#{SUBNET}.1#{i}"
|
||||||
mon.vm.provider :virtualbox do |vb|
|
mon.vm.provider :virtualbox do |vb|
|
||||||
vb.customize ['modifyvm', :id, '--memory', '192']
|
vb.customize ['modifyvm', :id, '--memory', '192']
|
||||||
end
|
end
|
||||||
|
@ -65,19 +81,27 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
|
||||||
(0..NOSDS - 1).each do |i|
|
(0..NOSDS - 1).each do |i|
|
||||||
config.vm.define "osd#{i}" do |osd|
|
config.vm.define "osd#{i}" do |osd|
|
||||||
osd.vm.hostname = "ceph-osd#{i}"
|
osd.vm.hostname = "ceph-osd#{i}"
|
||||||
osd.vm.network :private_network, ip: "192.168.42.10#{i}"
|
osd.vm.network :private_network, ip: "#{SUBNET}.10#{i}"
|
||||||
osd.vm.network :private_network, ip: "192.168.42.20#{i}"
|
osd.vm.network :private_network, ip: "#{SUBNET}.20#{i}"
|
||||||
osd.vm.provider :virtualbox do |vb|
|
osd.vm.provider :virtualbox do |vb|
|
||||||
(0..1).each do |d|
|
(0..1).each do |d|
|
||||||
vb.customize ['createhd', '--filename', "disk-#{i}-#{d}", '--size', '11000']
|
vb.customize ['createhd',
|
||||||
vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 3 + d, '--device', 0, '--type', 'hdd', '--medium', "disk-#{i}-#{d}.vdi"]
|
'--filename', "disk-#{i}-#{d}",
|
||||||
|
'--size', '11000']
|
||||||
|
vb.customize ['storageattach', :id,
|
||||||
|
'--storagectl', 'SATA Controller',
|
||||||
|
'--port', 3 + d,
|
||||||
|
'--device', 0,
|
||||||
|
'--type', 'hdd',
|
||||||
|
'--medium', "disk-#{i}-#{d}.vdi"]
|
||||||
end
|
end
|
||||||
vb.customize ['modifyvm', :id, '--memory', '192']
|
vb.customize ['modifyvm', :id, '--memory', '192']
|
||||||
end
|
end
|
||||||
osd.vm.provider :vmware_fusion do |v|
|
osd.vm.provider :vmware_fusion do |v|
|
||||||
(0..1).each do |d|
|
(0..1).each do |d|
|
||||||
v.vmx["scsi0:#{d + 1}.present"] = 'TRUE'
|
v.vmx["scsi0:#{d + 1}.present"] = 'TRUE'
|
||||||
v.vmx["scsi0:#{d + 1}.fileName"] = create_vmdk("disk-#{i}-#{d}", '11000MB')
|
v.vmx["scsi0:#{d + 1}.fileName"] =
|
||||||
|
create_vmdk("disk-#{i}-#{d}", '11000MB')
|
||||||
end
|
end
|
||||||
v.vmx['memsize'] = '192'
|
v.vmx['memsize'] = '192'
|
||||||
end
|
end
|
||||||
|
|
|
@ -16,7 +16,7 @@ dummy:
|
||||||
|
|
||||||
## Monitor options
|
## Monitor options
|
||||||
#
|
#
|
||||||
#monitor_interface: eth1
|
monitor_interface: eth1
|
||||||
#mon_osd_down_out_interval: 600
|
#mon_osd_down_out_interval: 600
|
||||||
#mon_osd_min_down_reporters: 7 # number of OSDs per host + 1
|
#mon_osd_min_down_reporters: 7 # number of OSDs per host + 1
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,9 @@
|
||||||
|
|
||||||
# Wait for mon discovery and quorum resolution
|
# Wait for mon discovery and quorum resolution
|
||||||
# the admin key is not instantanely created so we have to wait a bit
|
# the admin key is not instantanely created so we have to wait a bit
|
||||||
- name: If client.admin key exists
|
|
||||||
command: stat /etc/ceph/ceph.client.admin.keyring
|
- name: wait for client.admin key exists
|
||||||
register: result
|
wait_for: path=/etc/ceph/ceph.client.admin.keyring
|
||||||
until: result.rc == 0
|
|
||||||
changed_when: False
|
|
||||||
|
|
||||||
- name: Create RGW keyring
|
- name: Create RGW keyring
|
||||||
command: ceph auth get-or-create client.radosgw.gateway osd 'allow rwx' mon 'allow rw' -o /etc/ceph/keyring.radosgw.gateway creates=/etc/ceph/keyring.radosgw.gateway
|
command: ceph auth get-or-create client.radosgw.gateway osd 'allow rwx' mon 'allow rw' -o /etc/ceph/keyring.radosgw.gateway creates=/etc/ceph/keyring.radosgw.gateway
|
||||||
|
|
Loading…
Reference in New Issue