From 4aa28fee13284e3de1a91d3282d4c0bc8d13b58f Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Fri, 19 Jun 2020 09:31:28 -0500 Subject: [PATCH] Update host_vars and sync-to-review-test playbook The host is review-test.opendev.org, so hostvars for review-test.openstack.org are not so much going to do anything. It's easier if we just ssh as root from review to gerrit2 on review-test. review-test needs to be in letsencrypt group and have a handler. We need to install mysql - it's on the existing review servers but not in ansible, it's just left over from puppet. The db credentials are in /root/.gerrit_db.cnf Change-Id: I90e3c9d1b398cc16fea9f7056cfb059c7140160e --- inventory/service/groups.yaml | 1 + ...st.openstack.org.yaml => review-test.opendev.org.yaml} | 0 playbooks/roles/gerrit/tasks/main.yaml | 3 ++- .../roles/letsencrypt-create-certs/handlers/main.yaml | 5 +++++ playbooks/sync-to-review-test.yaml | 8 +++----- 5 files changed, 11 insertions(+), 6 deletions(-) rename inventory/service/host_vars/{review-test.openstack.org.yaml => review-test.opendev.org.yaml} (100%) diff --git a/inventory/service/groups.yaml b/inventory/service/groups.yaml index eb80ce26c8..cb886948db 100644 --- a/inventory/service/groups.yaml +++ b/inventory/service/groups.yaml @@ -86,6 +86,7 @@ groups: - nb[0-9]*.opendev.org - review-dev[0-9]*.open*.org - review[0-9]*.open*.org + - review-test.opendev.org - static[0-9]*.opendev.org - zuul[0-9]*.open*.org logstash: diff --git a/inventory/service/host_vars/review-test.openstack.org.yaml b/inventory/service/host_vars/review-test.opendev.org.yaml similarity index 100% rename from inventory/service/host_vars/review-test.openstack.org.yaml rename to inventory/service/host_vars/review-test.opendev.org.yaml diff --git a/playbooks/roles/gerrit/tasks/main.yaml b/playbooks/roles/gerrit/tasks/main.yaml index 2b911a5f01..98160bc68d 100644 --- a/playbooks/roles/gerrit/tasks/main.yaml +++ b/playbooks/roles/gerrit/tasks/main.yaml @@ -245,11 +245,12 @@ name: '[{{ gerrit_vhost_name }}]:29418' when: gerrit_self_hostkey is defined -- name: Install apache2 +- name: Install apache2 and mysql client tools apt: name: - apache2 - apache2-utils + - mysql-client-core-5.7 state: present - name: Apache modules diff --git a/playbooks/roles/letsencrypt-create-certs/handlers/main.yaml b/playbooks/roles/letsencrypt-create-certs/handlers/main.yaml index 2de2d6302c..43c594ffb4 100644 --- a/playbooks/roles/letsencrypt-create-certs/handlers/main.yaml +++ b/playbooks/roles/letsencrypt-create-certs/handlers/main.yaml @@ -144,6 +144,11 @@ - name: letsencrypt updated review01-opendev-org-main include_tasks: roles/letsencrypt-create-certs/handlers/restart_apache.yaml +# review-test + +- name: letsencrypt updated review-test-opendev-org-main + include_tasks: roles/letsencrypt-create-certs/handlers/restart_apache.yaml + # Mirrors - name: letsencrypt updated mirror01-dfw-rax-main diff --git a/playbooks/sync-to-review-test.yaml b/playbooks/sync-to-review-test.yaml index a3fc5b5d4f..51282eba56 100644 --- a/playbooks/sync-to-review-test.yaml +++ b/playbooks/sync-to-review-test.yaml @@ -11,22 +11,20 @@ - name: Copy the mysqldump shell: - cmd: scp mysql_backups/gerrit.sql.gz.1 review-test.opendev.org:/home/gerrit2/gerrit.sql.gz + cmd: scp mysql_backups/gerrit.sql.gz.1 gerrit2@review-test.opendev.org:/home/gerrit2/gerrit.sql.gz chdir: /home/gerrit2 - become: gerrit2 - name: Sync the git repos shell: - cmd: rsync -avz --delete index cache git review-test.opendev.org:/home/gerrit2/review_site + cmd: rsync -avz --delete index cache git gerrit2@review-test.opendev.org:/home/gerrit2/review_site chdir: /home/gerrit2/review_site - become: gerrit2 - hosts: review-test.opendev.org tasks: - name: Apply mysql dump shell: - cmd: zcat /home/gerrit2/gerrit.sql.gz | mysql + cmd: zcat /home/gerrit2/gerrit.sql.gz | mysql --defaults-file=/root/.gerrit_db.cnf - name: Start gerrit shell: