Implement "dns-backend" binding

This patchset implements "dns-backend" binding which is required to
properly handle DNS zone transfers between designate and
desigante-bind applications. If "dns-backend" binding is provided
when deploying designate and designate-bind applications, DNZ zone
transfers will now take place over the subnet which belongs to the
provided space.

Change-Id: I927e3958cf929ace9d43f8b3d9509b90b9eab60f
Partial-Bug: #1722794
This commit is contained in:
Tytus Kurek 2017-10-12 20:24:52 +02:00
parent d794839e71
commit 086a3a7b25
2 changed files with 7 additions and 0 deletions

View File

@ -20,6 +20,7 @@ from charms.reactive import scopes
from charms.reactive.bus import get_states
from charmhelpers.core import hookenv
from charmhelpers.contrib.network import ip as ch_ip
class BindRNDCProvides(RelationBase):
@ -29,6 +30,8 @@ class BindRNDCProvides(RelationBase):
def joined(self):
conv = self.conversation()
conv.set_state('{relation_name}.related')
conv.set_remote('private-address',
ch_ip.get_relation_ip(conv.relation_name))
hookenv.log('States: {}'.format(get_states().keys()))
@hook('{provides:bind-rndc}-relation-departed')

View File

@ -18,6 +18,8 @@ from charms.reactive import RelationBase
from charms.reactive import hook
from charms.reactive import scopes
from charmhelpers.contrib.network import ip as ch_ip
class BindRNDCRequires(RelationBase):
scope = scopes.UNIT
@ -29,6 +31,8 @@ class BindRNDCRequires(RelationBase):
def joined(self):
conv = self.conversation()
conv.set_state('{relation_name}.connected')
conv.set_remote('private-address',
ch_ip.get_relation_ip(conv.relation_name))
@hook('{requires:bind-rndc}-relation-changed')
def changed(self):