Browse Source

Run matrix-eavesdrop on eavesdrop

Thin runs the new matrix-eavesdrop bot on the eavesdrop server.

It will write logs out to the limnoria logs directory, which is mounted
inside the container.

Change-Id: I867eec692f63099b295a37a028ee096c24109a2e
changes/20/800320/8
James E. Blair 12 months ago committed by Monty Taylor
parent
commit
82c966e6da
  1. 1
      playbooks/roles/matrix-eavesdrop/README.rst
  2. 17
      playbooks/roles/matrix-eavesdrop/files/docker-compose.yaml
  3. 44
      playbooks/roles/matrix-eavesdrop/tasks/main.yaml
  4. 13
      playbooks/roles/matrix-eavesdrop/templates/config.yaml
  5. 1
      playbooks/service-eavesdrop.yaml
  6. 1
      playbooks/zuul/templates/group_vars/eavesdrop.yaml.j2
  7. 3
      zuul.d/infra-prod.yaml
  8. 6
      zuul.d/project.yaml
  9. 4
      zuul.d/system-config-run.yaml

1
playbooks/roles/matrix-eavesdrop/README.rst

@ -0,0 +1 @@
Run a matrix-eavesdrop bot

17
playbooks/roles/matrix-eavesdrop/files/docker-compose.yaml

@ -0,0 +1,17 @@
# Version 2 is the latest that is supported by docker-compose in
# Ubuntu Xenial.
version: '2'
services:
eavesdrop:
image: docker.io/opendevorg/matrix-eavesdrop:latest
network_mode: host
restart: always
logging:
driver: syslog
options:
tag: "docker-matrix-eavesdrop"
volumes:
- /var/lib/matrix-eavesdrop/data:/data
- /var/lib/matrix-eavesdrop/config:/config
- /var/lib/limnoria/opendev/logs/ChannelLogger/oftc:/logs

44
playbooks/roles/matrix-eavesdrop/tasks/main.yaml

@ -0,0 +1,44 @@
- name: Ensure bot directories
file:
state: directory
path: '/var/lib/matrix-eavesdrop/{{ item }}'
mode: 0755
loop:
- data
- config
- name: Install eavesdrop config
template:
src: config.yaml
dest: /var/lib/matrix-eavesdrop/config/config.yaml
owner: root
group: root
mode: 0644
- name: Ensure /etc/matrix-eavesdrop-docker directory
file:
state: directory
path: /etc/matrix-eavesdrop-docker
mode: 0755
- name: Put docker-compose file in place
copy:
src: docker-compose.yaml
dest: /etc/matrix-eavesdrop-docker/docker-compose.yaml
owner: root
group: root
mode: 0644
- name: Run docker-compose pull
shell:
cmd: docker-compose pull
chdir: /etc/matrix-eavesdrop-docker/
- name: Run docker-compose up
shell:
cmd: "docker-compose up -d"
chdir: /etc/matrix-eavesdrop-docker/
- name: Run docker prune to cleanup unneeded images
shell:
cmd: docker image prune -f

13
playbooks/roles/matrix-eavesdrop/templates/config.yaml

@ -0,0 +1,13 @@
config:
data_dir: /data
homeserver: https://opendev.ems.host
user_id: "@logs:opendev.org"
password: "{{ matrix_logs_password }}"
log_dir: /logs
# For each room, add the following:
# id: The full Matrix ID of the room
# path: A relative path to log_dir, or begin with '/' for an absolute path.
rooms:
- id: "#test:opendev.org"
path: "#test"

1
playbooks/service-eavesdrop.yaml

@ -9,3 +9,4 @@
- gerritbot
- statusbot
- limnoria
- matrix-eavesdrop

1
playbooks/zuul/templates/group_vars/eavesdrop.yaml.j2

@ -53,3 +53,4 @@ limnoria_oftc_channels:
- '#opendev-sandbox'
statusbot_channels:
- 'opendev-sandbox'
matrix_logs_password: password

3
zuul.d/infra-prod.yaml

@ -473,8 +473,11 @@
- playbooks/roles/limnoria
- playbooks/roles/statusbot
- playbooks/roles/logrotate
- playbooks/roles/matrix-eavesdrop
- playbooks/zuul/templates/group_vars/eavesdrop.yaml.j2
- docker/accessbot/
- docker/ircbot
- docker/matrix-eavesdrop
- job:
name: infra-prod-run-accessbot

6
zuul.d/project.yaml

@ -21,6 +21,8 @@
soft: true
- name: system-config-build-image-ircbot
soft: true
- name: system-config-build-image-matrix-eavesdrop
soft: true
- system-config-run-codesearch:
dependencies:
- name: opendev-buildset-registry
@ -155,6 +157,8 @@
soft: true
- name: system-config-upload-image-ircbot
soft: true
- name: system-config-upload-image-matrix-eavesdrop
soft: true
- system-config-run-codesearch:
dependencies:
- name: opendev-buildset-registry
@ -252,7 +256,7 @@
- name: opendev-buildset-registry
- name: system-config-build-image-python-builder-3.9
soft: true
- system-config-build-image-matrix-eavesdrop:
- system-config-upload-image-matrix-eavesdrop:
dependencies:
- name: opendev-buildset-registry
- name: system-config-build-image-python-builder-3.9

4
zuul.d/system-config-run.yaml

@ -131,6 +131,7 @@
- gerritbot-container-image
- statusbot-container-image
- ircbot-container-image
- matrix-eavesdrop-container-image
nodeset:
nodes:
- name: bridge.openstack.org
@ -158,9 +159,12 @@
- playbooks/roles/accessbot
- playbooks/roles/limnoria
- playbooks/roles/logrotate
- playbooks/roles/matrix-eavesdrop
- playbooks/roles/statusbot
- playbooks/zuul/templates/group_vars/eavesdrop.yaml.j2
- docker/accessbot/
- docker/ircbot
- docker/matrix-eavesdrop
- testinfra/test_eavesdrop.py
- job:

Loading…
Cancel
Save