title: chef-solo + postgres result in invalid pg_hba.conf
body: <p>I'm trying to setup postgres with vagrant + chef solo.</p>
  
  <p>I'm using the official receipt: <a href="http://community.opscode.com/cookbooks/postgresql" rel="nofollow">http://community.opscode.com/cookbooks/postgresql</a></p>
  
  <p>As my <code>Berksfile</code> contains:</p>
  
  <pre><code>site :opscode
  
  cookbook "postgresql"
  </code></pre>
  
  <p>And my <code>Vagrantfile</code> chunk is:</p>
  
  <pre><code>config.berkshelf.enabled = true
  
  config.vm.provision "chef_solo" do |chef|
  
  chef.add_recipe "postgresql::server"
  
    chef.json = {
  
    "postgresql" =&gt; {
        "version" =&gt; "9.2",
        "password" =&gt; { "postgres" =&gt; "123" },
        config: { 
        "ssl" =&gt; "false" 
    },
        pg_hba: [  
            { type: 'local', db: 'all', user: 'all', addr: '', method: 'trust' },
            { type: 'local', db: 'all', user: 'all', addr: '127.0.0.1/32', method: 'trust' },
            { type: 'local', db: 'all', user: 'all', addr: '::1/128 ', method: 'trust' } 
    ]
    }
  end
  </code></pre>
  
  <p>The generated contents of: <code>/etc/postgresql/9.2/main/pg_hba.conf</code> looks like this:</p>
  
  <pre><code># This file was automatically generated and dropped off by Chef!
  
  # PostgreSQL Client Authentication Configuration File
  # ===================================================
  #
  # Refer to the "Client Authentication" section in the PostgreSQL
  # documentation for a complete description of this file.
  
  # TYPE  DATABASE        USER            ADDRESS                 METHOD
  
  ###########
  # Other authentication configurations taken from chef node defaults:
  ###########
  
  local   all             all                                     trust
  
  local   all             all             127.0.0.1/32            trust
  
  local   all             all             ::1/128                 trust
  
  # "local" is for Unix domain socket connections only
  local   all             all                                     peer
  </code></pre>
  
  <p>However if I run <code>sudo service postgresql restart</code>, it fails with error:</p>
  
  <pre><code>The PostgreSQL server failed to start. Please check the log output:
  2013-11-10 08:12:05 GMT LOG:  invalid authentication method "127.0.0.1/32"
  2013-11-10 08:12:05 GMT CONTEXT:  line 17 of configuration file "/etc/postgresql/9.2/main/pg_hba.conf"
  2013-11-10 08:12:05 GMT LOG:  invalid authentication method "::1/128"
  2013-11-10 08:12:05 GMT CONTEXT:  line 19 of configuration file "/etc/postgresql/9.2/main/pg_hba.conf"
  2013-11-10 08:12:05 GMT FATAL:  could not load pg_hba.conf
  </code></pre>
  
  <p>The problematic entries are those holding the address. Any idea what is wrong in my use case?</p>