bin/octocatalog [2]
`vagrant provision staging-db1` is fine and initialization steps (if worked
around [1] is fine, D4374 again)
[1] edit /usr/lib/.../swh/core/cli/db.py and comment out the create database part.
[2]- vagrant
```
bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details --to staging db0.internal.staging.swh.network
Found host db0.internal.staging.swh.network
WARN -> Environment "open-template1" contained non-word characters, correcting name to open_template1
Cloning into '/tmp/swh-ocd.Zr4sQYWJ/environments/production/data/private'...
done.
Cloning into '/tmp/swh-ocd.Zr4sQYWJ/environments/staging/data/private'...
done.
*** Running octocatalog-diff on host db0.internal.staging.swh.network
I, [2020-10-29T15:38:27.912536 #4321] INFO -- : Catalogs compiled for db0.internal.staging.swh.network
I, [2020-10-29T15:38:29.049652 #4321] INFO -- : Diffs computed for db0.internal.staging.swh.network
diff origin/production/db0.internal.staging.swh.network current/db0.internal.staging.swh.network
*******************************************
+ Postgresql::Server::Role[swh-admin] =>
parameters =>
"connect_settings": {}
"connection_limit": "-1"
"createdb": false
"createrole": false
"db": "postgres"
"ensure": "present"
"inherit": true
"login": true
"password_hash": "md5a1ef5366acf215ee76295ac28aa629f7"
"replication": false
"superuser": true
"update_password": true
"username": "swh-admin"
*******************************************
+ Postgresql_psql[ALTER ROLE "swh-admin" CONNECTION LIMIT -1] =>
parameters =>
"connect_settings": {}
"cwd": "/tmp"
"db": "postgres"
"port": 5433
"psql_group": "postgres"
"psql_path": "/usr/bin/psql"
"psql_user": "postgres"
"unless": "SELECT 1 FROM pg_roles WHERE rolname = 'swh-admin' AND rolconnlimit = -1"
*******************************************
+ Postgresql_psql[ALTER ROLE "swh-admin" INHERIT] =>
parameters =>
"connect_settings": {}
"cwd": "/tmp"
"db": "postgres"
"port": 5433
"psql_group": "postgres"
"psql_path": "/usr/bin/psql"
"psql_user": "postgres"
"unless": "SELECT 1 FROM pg_roles WHERE rolname = 'swh-admin' AND rolinherit = true"
*******************************************
+ Postgresql_psql[ALTER ROLE "swh-admin" LOGIN] =>
parameters =>$ vagrant provision staging-db1
"connect_settings": {}... <- ok
"cwd": "/tmp"$ psql -U postgres -h 10.168.130.11 -p 5432 swh-scheduler # <- or whatever, 5433 works as well
"db": "Password for user postgres":
"port": 5433psql (12.2, server 12.4 (Debian 12.4-1.pgdg100+1))
"psql_group": "postgres"SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
"psql_path": "/usr/bin/psql"Type "help" for help.
"psql_user": "postgres">
"unless": "SELECT 1 FROM pg_roles WHERE rolname = 'swh-admin' AND rolcanlogin = true"
*******************************************
+ Postgresql_psql[ALTER ROLE "swh-admin" NOCREATEDB] =>
parameters =>
"connect_settings": {}
"cwd": "/tmp"
"db": "postgres"
"port": 5433
"psql_group": "postgres"
"psql_path": "/usr/bin/psql"```
- bin/octocatalog
[2]
"psql_user": "postgres"```
"unless": "SELECT 1 FROM pg_roles WHERE rolname = 'swh-admin' AND rolcreatedb = false"bin/octocatalog-diff --octocatalog-diff-args --no-truncate-details --to staging db1.internal.staging.swh.network
*******************************************Found host db1.internal.staging.swh.network
+ Postgresql_psql[ALTER ROLE "swh-admin" NOCREATEROLE] =>WARN -> Environment "open-template1" contained non-word characters, correcting name to open_template1
parameWARN -> Environment "wip-pg-hba-rules-in-yaml" contained non-word characters =>, correcting name to wip_pg_hba_rules_in_yaml
"connect_settings": {}Cloning into '/tmp/swh-ocd.EnwPLnXh/environments/production/data/private'...
"cwd": "/tmp"done.
"db": "postgres"Cloning into '/tmp/swh-ocd.EnwPLnXh/environments/staging/data/private'...
"port": 5433done.
"psql_group": "postgres"*** Running octocatalog-diff on host db1.internal.staging.swh.network
"psql_path": "/usr/bin/psql"I, [2020-10-30T13:12:02.760548 #23147] INFO -- : Catalogs compiled for db1.internal.staging.swh.network
"psql_user": "postgres"I, [2020-10-30T13:12:04.304854 #23147] INFO -- : Diffs computed for db1.internal.staging.swh.network
"unless": "SELECT 1 FROM pg_roles WHERE rolname = 'swh-admin' AND rolcreaterole = false"diff origin/production/db1.internal.staging.swh.network current/db1.internal.staging.swh.network
*******************************************
+ Postgresql_psql[ALTER ROLE "swh-admin" NOREPLICATION] =>
parameters =>
"connect_settings": {}
"cwd": "/tmp"
"db": "postgres"
"port": 5433
"psql_group": "postgres"
"psql_path": "/usr/bin/psql"
"psql_user": "postgres"
"unless": "SELECT 1 FROM pg_roles WHERE rolname = 'swh-admin' AND rolreplication = false"- Concat::Fragment[pg_hba_rule_deny access to postgresql user]
*******************************************
+ Postgresql_psql[ALTER ROLE "swh-admin" SUPERUSER] =>
parameters =>
"connect_settings": {}
"cwd": "/tmp"
"db": "postgres"
"port": 5433
"psql_group": "postgres"
"psql_path": "/usr/bin/psql"
"psql_user": "postgres"
"unless": "SELECT 1 FROM pg_roles WHERE rolname = 'swh-admin' AND rolsuper = true"- Concat_fragment[pg_hba_rule_deny access to postgresql user]
*******************************************
+ Postgresql_psql[ALTER ROLE swh-admin ENCRYPTED PASSWORD ****] =>
parameters =>
"command": "ALTER ROLE \"swh-admin\" ENCRYPTED PASSWORD '$NEWPGPASSWD'"
"connect_settings": {}
"cwd": "/tmp"
"db": "postgres"
"environment": "NEWPGPASSWD=md5a1ef5366acf215ee76295ac28aa629f7"
"port": 5433
"psql_group": "postgres"
"psql_path": "/usr/bin/psql"
"psql_user": "postgres"
"unless": "SELECT 1 FROM pg_shadow WHERE usename = 'swh-admin' AND passwd = 'md5a1ef5366acf215ee76295ac28aa629f7'"- Postgresql::Server::Pg_hba_rule[deny access to postgresql user]
*******************************************
+ Postgresql_psql[CREATE ROLE swh-admin ENCRYPTED PASSWORD ****] =>
parameters =>
"command": "CREATE ROLE \"swh-admin\" ENCRYPTED PASSWORD '$NEWPGPASSWD' LOGIN NOCREATEROLE NOCREATEDB SUPERUSER CONNECTION LIMIT -1"
"connect_settings": {}
"cwd": "/tmp"
"db": "postgres"
"environment": "NEWPGPASSWD=md5a1ef5366acf215ee76295ac28aa629f7"
"port": 5433
"psql_group": "postgres"
"psql_path": "/usr/bin/psql"
"psql_user": "postgres"
"unless": "SELECT 1 FROM pg_roles WHERE rolname = 'swh-admin'"
*******************************************
*** End octocatalog-diff on db0db1.internal.staging.swh.network
```