From 086a3a7b2576d02d580532859b6d410642a0e8e2 Mon Sep 17 00:00:00 2001 From: Tytus Kurek Date: Thu, 12 Oct 2017 20:24:52 +0200 Subject: [PATCH] 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 --- provides.py | 3 +++ requires.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/provides.py b/provides.py index 1f79905..ca30045 100644 --- a/provides.py +++ b/provides.py @@ -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') diff --git a/requires.py b/requires.py index f168a1d..27f2e17 100644 --- a/requires.py +++ b/requires.py @@ -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):