Re: Handling IP address change

2014-12-09 Thread Andrew Wilkins
On Tue, Dec 9, 2014 at 8:20 PM, Kapil Thangavelu <
kapil.thangav...@canonical.com> wrote:

>
>
> On Mon, Dec 8, 2014 at 9:53 PM, Andrew Wilkins <
> andrew.wilk...@canonical.com> wrote:
>
>> On Tue, Dec 9, 2014 at 10:31 AM, Stuart Bishop <
>> stuart.bis...@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.
>>
>>
>>>  - 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.
>>
>
> You mean private-address, which is normally set by juju, therefore charms
> are used to not managing it themselves, and it will thus be incorrect on
> address changes.
>
> per this bug https://bugs.launchpad.net/juju-core/+bug/1215579
>

Yes, that's what I meant. Thanks.
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: Handling IP address change

2014-12-09 Thread Kapil Thangavelu
On Mon, Dec 8, 2014 at 9:53 PM, Andrew Wilkins  wrote:

> On Tue, Dec 9, 2014 at 10:31 AM, Stuart Bishop <
> stuart.bis...@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.
>
>
>>  - 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.
>

You mean private-address, which is normally set by juju, therefore charms
are used to not managing it themselves, and it will thus be incorrect on
address changes.

per this bug https://bugs.launchpad.net/juju-core/+bug/1215579
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: Handling IP address change

2014-12-09 Thread Stuart Bishop
On 9 December 2014 at 15:58, John Meinel  wrote:
> If you get config-changed can you use that to update your host field causing
> relation-changed where you need it?

Yes, that isn't a problem.


>> >> 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).

I only mentioned this since triggering the relation-changed hooks
could avoid the need to update the charm entirely in some cases. I
doubt it is worth it though.


-- 
Stuart Bishop 

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: Handling IP address change

2014-12-09 Thread John Meinel
If you get config-changed can you use that to update your host field
causing relation-changed where you need it?

John
=:->
On Dec 9, 2014 7:02 AM, "Stuart Bishop"  wrote:

> On 9 December 2014 at 09:53, Andrew Wilkins
>  wrote:
> > On Tue, Dec 9, 2014 at 10:31 AM, Stuart Bishop <
> stuart.bis...@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 
>
> --
> Juju mailing list
> Juju@lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: Handling IP address change

2014-12-08 Thread Stuart Bishop
On 9 December 2014 at 09:53, Andrew Wilkins
 wrote:
> On Tue, Dec 9, 2014 at 10:31 AM, Stuart Bishop 
> 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 

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: Handling IP address change

2014-12-08 Thread Andrew Wilkins
On Tue, Dec 9, 2014 at 10:31 AM, Stuart Bishop 
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.


>  - 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).
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: Handling IP address change

2014-12-08 Thread José Antonio Rey
Stuart,

Could you please clarify in which moment would you expect an IP change?
With that info I could try and provide you solutions for IP changes.

On 12/08/2014 09:31 PM, Stuart Bishop wrote:
> Hi.
> 
> Does juju handle IP address changes of units yet? If so, what hooks
> can I expect to be invoked?
> 
>  - config-changed?
>  - relation-changed on every relation, changed unit side?
>  - relation-changed on every relation, related unit side?
> 
> 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).
> 

-- 
José Antonio Rey

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju