Sto provando ad usare il modulo fantoccio puppetlabs/postgresql. Sono molto confuso su come usarlo. Qualcuno può darmi un esempio? la documentazione dice di creare la classe con le impostazioni ma non sono sicuro di dove creare la classe, ho avuto l'impressione di usare site.pp ma quando creo una classe nel sito.pp. Ho inserito il seguente blocco nel sito.pp dopo aver installato il modulopuppetlabs/postgresql esempi non funzionanti
node default {
# This is where you can declare classes for all nodes.
# Example:
# class { 'my_class': }
include postgresql::server
class { 'postgresql::server':
config_hash => {
'ip_mask_deny_postgres_user' => '0.0.0.0/32',
'ip_mask_allow_all_users' => '0.0.0.0/0',
'listen_addresses' => '*',
'ipv4acls' => ['hostssl all johndoe 192.168.0.0/24 cert'],
'manage_redhat_firewall' => true,
'manage_pg_hba_conf' => false,
'postgres_password' => 'TPSrep0rt!',
},
}
postgresql::db { 'testdb':
user => 'testdbuser',
password => 'testdbuser'
}
postgresql::database_grant { 'testdbuser':
privilege => 'ALL',
db => 'testdbuser',
role => 'dbo',
}
}
Ottengo un sacco di errori.
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Class[Postgresql::Server] is already declared; cannot redeclare at /etc/puppetlabs/puppet/manifests/site.pp:55 on node caaers
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
Nota: la struttura config_hash {} è stata rimossa ed è vecchia sintassi. Vedi: https://github.com/puppetlabs/puppetlabs-postgresql#config_hash-parameter-collapsed-for-the-postgresqlserver-class – r3cgm