Juju Actions - Use Cases

Michael Nelson michael.nelson at canonical.com
Wed Sep 10 22:33:10 UTC 2014


On Thu, Sep 11, 2014 at 3:41 AM, Aaron Bentley
<aaron.bentley at canonical.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 14-09-10 01:29 PM, Charles Butler wrote:
>> There's nothing that says the hook cannot call config to make it
>> reproduce-able
>
> But if it's a config variable, then config-changed needs to be able to
> handle changes to it.  If config-changed can handle it, then you don't
> need an action.

True that you don't need it, but it still may have a benefit. We have
a config variable, build_label, which when set to r255 it will (1)
download r255/my-tarball.tgz from a swift container, (2) extract it in
right directory, (3) set the perms correctly, and then (4) finally
switches the symlink and restarts.

But we've also got a "preload" action that Simon recently added, which
enables our charms to do 1, 2 and 3 on all the units, so that when the
config is changed to build_label=r255, any unit which was already
preloaded will just switch the symlink and restart. So it's
reproducible (ie. will still work fine if you preload, then add 2
units, then set the build_label), but is a little faster and more
importantly, allows us to reduce what's happening at the actual
rollout time to symlink+restart.

-Michael

>
> Aaron
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1
>
> iQEcBAEBAgAGBQJUEI0+AAoJEK84cMOcf+9hVIsH/0sFpC4hpnTEFMBfi20tMqaI
> JUgvhIUIczzb3tq8wYWhzJ4ivmiSWZPCP1VBrfjSOPIu01KjqHlnp64AGLP0xuXD
> tchUws3xhQxNkh8kP68aUMUUa2SWNwlPsb5HIvYmzztHvcd7nZ0oY51tU3K4vmNa
> US36fxbt9brNeNyf9rma8o0ftXsuuZ+6zVzVW03nmTxTikgInvr0jC5QegL+LKY+
> HxDbpAvplha/RNgGXq2aRq0QMsmD7ea57n323ayQRs3dKqTCxxQ94dvGmLzYwEUG
> Ff2fhQoqO23EQNcYR643Ndi53AdyiHsWRgMxIoWeA+qSKkBjjBheeGUKStiDdEg=
> =8TV7
> -----END PGP SIGNATURE-----
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev



More information about the Juju-dev mailing list