Is it possible to set Juju to allow an unsigned private deb repo?

I am trying to automate setting up a local APT repo on one of my MAAS/Juju nodes (via a custom charm), and install custom Openstack packages onto my intended Openstack nodes from there. I reviewed this,

How do I add a public key for a private debian repo when using juju to deploy a service?

But I don't need the repo to be signed.

  • Are you deploying the openstack packages from your charm? – Bilal Baqar Oct 14 '16 at 20:33

Use the following code if a debian repository needs to be added.

You will need to import the charmhelpers python library into your charm. If the charmhelpers directory is under the hooks/ directory add the following code to your install hook.

from charmhelpers.fetch import configure_sources 

You will also be required to add two configs into your config.yaml

  default: 'ppa:<custom-ppa>/stable'
  type: string
  description: Provide the install source URL.
  default: null
  type: string
  description: Provide the respective keys of the install sources.

You can pass configs as follows in your config.yaml:

  install_sources: "deb https://stub:key@private.example.com/ubuntu trusty main"

Deploy add the --config flag when deploying the charm:

juju deploy --config config.yaml charm-name

The install_sources value can be a URL or sources.list entry, as supported by: add-apt-repository. Examples:

  • "ppa:charmers/example"
  • "deb https://stub:key@private.example.com/ubuntu trusty main"
  • 'proposed:' may be used to enable the standard 'proposed' pocket for the release.
  • 'cloud:' may be used to activate official cloud archive pockets, such as 'cloud:icehouse'
  • 'distro' may be used as a noop

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.