def cluster_config(self):
"""
Provide the default configuration for a cluster
"""
if self.cluster:
cluster_dir = "{}/config/stack/default/{}".format(self.root_dir, self.cluster)
if not os.path.isdir(cluster_dir):
_create_dirs(cluster_dir, self.root_dir)
filename = "{}/cluster.yml".format(cluster_dir)
contents = {}
contents['fsid'] = str(uuid.uuid3(uuid.NAMESPACE_DNS, os.urandom(32)))
public_networks_str = ", ".join([str(n) for n in self.public_networks])
cluster_networks_str = ", ".join([str(n) for n in self.cluster_networks])
contents['public_network'] = public_networks_str
contents['cluster_network'] = cluster_networks_str
contents['available_roles'] = self.available_roles
self.writer.write(filename, contents)
评论列表
文章目录