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.
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.