diff --git a/inventory/group_vars/copr-back-stg b/inventory/group_vars/copr-back-stg index 5d92ed0ac9..be77649b9e 100644 --- a/inventory/group_vars/copr-back-stg +++ b/inventory/group_vars/copr-back-stg @@ -12,7 +12,7 @@ copr_builder_network_name: "coprdev-net" copr_builder_key_name: "buildsys" copr_builder_security_groups: "ssh-anywhere-coprdev,default,ssh-from-persistent-coprdev" -fedmsg_enabled: "false" +fedmsg_enabled: "true" do_sign: "true" diff --git a/playbooks/groups/copr-backend.yml b/playbooks/groups/copr-backend.yml index a1dbcacff7..82d5fd74c1 100644 --- a/playbooks/groups/copr-backend.yml +++ b/playbooks/groups/copr-backend.yml @@ -40,5 +40,5 @@ # Roles are run first, before tasks, regardless of where you place them here. roles: - base - - copr/backend - fedmsg/base + - copr/backend diff --git a/roles/copr/backend/files/fedmsg/mbs.py b/roles/copr/backend/files/fedmsg/mbs.py new file mode 100644 index 0000000000..30723fa61a --- /dev/null +++ b/roles/copr/backend/files/fedmsg/mbs.py @@ -0,0 +1,23 @@ +config = dict( + + sign_messages=False, + validate_signatures=False, + + endpoints={ + # This is the output side of the relay to which all other + # services can listen. + "relay_outbound": [ + "tcp://172.25.32.160:4001", + ], + }, + + # This is the address of an active->passive relay. It is used for the + # fedmsg-logger command which requires another service with a stable + # listening address for it to send messages to. + # It is also used by the git-hook, for the same reason. + # It is also used by the mediawiki php plugin which, due to the oddities of + # php, can't maintain a single passive-bind endpoint of it's own. + relay_inbound=[ + "tcp://172.25.32.160:2003", + ], +) diff --git a/roles/copr/backend/tasks/fedmsg.yml b/roles/copr/backend/tasks/fedmsg.yml new file mode 100644 index 0000000000..cec7c0f644 --- /dev/null +++ b/roles/copr/backend/tasks/fedmsg.yml @@ -0,0 +1,17 @@ +- name: remove unnecessary fedmsg configs + file: + path: "{{ item }}" + state: absent + with_fileglob: + - /etc/fedmsg.d/endpoints* + - /etc/fedmsg.d/relay.py + - /etc/fedmsg.d/ssl.py + +- name: install the MBS config + copy: src="fedmsg/mbs.py" dest=/etc/fedmsg.d/ + +- name: install fedmsg-relay + dnf: state=latest name=fedmsg-relay + +- name: enable fedmsg-relay + service: name=fedmsg-relay enabled=yes state=started diff --git a/roles/copr/backend/tasks/main.yml b/roles/copr/backend/tasks/main.yml index c3f825bb5b..1c6aeee643 100644 --- a/roles/copr/backend/tasks/main.yml +++ b/roles/copr/backend/tasks/main.yml @@ -216,3 +216,7 @@ - name: setup monitoring include: "monitoring.yml" + +- name: setup fedmsg for MBS + include: "fedmsg.yml" + when: env == "staging"