5

Is it possible to auto-generate Puppet manifests from an existing system?

For example, if we need to deploy a site to a pre-configured VPS or shared server, is there a tool which could query a server then generate puppet manifests to mirror what it found? (distro, app versions, etc)

joemaller
  • 19,579
  • 7
  • 67
  • 84

1 Answers1

4

You can use puppet resource [type] for that, but be selective. You don't want a huge manifest, just manage what is important.

To get a list of installed packages:

puppet resource package

Get a specific package with version:

puppet resource package httpd

Files:

puppet resource file /etc/httpd/conf.d/example.conf
Ger Apeldoorn
  • 1,232
  • 8
  • 13
  • 1
    for anyone else new to Puppet, 'pacakage' is a type, not a placeholder. Here's the list of Puppet resource types: http://docs.puppetlabs.com/references/latest/type.html – joemaller Jun 12 '13 at 14:04
  • Is it possible to do the same thing with say, apache2? Can it get all the vhosts and apache mods along with it? – saada Oct 30 '13 at 15:51