juju / docs

Juju documentation, edited on https://discourse.charmhub.io/, and published on https://juju.is/docs
https://juju.is/docs
23 stars 103 forks source link

Add example of using variables in bundle #1715

Closed frankban closed 5 years ago

frankban commented 7 years ago

Moved from https://github.com/CanonicalLtd/jujucharms.com/issues/433

It would be nice if there was an example of using variables in a bundle file. See for example: https://launchpadlibrarian.net/298175262/bundle.yaml

frankban commented 7 years ago

Note that native bundles don't support variables.

evilnick commented 7 years ago

There doesn't seem to much point in documenting variables in a bundle if Juju cannot use them? Or am I missing something?

pmatulis commented 7 years ago

@evilnick @frankban Does this issue apply to both 1.25 and 2.x? Shall we just provide a link to the example bundle file? If not, can we close this?

evilnick commented 7 years ago

@pmatulis There really isn't any point asking me - I know as much as you do :)

anastasiamac commented 7 years ago

I do not believe that variables as used in juju-deployer are currently supported natively in Juju. I have opened https://bugs.launchpad.net/juju/+bug/1731387. Until the functionality provided, I am not sure how you could document an example usage :D

howbazaar commented 7 years ago

Hey peeps,

Yes native bundles do support variables, and yes we should come up wwith a good example.

anastasiamac commented 7 years ago

This PR adds support for Juju 2.3 going forward - https://github.com/juju/juju/pull/8050.... The example that we are using in this code can be found at https://github.com/juju/juju/pull/8050/files#diff-6b0599fde45dfeaf14e4cb306fc9112dR1924 Feel free to define a different example for online documentation.

howbazaar commented 7 years ago

Well, it adds support for using the YAML anchors in the bundle-config files, which it didn't support prior.

The CPE and STS teams have been using YAML anchors for their bundles for quite a while.

pmatulis commented 6 years ago

@anastasiamac IIUC, variables have been possible for a long time in bundle definition files via YAML anchors but your cited PR now allows the same in the newer bundle config files. I will need an example of each that I can put into the documentation. FWIW, I do not know what a YAML anchor is. Also, your link to the Juju codebase does not help me.

pmatulis commented 5 years ago

Add example of using variables in bundle

pmatulis commented 5 years ago

This has been fixed on the Charm bundles page and on the Bundle reference page.