pagure and distgit/pagure: Drop the db-pagure hostname and populate the db used in the inventor host file instead

Basically, instead of relying on an obscure db-pagure variable that
then needs to be specified in the /etc/hosts file.
Just define the pagure_db_host variable in the host's inventory
file so it exists as a variable available in the playbook/role.
This makes things more explicit and easier to debug/tweak as needed.

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2020-05-26 14:08:00 +02:00
parent d898123fb3
commit 0f7a6efc2b
11 changed files with 17 additions and 8 deletions

View file

@ -27,3 +27,6 @@ effective_cache_size: "6GB"
ssh_hostnames:
- stg.pagure.io
# DB host:
pagure_db_host: 127.0.0.1

View file

@ -33,3 +33,6 @@ ssh_hostnames:
sar_script: /usr/local/bin/pagure_sar.py
sar_script_user: git
sar_output_file: pagure.json
# DB used:
pagure_db_host: 127.0.0.1

View file

@ -29,3 +29,6 @@ sar_script: /usr/local/bin/pagure_sar.py
sar_script_user: root
sar_output_file: dist_git.json
# DB used by pagure
pagure_db_host: db01.iad2.fedoraproject.org

View file

@ -18,3 +18,6 @@ virt_install_command: "{{ virt_install_command_two_nic }}"
# temp fix to get htis box working
baseiptables: False
# DB used by pagure
pagure_db_host: db01.stg.phx2.fedoraproject.org

View file

@ -33,3 +33,6 @@ sar_script: /usr/local/bin/pagure_sar.py
sar_script_user: root
sar_output_file: dist_git.json
# DB used by pagure
pagure_db_host: db01.phx2.fedoraproject.org

View file

@ -26,7 +26,7 @@ PREFERRED_URL_SCHEME='https'
### url to the database server:
#DB_URL=mysql://user:pass@host/db_name
#DB_URL=postgres://user:pass@host/db_name
DB_URL = 'postgresql://{{ distgit_pagure_db_user }}:{{ distgit_pagure_db_pass }}@{{ distgit_pagure_db_host }}/{{ distgit_pagure_db_name }}'
DB_URL = 'postgresql://{{ distgit_pagure_db_user }}:{{ distgit_pagure_db_pass }}@{{ pagure_db_host }}/{{ distgit_pagure_db_name }}'
### FAS groups of pagure admins
ADMIN_GROUP = ['cvsadmin', 'sysadmin-main']

View file

@ -3,7 +3,7 @@ import os
os.umask(0o002)
DB_URL = 'postgresql://{{ distgit_pagure_db_ro_user }}:{{ distgit_pagure_db_ro_pass }}@{{ distgit_pagure_db_host }}/{{ distgit_pagure_db_name }}'
DB_URL = 'postgresql://{{ distgit_pagure_db_ro_user }}:{{ distgit_pagure_db_ro_pass }}@{{ pagure_db_host }}/{{ distgit_pagure_db_name }}'
{% include "pagure_shared.cfg" %}

View file

@ -1,3 +0,0 @@
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 db-pagure db-pagure

View file

@ -1,4 +1,3 @@
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.0.1 db-pagure db-pagure
127.0.0.1 pagure.io

View file

@ -1,4 +1,3 @@
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.5.126.23 infrastructure.fedoraproject.org
10.5.128.120 db-pagure db-pagure

View file

@ -1,4 +1,3 @@
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.5.126.23 infrastructure.fedoraproject.org
10.5.126.71 db-pagure db-pagure