0

Im wondering if its possible with chef (or any other tool like puppet or ansible ...) to create cookbooks from current server configurations.

For example i have a red hat server with an jboss 7 running on it. Would it be possible to read that server configuration (users, groups, installed services) and the jboss configuration and create a cookbook from this configuration for further use and deployments of new server?

if its not possible with chef, does a 3rd party tool exists which can handle such a task?

thanks.

1 Answer 1

0

If you remember what you did to configure stuff, you can write a cookbook.

You can copy your configs, but be aware, that this is overkill for a good cookbook. In an installation you want to change as little as possible, dumping the whole state of a configuration adds much stuff you did not change. This is bad, when a newer version comes with a newer config and you copy the old config (with old default values) instead of just adding your keys.

I do not think there is a fully automated way.

3
  • +1 I essentially keep track of configuration changes and history, convert it to ansible playbooks and then test it again, not as familiar with chef but in ansible you make a role based on your jboss config, and set variables in the playbook Commented Feb 7, 2016 at 23:23
  • I use ansible and try to use things like "lineinfile", which trys to preserve as much as possible. Or the regex module to replace a commented out line by a activated (and maybe changed) line. Good thing is, that your ansible file keeps track what you changed, not only comments like ## my changes below Commented Feb 8, 2016 at 0:18
  • I use jinja templates and always replace the configuration files. Commented Feb 8, 2016 at 0:20

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.