Handling IP address change

Stuart Bishop stuart.bishop at canonical.com
Tue Dec 9 03:02:26 UTC 2014


On 9 December 2014 at 09:53, Andrew Wilkins
<andrew.wilkins at canonical.com> wrote:
> On Tue, Dec 9, 2014 at 10:31 AM, Stuart Bishop <stuart.bishop at canonical.com>
> wrote:
>>
>> Hi.
>>
>> Does juju handle IP address changes of units yet? If so, what hooks
>> can I expect to be invoked?
>
>
> From 1.21 onwards, config-changed will be fired whenever the unit's
> addresses change.

Great!

>>  - config-changed?
>>  - relation-changed on every relation, changed unit side?
>>  - relation-changed on every relation, related unit side?
>
>
> Relation hooks will not fire (yet?).
> For now, public-address will not be updated in the relation settings
> automatically. There is a bug open for this.

>> I need to keep the 'host' attribute on my database relations in sync
>> with the actual IP address (or in future, the IP address of one of the
>> related proxies).

If only the public-address attribute is changed, triggering the
relation-changed hooks on any client unit, then a number of charms
will still need to be updated (like postgresql & mysql, which mirror
the public address in the 'host' attribute). If the relation-changed
hooks on both ends where triggered, then some of these would not need
to be updated (at the cost of a larger hook storm).

-- 
Stuart Bishop <stuart.bishop at canonical.com>



More information about the Juju mailing list