diff --git a/data/defaults.yaml b/data/defaults.yaml --- a/data/defaults.yaml +++ b/data/defaults.yaml @@ -1394,10 +1394,10 @@ listen_port: "%{hiera('swh::deploy::db::pgbouncer::port')}" listen_addr: - 127.0.0.1 - - 192.168.100.210 + - "%{hiera('pgbouncer::listen_addr')}" auth_type: "hba" auth_file: /etc/pgbouncer/userlist.txt - auth_hba_file: /etc/postgresql/11/secondary/pg_hba.conf + auth_hba_file: "%{hiera('pgbouncer::auth_hba_file')}" admin_users: - "%{hiera('swh::deploy::db::pgbouncer::user::login')}" - olasd @@ -1418,37 +1418,7 @@ - user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" password: "%{hiera('swh::deploy::db::pgbouncer::user::password')}" -pgbouncer::databases: - # swh - - source_db: "%{hiera('swh::deploy::storage::db::dbname')}" - host: prado.internal.softwareheritage.org - auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" - port: "%{hiera('swh::deploy::db::main::port')}" - # swh-deposit - - source_db: "%{hiera('swh::deploy::deposit::db::dbname')}" - host: "%{hiera('swh::deploy::deposit::db::host')}" - auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" - port: "%{hiera('swh::deploy::deposit::db::port')}" - # swh-scheduler - - source_db: "%{hiera('swh::deploy::scheduler::db::dbname')}" - host: "%{hiera('swh::deploy::scheduler::db::host')}" - auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" - port: "%{hiera('swh::deploy::scheduler::db::port')}" - # swh-scheduler-updater - - source_db: "%{hiera('swh::deploy::scheduler::updater::backend::db::dbname')}" - host: "%{hiera('swh::deploy::scheduler::updater::backend::db::host')}" - auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" - port: "%{hiera('swh::deploy::scheduler::updater::backend::db::port')}" - # swh-vault - - source_db: "%{hiera('swh::deploy::vault::db::dbname')}" - host: "%{hiera('swh::deploy::vault::db::host')}" - auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" - port: "%{hiera('swh::deploy::vault::db::port')}" - # swh-lister - - source_db: "%{hiera('swh::deploy::worker::lister::db::name')}" - host: "%{hiera('swh::deploy::worker::lister::db::host')}" - auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" - port: "%{hiera('swh::deploy::worker::lister::db::port')}" +pgbouncer::databases: [] swh::deploy::directory: "%{hiera('swh::conf_directory')}/deploy" swh::deploy::group: swhdeploy diff --git a/data/hostname/belvedere.internal.softwareheritage.org.yaml b/data/hostname/belvedere.internal.softwareheritage.org.yaml new file mode 100644 --- /dev/null +++ b/data/hostname/belvedere.internal.softwareheritage.org.yaml @@ -0,0 +1,33 @@ +pgbouncer::auth_hba_file: /etc/postgresql/11/secondary/pg_hba.conf +pgbouncer::listen_addr: 192.168.100.210 +pgbouncer::databases: + # swh + - source_db: "%{hiera('swh::deploy::storage::db::dbname')}" + host: prado.internal.softwareheritage.org + auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" + port: "%{hiera('swh::deploy::db::main::port')}" + # swh-deposit + - source_db: "%{hiera('swh::deploy::deposit::db::dbname')}" + host: "%{hiera('swh::deploy::deposit::db::host')}" + auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" + port: "%{hiera('swh::deploy::deposit::db::port')}" + # swh-scheduler + - source_db: "%{hiera('swh::deploy::scheduler::db::dbname')}" + host: "%{hiera('swh::deploy::scheduler::db::host')}" + auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" + port: "%{hiera('swh::deploy::scheduler::db::port')}" + # swh-scheduler-updater + - source_db: "%{hiera('swh::deploy::scheduler::updater::backend::db::dbname')}" + host: "%{hiera('swh::deploy::scheduler::updater::backend::db::host')}" + auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" + port: "%{hiera('swh::deploy::scheduler::updater::backend::db::port')}" + # swh-vault + - source_db: "%{hiera('swh::deploy::vault::db::dbname')}" + host: "%{hiera('swh::deploy::vault::db::host')}" + auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" + port: "%{hiera('swh::deploy::vault::db::port')}" + # swh-lister + - source_db: "%{hiera('swh::deploy::worker::lister::db::name')}" + host: "%{hiera('swh::deploy::worker::lister::db::host')}" + auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" + port: "%{hiera('swh::deploy::worker::lister::db::port')}" diff --git a/data/hostname/prado.softwareheritage.org.yaml b/data/hostname/prado.softwareheritage.org.yaml --- a/data/hostname/prado.softwareheritage.org.yaml +++ b/data/hostname/prado.softwareheritage.org.yaml @@ -8,3 +8,13 @@ prometheus::sql::config_snippets: - swh-scheduler - swh-storage + +pgbouncer::auth_hba_file: /etc/postgresql/10/secondary/pg_hba.conf +pgbouncer::listen_addr: 192.168.100.100 +pgbouncer::databases: + # swh + - source_db: "%{hiera('swh::deploy::storage::db::dbname')}" + host: prado.internal.softwareheritage.org + auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" + port: "%{hiera('swh::deploy::db::main::port')}" + diff --git a/data/hostname/somerset.internal.softwareheritage.org.yaml b/data/hostname/somerset.internal.softwareheritage.org.yaml --- a/data/hostname/somerset.internal.softwareheritage.org.yaml +++ b/data/hostname/somerset.internal.softwareheritage.org.yaml @@ -7,3 +7,12 @@ prometheus::sql::config_snippets: - swh-indexer + +pgbouncer::auth_hba_file: /etc/postgresql/10/replica/pg_hba.conf +pgbouncer::listen_addr: 192.168.100.103 +pgbouncer::databases: + # swh + - source_db: "%{hiera('swh::deploy::storage::db::dbname')}" + host: somerset.internal.softwareheritage.org + auth_user: "%{hiera('swh::deploy::db::pgbouncer::user::login')}" + port: "%{hiera('swh::deploy::db::main::port')}" diff --git a/manifests/site.pp b/manifests/site.pp --- a/manifests/site.pp +++ b/manifests/site.pp @@ -29,6 +29,7 @@ node /^(prado|somerset).(internal.)?softwareheritage.org$/ { include role::swh_database + include profile::pgbouncer } node 'belvedere.internal.softwareheritage.org' {