4aa28fee13
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
33 lines
849 B
YAML
33 lines
849 B
YAML
- hosts: review-test.opendev.org
|
|
tasks:
|
|
|
|
- name: Stop gerrit
|
|
shell:
|
|
cmd: docker-compose down
|
|
chdir: /etc/gerrit-compose
|
|
|
|
- hosts: review01.openstack.org
|
|
tasks:
|
|
|
|
- name: Copy the mysqldump
|
|
shell:
|
|
cmd: scp mysql_backups/gerrit.sql.gz.1 gerrit2@review-test.opendev.org:/home/gerrit2/gerrit.sql.gz
|
|
chdir: /home/gerrit2
|
|
|
|
- name: Sync the git repos
|
|
shell:
|
|
cmd: rsync -avz --delete index cache git gerrit2@review-test.opendev.org:/home/gerrit2/review_site
|
|
chdir: /home/gerrit2/review_site
|
|
|
|
- hosts: review-test.opendev.org
|
|
tasks:
|
|
|
|
- name: Apply mysql dump
|
|
shell:
|
|
cmd: zcat /home/gerrit2/gerrit.sql.gz | mysql --defaults-file=/root/.gerrit_db.cnf
|
|
|
|
- name: Start gerrit
|
|
shell:
|
|
cmd: docker-compose up -d
|
|
chdir: /etc/gerrit-compose
|