Signed-off-by: Andrew Schoen <aschoen@redhat.com>
# boxes we test with use that interface
address = Interface("eth1").addresses[0]
subnet = ".".join(ansible_vars["public_network"].split(".")[0:-1])
+ num_mons = len(ansible_vars["groups"]["mons"])
+ cluster_name = ansible_vars.get("cluster", "ceph")
+ conf_path = "/etc/ceph/{}.conf".format(cluster_name)
data = dict(
address=address,
subnet=subnet,
vars=ansible_vars,
osd_ids=osd_ids,
+ num_mons=num_mons,
)
return data
assert File("/etc/ceph/ceph.conf").contains("^mon host = .*$")
def test_mon_host_line_has_correct_value(self, node, File):
- num_mons = len(node["vars"]["groups"]["mons"])
mon_ips = []
- for x in range(0, num_mons):
+ for x in range(0, node["num_mons"]):
mon_ips.append("{}.1{}".format(node["subnet"], x))
line = "mon host = {}".format(",".join(mon_ips))
assert File("/etc/ceph/ceph.conf").contains(line)