I'm writing a Juju Charm that has a config file template where some values have to be filled in depending on the configuration. Is there a better way to do this than just using sed?



I use simple string replacement in my Ghost charm. You could do something similar with Python if you didn't want to install any additional languages.

utils.js: https://github.com/hatched/ghost-charm/blob/master/utils/utils.js

config.js.template https://github.com/hatched/ghost-charm/blob/master/assets/config.js.template

  • Thanks! I also found out about saltstack, I might use that to write install hooks in the future. – Merlijn Sebrechts Mar 12 '15 at 11:14

Juju has support for saltstack.

Saltstack is a config management tool that makes writing install hooks a lot easier. You can also use the saltstack template functionality to make config files.

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.