Add replication config to gerrit ansible
We need to configure replication. Change-Id: I1bb61969a5adf37b07e43701d9a867b409a5ccf0
This commit is contained in:
parent
0a208bd1a9
commit
cc65640ef4
72
playbooks/host_vars/review01.opendev.org.yaml
Normal file
72
playbooks/host_vars/review01.opendev.org.yaml
Normal file
@ -0,0 +1,72 @@
|
||||
gerrit_replication:
|
||||
- name: 'github'
|
||||
url: 'git@github.com:'
|
||||
authGroup: 'Anonymous Users'
|
||||
replicationDelay: '1'
|
||||
replicatePermissions: false
|
||||
mirror: true
|
||||
projects:
|
||||
- '^openstack/(?!ara$|ara-web$|ara-infra$).*'
|
||||
- 'openstack-dev/*'
|
||||
- 'openstack-infra/*'
|
||||
- name: 'gitea01'
|
||||
url: 'ssh://git@gitea01.opendev.org:222/'
|
||||
authGroup: 'Anonymous Users'
|
||||
replicationDelay: '1'
|
||||
replicatePermissions: false
|
||||
mirror: true
|
||||
threads: '4'
|
||||
- name: 'gitea02'
|
||||
url: 'ssh://git@gitea02.opendev.org:222/'
|
||||
authGroup: 'Anonymous Users'
|
||||
replicationDelay: '1'
|
||||
replicatePermissions: false
|
||||
mirror: true
|
||||
threads: '4'
|
||||
- name: 'gitea03'
|
||||
url: 'ssh://git@gitea03.opendev.org:222/'
|
||||
authGroup: 'Anonymous Users'
|
||||
replicationDelay: '1'
|
||||
replicatePermissions: false
|
||||
mirror: true
|
||||
threads: '4'
|
||||
- name: 'gitea04'
|
||||
url: 'ssh://git@gitea04.opendev.org:222/'
|
||||
authGroup: 'Anonymous Users'
|
||||
replicationDelay: '1'
|
||||
replicatePermissions: false
|
||||
mirror: true
|
||||
threads: '4'
|
||||
- name: 'gitea05'
|
||||
url: 'ssh://git@gitea05.opendev.org:222/'
|
||||
authGroup: 'Anonymous Users'
|
||||
replicationDelay: '1'
|
||||
replicatePermissions: false
|
||||
mirror: true
|
||||
threads: '4'
|
||||
- name: 'gitea06'
|
||||
url: 'ssh://git@gitea06.opendev.org:222/'
|
||||
authGroup: 'Anonymous Users'
|
||||
replicationDelay: '1'
|
||||
replicatePermissions: false
|
||||
mirror: true
|
||||
threads: '4'
|
||||
- name: 'gitea07'
|
||||
url: 'ssh://git@gitea07.opendev.org:222/'
|
||||
authGroup: 'Anonymous Users'
|
||||
replicationDelay: '1'
|
||||
replicatePermissions: false
|
||||
mirror: true
|
||||
threads: '4'
|
||||
- name: 'gitea08'
|
||||
url: 'ssh://git@gitea08.opendev.org:222/'
|
||||
authGroup: 'Anonymous Users'
|
||||
replicationDelay: '1'
|
||||
replicatePermissions: false
|
||||
mirror: true
|
||||
threads: '4'
|
||||
- name: 'local'
|
||||
url: 'file:///opt/lib/git/'
|
||||
replicationDelay: '1'
|
||||
threads: '4'
|
||||
mirror: true
|
@ -64,6 +64,14 @@
|
||||
group: "{{ gerrit_user_name }}"
|
||||
mode: 0644
|
||||
|
||||
- name: Write Gerrit replication config
|
||||
template:
|
||||
src: replication.config.j2
|
||||
dest: "{{ gerrit_site_dir }}/etc/replication.config"
|
||||
owner: "{{ gerrit_user_name }}"
|
||||
group: "{{ gerrit_user_name }}"
|
||||
when: gerrit_replication is defined
|
||||
|
||||
- name: Write Gerrit SSH private key
|
||||
copy:
|
||||
content: "{{ gerrit_ssh_rsa_key_contents }}"
|
||||
|
32
playbooks/roles/gerrit/templates/replication.config.j2
Normal file
32
playbooks/roles/gerrit/templates/replication.config.j2
Normal file
@ -0,0 +1,32 @@
|
||||
# This file is managed by ansible.
|
||||
# https://opendev.org/opendev/system-config
|
||||
|
||||
[gerrit]
|
||||
defaultForceUpdate = true
|
||||
autoReload = false
|
||||
replicateOnStartup = false
|
||||
|
||||
{% for replication in gerrit_replication %}
|
||||
[remote "{{ replication.name }}"]
|
||||
url = {{ replication.url }}${name}.git
|
||||
{% if 'replicationDelay' in replication %}
|
||||
replicationDelay = {{ replication.replicationDelay }}
|
||||
{% endif %}
|
||||
{% if 'threads' in replication %}
|
||||
threads = {{ replication.threads }}
|
||||
{% endif %}
|
||||
{% if 'authGroup' in replication %}
|
||||
authGroup = {{ replication.authGroup }}
|
||||
{% endif %}
|
||||
{% if 'replicatePermissions' in replication %}
|
||||
replicatePermissions = {{ replication.replicatePermissions }}
|
||||
{% endif %}
|
||||
{% if 'mirror' in replication %}
|
||||
mirror = {{ replication.mirror }}
|
||||
{% endif %}
|
||||
{% if 'projects' in replication %}
|
||||
{% for project in replication.projects %}
|
||||
projects = {{ project }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endfor %}
|
Loading…
Reference in New Issue
Block a user