title: A way to use puppet module (postgres example)
body: <p>I'm using vagrant to build a virtual environment. I have some question about provisioning with puppet. I understood that I can create modules on my own or to use existing modules (for example puppet forge ones). To use existing modules i follow this approach:
  In Vagrant file I install modules I need</p>
  
  <pre><code>config.vm.provision :shell do |shell|
        shell.inline = "mkdir -p /etc/puppet/modules;
                        puppet module install puppetlabs-postgresql"
  </code></pre>
  
  <p>and then in /puppet/manifest/site.pp</p>
  
  <pre><code>node 'db' {
  
  class { 'postgresql::server':
     listen_addresses           =&gt; '*',
     postgres_password          =&gt; 'postgres',}
  
  postgresql::server::db { 'music':
      user     =&gt; 'post',
      password =&gt; postgresql_password('post', 'post'),}
  
  postgresql::server::pg_hba_rule { 'allow application network to access database':
      description =&gt;....}}
  </code></pre>
  
  <p>I have many VM so I have to declare in this file the conf I need for each of them. Is this a valid way to proceed in using existing puppet modules? Or there is any kind of different pattern to follow?</p>