Fix multiple things

* fix the Vagrantfile ruby check
* fix the variable positions

Bring more mandatory variables and try to separate Vagrant vars from the
playbook vars.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
pull/262/head
Sébastien Han 2015-05-15 14:32:26 +02:00
parent 61eebb526a
commit 8dc1554788
5 changed files with 41 additions and 12 deletions

21
Vagrantfile vendored
View File

@ -30,23 +30,35 @@ ansible_provision = proc do |ansible|
}
# In a production deployment, these should be secret
if NMDSS != '0' && NRGWS != '0'
if NMDSS != 0 && NRGWS != 0
ansible.extra_vars = {
fsid: '4a158d27-f750-41d5-9e7f-26ce4c9d2d45',
monitor_secret: 'AQAWqilTCDh7CBAAawXt6kyTgLFCxSvJhTEmuw==',
journal_size: 100,
monitor_interface: 'eth1',
cluster_network: "#{SUBNET}.0/24",
public_network: "#{SUBNET}.0/24",
radosgw: 'true',
mds: 'true',
}
elsif NMDSS != '0'
elsif NMDSS != 0
ansible.extra_vars = {
fsid: '4a158d27-f750-41d5-9e7f-26ce4c9d2d45',
monitor_secret: 'AQAWqilTCDh7CBAAawXt6kyTgLFCxSvJhTEmuw==',
journal_size: 100,
monitor_interface: 'eth1',
cluster_network: "#{SUBNET}.0/24",
public_network: "#{SUBNET}.0/24",
mds: 'true',
}
elsif NRGWS != '0'
elsif NRGWS != 0
ansible.extra_vars = {
fsid: '4a158d27-f750-41d5-9e7f-26ce4c9d2d45',
monitor_secret: 'AQAWqilTCDh7CBAAawXt6kyTgLFCxSvJhTEmuw==',
journal_size: 100,
monitor_interface: 'eth1',
cluster_network: "#{SUBNET}.0/24",
public_network: "#{SUBNET}.0/24",
radosgw: 'true',
}
else
@ -54,6 +66,9 @@ ansible_provision = proc do |ansible|
fsid: '4a158d27-f750-41d5-9e7f-26ce4c9d2d45',
monitor_secret: 'AQAWqilTCDh7CBAAawXt6kyTgLFCxSvJhTEmuw==',
journal_size: 100,
monitor_interface: 'eth1',
cluster_network: "#{SUBNET}.0/24",
public_network: "#{SUBNET}.0/24",
}
end
ansible.limit = 'all'

View File

@ -61,7 +61,7 @@ dummy:
## Monitor options
#
#monitor_interface: eth1
#monitor_interface: interface
#mon_osd_down_out_interval: 600
#mon_osd_min_down_reporters: 7 # number of OSDs per host + 1
#mon_clock_drift_allowed: .15
@ -77,8 +77,8 @@ dummy:
#pool_default_pgp_num: 128
#pool_default_size: 2
#pool_default_min_size: 1
#cluster_network: 192.168.42.0/24
#public_network: 192.168.42.0/24
#cluster_network: 0.0.0.0/0
#public_network: 0.0.0.0/0
#osd_mkfs_type: xfs
#osd_mkfs_options_xfs: -f -i size=2048
#osd_mount_options_xfs: noatime

View File

@ -72,7 +72,7 @@ debug_mds_level: 20
## Monitor options
#
monitor_interface: eth1
monitor_interface: interface
mon_osd_down_out_interval: 600
mon_osd_min_down_reporters: 7 # number of OSDs per host + 1
mon_clock_drift_allowed: .15
@ -88,8 +88,8 @@ pool_default_pg_num: 128
pool_default_pgp_num: 128
pool_default_size: 2
pool_default_min_size: 1
cluster_network: 192.168.42.0/24
public_network: 192.168.42.0/24
cluster_network: 0.0.0.0/0
public_network: 0.0.0.0/0
osd_mkfs_type: xfs
osd_mkfs_options_xfs: -f -i size=2048
osd_mount_options_xfs: noatime,largeio,inode64,swalloc

View File

@ -0,0 +1,16 @@
---
- name: Make sure journal_size configured
fail: msg="journal_size must be configured. See http://ceph.com/docs/master/rados/configuration/osd-config-ref/"
when: journal_size|int == 0
- name: Make sure monitor_interface configured
fail: msg="monitor_interface must be configured. Interface for the monitor to listen on"
when: monitor_interface == 'interface'
- name: Make sure cluster_network configured
fail: msg="cluster_network must be configured. Ceph replication network"
when: cluster_network == '0.0.0.0/0'
- name: Make sure public_network configured
fail: msg="public_network must be configured. Ceph public network"
when: public_network == '0.0.0.0/0'

View File

@ -35,9 +35,7 @@
register: cluster_uuid
changed_when: False
- name: Make sure journal_size configured
fail: msg="journal_size must be configured. See http://ceph.com/docs/master/rados/configuration/osd-config-ref/"
when: journal_size|int == 0
- include: check-mandatory-vars.yml
- name: Generate Ceph configuration file
template: >