Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
1  
And your question is? –  OrangeTux Jan 23 at 13:13
    
Please make your question clearer, but I hope my answer is OK... –  Wilf Jan 23 at 16:38

1 Answer 1

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 at 8:03

Your Answer

 
discard

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.