Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Our application requires each node in a cluster has the same pair of SSH keys. We provide the default one in the charm but it'd better to generate new one before deploy. THE SAME KEYS WILL BE COPIED TO ALL NODES' ./ssh/ directory. For local charm that's is no problem but handle this when user deploy from charm store. I know put the keys to config.yaml and let user deploy with --config option will do it but probably is not preferred way.

share|improve this question
And your question is? – OrangeTux Jan 23 '14 at 13:13
Please make your question clearer, but I hope my answer is OK... – Wilf Jan 23 '14 at 16:38

Would it be possible to have the install hook generate some new keys if the charm config value that store the keys are not set?

That way the first unit of the service that gets deployed runs the install hook, notices that the config value is empty, generates new keys, and stores the key in the charm config.

The second unit that is deployed during the install hook looks at the charm config and get the key info that the first unit created.

share|improve this answer
I don't think it would -- units can't write to service config themselves, and nor can they use peer relations (which would be the obvious way forward) until they've joined them, after the start hook. – fwereade Jan 28 '14 at 8:03

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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