Many private clouds have no direct access to the internet due to security reasons.
In these cases it's useful to maintain a copy of the internet-accessible Charm Store for your local deployments.
In addition to Juju we need to install charm-tools:
sudo apt-get update && sudo apt-get install charm-tools
The Charm Tools comes packaged as both a stand alone tool and a juju plugin.
So you simply can call it with
charm or as usual for Juju commands with
There are several tools available within the Charm Tools itself. At any time
you can run
juju charm to view the available subcommands and all subcommands
have independent help pages, accessible using either the
If you want to retrieve and branch one of the charm store charms, use the
command specifying the
CHARM_NAME you want to copy and provide an optional
CHARMS_DIRECTORY. Otherwise the current directory will be used.
juju charm get [-h|--help] CHARM_NAME [CHARMS_DIRECTORY]
juju charm get mysql
will download the MySQL charm to a
mysql directory within your current path.
juju charm get wordpress ~/charms/precise/
You will download the WordPress charm to
~/charms/precise/wordpress. It is
also possible to fetch all official charm store charms. The command for this
juju charm getall [-h|--help] [CHARMS_DIRECTORY]
The retrieved charms will be placed in the
CHARMS_DIRECTORY, or your current
directory if no
CHARMS_DIRECTORY is provided. This command can take quite a
while to complete - there are a lot of charms!
There are many cases when you may wish to deploy charms from a local filesystem source rather than the charm store:
- When testing charms you have written.
- When you have modified store charms for some reason.
- When you don't have direct internet access.
... and probably a lot more times which you can imagine yourselves.
Juju can be pointed at a local directory to source charms from using the
--repository=<path/to/files> switch like this:
juju deploy --repository=/usr/share/charms/ local:trusty/vsftpd
--repository switch can be omitted when shell environment
JUJU_REPOSITORY like so:
export JUJU_REPOSITORY=/usr/share/charms/ juju deploy local:trusty/vsftpd
You can also make use of standard filesystem shortcuts, if the environment
default-series. The following examples will deploy the trusty
charms in the local repository when
default-series is set to trusty:
juju deploy --repository=. local:haproxy juju deploy --repository ~/charms/ local:wordpress
default-series can be specified in
The default-series can also be added to any bootstrapped environment with
juju set-env "default-series=trusty"