make mandatory variable checks only apply when needed

In our use case we might only be configuring mons and not osds in the
same call, so we don't want to check variables needed for osds when they
are not needed to configure a mon.

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
pull/548/head
Andrew Schoen 2016-02-15 15:29:06 -06:00
parent beb966421e
commit bcf34d539f
1 changed files with 12 additions and 4 deletions

View File

@ -33,22 +33,30 @@
- name: make sure journal_size configured - name: make sure journal_size configured
fail: fail:
msg: "journal_size must be configured. See http://ceph.com/docs/master/rados/configuration/osd-config-ref/" msg: "journal_size must be configured. See http://ceph.com/docs/master/rados/configuration/osd-config-ref/"
when: journal_size|int == 0 when:
journal_size|int == 0 and
osd_group_name in group_names
- name: make sure monitor_interface configured - name: make sure monitor_interface configured
fail: fail:
msg: "monitor_interface must be configured. Interface for the monitor to listen on" msg: "monitor_interface must be configured. Interface for the monitor to listen on"
when: monitor_interface == 'interface' when:
monitor_interface == 'interface' and
mon_group_name in group_names
- name: make sure cluster_network configured - name: make sure cluster_network configured
fail: fail:
msg: "cluster_network must be configured. Ceph replication network" msg: "cluster_network must be configured. Ceph replication network"
when: cluster_network == '0.0.0.0/0' when:
cluster_network == '0.0.0.0/0' and
osd_group_name in group_names
- name: make sure public_network configured - name: make sure public_network configured
fail: fail:
msg: "public_network must be configured. Ceph public network" msg: "public_network must be configured. Ceph public network"
when: public_network == '0.0.0.0/0' when:
public_network == '0.0.0.0/0' and
osd_group_name in group_names
- name: make sure an osd scenario was chosen - name: make sure an osd scenario was chosen
fail: fail: