Juju configuration in bash
Marco Ceppi
marco.ceppi at canonical.com
Sat Oct 3 00:00:57 UTC 2015
Sorry, I should have also included this:
https://jujucharms.com/docs/stable/authors-charm-writing which is a link to
our getting started docs for charm authorship. There are a lot of great
resources in the Charm Authors section of the doc that may help you further
your charm creation!
Marco
On Fri, Oct 2, 2015 at 7:59 PM Marco Ceppi <marco.ceppi at canonical.com>
wrote:
> Hello!
>
> Yes, you certainly can. In fact, the charmhelpers python library is just a
> shim to make writing charms in python easier. In bash you'll want to do
> something like the following:
>
> option=$(config-get option)
>
> This is, essentially what the charmhelpers library is doing under the
> covers. There's a WIDE range of these hook tools you can use in your hooks,
> for an exhaustive list run
>
> juju help-tool
>
> And to learn more how to use a tool, run
>
> juju help-tool config-get
>
> Thanks!
>
> Marco Ceppi
>
> On Fri, Oct 2, 2015 at 7:33 PM Frederico Araujo <araujof at gmail.com> wrote:
>
>> Hi list,
>>
>> Is there a way to get the configuration options from config.yaml from a
>> hook written in Bash (e.g., environment variable)? I noticed that in Python
>> we can import from the charmshelper API like this:
>>
>> 1. from charmhelpers.core.hookenv import (
>> 2. config as config_get,
>> 3. ...
>>
>>
>> And then use config_get['option'] to retrieve the option value.
>>
>> Thanks,
>>
>> Fred
>>
>>
>> --
>> Juju mailing list
>> Juju at lists.ubuntu.com
>> Modify settings or unsubscribe at:
>> https://lists.ubuntu.com/mailman/listinfo/juju
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20151003/a64e1b46/attachment.html>
More information about the Juju
mailing list