Browse Source

Split gitea and gerrit services from manage-projects

There are two different concerns here. One is configuring the gitea
and gerrit services. This is independent from the management of
projects running inside them.

Make a manage-projects playbook which currently runs gitea-git-repos
but will also get a gerrit-git-repos role in a bit. Make a
service-gitea playbook for deploying gitea itself and update
run_all to take all of that into account. This should make our
future world of turning these into zuul jobs easier.

Add several missing files to the files matchers for run-gitea
and run-review.

Also - nothing about this has anything to do with puppet.

Change-Id: I5eaf75129d76138c61013a3a7ed7c381d567bb8b
changes/95/713995/5
Monty Taylor 2 weeks ago
parent
commit
86542eb9ba
5 changed files with 37 additions and 27 deletions
  1. +17
    -4
      .zuul.yaml
  2. +3
    -4
      doc/source/gitea.rst
  3. +1
    -16
      playbooks/manage-projects.yaml
  4. +6
    -0
      playbooks/service-gitea.yaml
  5. +10
    -3
      run_all.sh

+ 17
- 4
.zuul.yaml View File

@@ -1013,7 +1013,8 @@
run_playbooks:
- playbooks/service-letsencrypt.yaml
- playbooks/service-gitea-lb.yaml
- playbooks/remote_puppet_git.yaml
- playbooks/service-gitea.yaml
- playbooks/manage-projects.yaml
run_test_playbook: playbooks/test-gitea.yaml
host-vars:
gitea99.opendev.org:
@@ -1026,11 +1027,19 @@
'/var/haproxy/etc': logs
files:
- playbooks/bridge.yaml
- playbooks/service-letsencrypt.yaml
- playbooks/service-gitea-lb.yaml
- playbooks/service-gitea.yaml
- playbooks/manage-projects.yaml
- playbooks/test-gitea.yaml
- playbooks/group_vars/gitea.yaml
- playbooks/group_vars/gitea-lb.yaml
- playbooks/host_vars/gitea.*
- playbooks/zuul/templates/group_vars/gitea.yaml.j2
- playbooks/zuul/templates/group_vars/gitea-lb.yaml.j2
- playbooks/roles/install-docker/
- playbooks/roles/letsencrypt.*
- playbooks/roles/gerrit/
- playbooks/roles/gitea/
- playbooks/roles/gitea-git-repos/
- playbooks/roles/haproxy/
@@ -1083,6 +1092,7 @@
- playbooks/service-letsencrypt.yaml
- playbooks/service-review-dev.yaml
- playbooks/service-review.yaml
- playbooks/manage-projects.yaml
host-vars:
review-dev01.opendev.org:
host_copy_output:
@@ -1097,16 +1107,19 @@
'/var/log/apache2/': logs
'/var/log/acme.sh': logs
files:
- playbooks/bridge.yaml
- playbooks/service-letsencrypt.yaml
- ^playbooks/service-review.*.yaml
- playbooks/group_vars/review.yaml
- playbooks/manage-projects.yaml
- ^playbooks/host_vars/review\d+.openstack.org.yaml
- playbooks/group_vars/review-dev.yaml
- ^playbooks/host_vars/review-dev\d+.opendev.org.yaml
- ^playbooks/service-review.*.yaml
- playbooks/roles/install-docker/
- playbooks/roles/letsencrypt.*
- playbooks/service-letsencrypt.yaml
- playbooks/roles/gerrit/
- playbooks/zuul/templates/group_vars/review-dev.yaml.j2
- playbooks/zuul/templates/group_vars/review.yaml.j2
- playbooks/roles/gerrit/
- testinfra/test_gerrit.py

- job:


+ 3
- 4
doc/source/gitea.rst View File

@@ -68,10 +68,9 @@ repo rename redirects) so there is a small amount of process required
to deploy a new Gitea backend.

To deploy a new Gitea backend we add it to the ansible inventory, but
exclude it from the "Create repos on gitea servers" play in
remote_puppet_git.yaml playbook. This will full provision an empty
Gitea server with running Gitea and database processes. Then
we can manually restore the database from another node, create all of
exclude it from the manage-projects.yaml playbook. This will full
provision an empty Gitea server with running Gitea and database processes.
Then we can manually restore the database from another node, create all of
the bare git repos, and replicate all of the repo content.

When these steps are done the new gitea backend can be added to the


playbooks/remote_puppet_git.yaml → playbooks/manage-projects.yaml View File

@@ -1,12 +1,5 @@
- hosts: "gitea:!disabled"
name: "Base: configure gitea"
serial: 1
roles:
- install-docker
- gitea

- hosts: "localhost:!disabled"
name: "Puppet-git: Collect the project-config ref"
name: "Clone project-config for gitea-git-repos lookup"
strategy: free
connection: local
tasks:
@@ -15,7 +8,6 @@
repo: https://opendev.org/openstack/project-config
dest: /opt/project-config
force: yes
register: gitinfo

- hosts: "gitea:!disabled"
name: "Create repos on gitea servers"
@@ -24,10 +16,3 @@
roles:
- gitea-git-repos

- hosts: "review:!disabled"
name: "Configure gerrit"
roles:
- install-docker
- role: gerrit
gerrit_run_compose_up: false
gerrit_run_init: false

+ 6
- 0
playbooks/service-gitea.yaml View File

@@ -0,0 +1,6 @@
- hosts: "gitea:!disabled"
name: "Base: configure gitea"
serial: 1
roles:
- install-docker
- gitea

+ 10
- 3
run_all.sh View File

@@ -137,10 +137,17 @@ start_timer
timeout -k 2m 30m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/service-review-dev.yaml
send_timer nodepool

# Run the git/gerrit/zuul sequence, since it's important that they all work together
start_timer
timeout -k 2m 30m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/remote_puppet_git.yaml
send_timer git
timeout -k 2m 30m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/service-review.yaml
send_timer nodepool

start_timer
timeout -k 2m 30m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/service-gitea.yaml
send_timer nodepool

start_timer
timeout -k 2m 30m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/manage-projects.yaml
send_timer manage-projects

# Run AFS changes separately so we can make sure to only do one at a time
# (turns out quorum is nice to have)


Loading…
Cancel
Save