def configure_designate_full(*args):
"""Write out all designate config include bootstrap domain info"""
# If cluster relation is available it needs to passed in
cluster = reactive.RelationBase.from_state('cluster.available')
if cluster is not None:
args = args + (cluster, )
dns_backend = reactive.RelationBase.from_state('dns-backend.available')
if dns_backend is not None:
args = args + (dns_backend, )
with provide_charm_instance() as instance:
instance.upgrade_if_available(args)
instance.configure_ssl()
instance.render_full_config(args)
try:
# the following function should only run once for the leader.
instance.create_initial_servers_and_domains()
_render_sink_configs(instance, args)
instance.render_rndc_keys()
instance.update_pools()
except subprocess.CalledProcessError as e:
hookenv.log("ensure_api_responding() errored out: {}"
.format(str(e)),
level=hookenv.ERROR)
评论列表
文章目录