commit cedf28fe2064e3d0d1809494471e910fb04bb2b7
Author: Nicolas Chauvet <kwizart(a)gmail.com>
Date: Fri Dec 21 15:40:35 2018 +0100
Add simple-koji-ci
roles/simple-koji-ci/tasks/main.yml | 54 +++++++++++++++++
roles/simple-koji-ci/templates/endpoints.py | 36 +++++++++++
roles/simple-koji-ci/templates/simple_koji_ci.py | 69 ++++++++++++++++++++++
3 files changed, 159 insertions(+), 0 deletions(-)
---
diff --git a/roles/simple-koji-ci/tasks/main.yml b/roles/simple-koji-ci/tasks/main.yml
new file mode 100644
index 0000000..ae072ce
--- /dev/null
+++ b/roles/simple-koji-ci/tasks/main.yml
@@ -0,0 +1,54 @@
+---
+# Configuration for simple-koji-ci
+
+- name: install needed packages
+ package: name={{ item }} state=present
+ with_items:
+ - simple-koji-ci
+ - python-qpid
+ - koji
+ - git
+ - fedpkg
+ - mock
+ tags:
+ - packages
+ - simple-koji-ci
+
+- name: copy simple-koji-ci configuration
+ template: src={{ item.file }}
+ dest={{ item.location }}/{{ item.file }}
+ owner=root group=fedmsg mode=0640
+ with_items:
+ - { file: simple_koji_ci.py, location: /etc/fedmsg.d }
+ - { file: endpoints.py, location: /etc/fedmsg.d }
+ changed_when: "1 != 1"
+ tags:
+ - config
+ - simple-koji-ci
+ notify:
+ - restart fedmsg-hub
+
+- user:
+ name: fedmsg
+ groups: mock
+ append: yes
+ tags:
+ - config
+ - simple-koji-ci
+
+- name: Create /usr/share/fedmsg since apparently fedmsg doesn't do it anymore
+ file: state=directory
+ path=/usr/share/fedmsg
+ owner=fedmsg group=fedmsg mode=0775
+ tags:
+ - config
+ - simple-koji-ci
+
+- name: Start and enable the services we want
+ service: name={{ item }} enabled=yes state=started
+ with_items:
+ - fedmsg-hub
+ tags:
+ - service
+ - simple-koji-ci
+
diff --git a/roles/simple-koji-ci/templates/endpoints.py
b/roles/simple-koji-ci/templates/endpoints.py
new file mode 100644
index 0000000..da1c5ef
--- /dev/null
+++ b/roles/simple-koji-ci/templates/endpoints.py
@@ -0,0 +1,36 @@
+# This file is part of fedmsg.
+# Copyright (C) 2012 Red Hat, Inc.
+#
+# fedmsg is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# fedmsg is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with fedmsg; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# Authors: Ralph Bean <rbean(a)redhat.com>
+#
+config = dict(
+ # This is a dict of possible addresses from which fedmsg can send
+ # messages. fedmsg.init(...) requires that a 'name' argument be passed
+ # to it which corresponds with one of the keys in this dict.
+ endpoints={
+ # These are here so your local box can listen to the upstream
+ # infrastructure's bus. Cool, right? :)
+ "fedora-infrastructure": [
+ {% if env == 'staging' %}
+ "tcp://stg.fedoraproject.org:9940",
+ {% else %}
+ "tcp://hub.fedoraproject.org:9940",
+ {% endif %}
+ ],
+ },
+)
+
diff --git a/roles/simple-koji-ci/templates/simple_koji_ci.py
b/roles/simple-koji-ci/templates/simple_koji_ci.py
new file mode 100644
index 0000000..62896a9
--- /dev/null
+++ b/roles/simple-koji-ci/templates/simple_koji_ci.py
@@ -0,0 +1,69 @@
+config = {
+ 'simple-koji-ci.enabled': True,
+
+ 'simple-koji-ci.koji': {
+ {% if env == 'staging' %}
+ 'server': 'https://koji.stg.rpmfusion.org/kojihub',
+ 'weburl': 'https://koji.stg.rpmfusion.org/koji',
+ 'git_url': 'https://pkgs.rpmfusion.org/git/free/{package}.git',
+ 'krb_principal':
'simple-koji-ci/simple-koji-ci-dev.fedorainfracloud.org(a)STG.FEDORAPROJECT.ORG',
+ 'krb_keytab':
'/etc/krb5.simple-koji-ci_simple-koji-ci-dev.fedorainfracloud.org.keytab',
+ {% else %}
+ 'server': 'https://koji.rpmfusion.org/kojihub',
+ 'weburl': 'https://koji.rpmfusion.org/koji',
+ 'git_url': 'https://pkgs.rpmfusion.org/git/free/{package}.git',
+ 'krb_principal':
'simple-koji-ci/simple-koji-ci-prod.fedorainfracloud.org(a)FEDORAPROJECT.ORG',
+ 'krb_keytab':
'/etc/krb5.simple-koji-ci_simple-koji-ci-prod.fedorainfracloud.org.keytab',
+ {% endif %}
+ # Kerberos configuration to authenticate with Koji. In development
+ # environments, use `kinit <fas-name>(a)FEDORAPROJECT.ORG` to get a
+ # Kerberos ticket and use the default settings below.
+ 'krb_ccache': None,
+ 'krb_proxyuser': None,
+ 'krb_sessionopts': {'timeout': 3600, 'krb_rdns': False},
+ 'opts': {'scratch': True},
+ 'priority': 30,
+ 'target_tags': {
+ 'master': 'rawhide',
+ 'f29': 'f29',
+ 'f28': 'f28',
+ 'el7': 'el7',
+ 'el6': 'el6',
+ }
+
+ },
+
+ "simple-koji-ci.cache": {
+ "backend": "dogpile.cache.dbm",
+ "expiration_time": 300,
+ "arguments": {
+ "filename": "/var/tmp/simple-koji-ci-cache.dbm",
+ },
+ },
+
+ {% if env == 'staging' %}
+ "simple-koji-ci.pagure_url" :
"https://src.stg.fedoraproject.org",
+ "simple-koji-ci.pagure_token" : "{{ simple_koji_ci_pagure_token_stg
}}",
+ {% endif %}
+
+ # The time in seconds the-new-hotness should wait for a socket to connect
+ # before giving up.
+ 'simple-koji-ci.connect_timeout': 15,
+ # The time in seconds the-new-hotness should wait for a read from a socket
+ # before giving up.
+ 'simple-koji-ci.read_timeout': 15,
+ # The number of times the-new-hotness should retry a network request that
+ # that failed for any reason (e.g. read timeout, DNS error, etc)
+ 'simple-koji-ci.requests_retries': 3,
+
+ "logging": {
+ "loggers": {
+ "simple_koji_ci": {
+ "level": "DEBUG",
+ "propagate": True,
+ "handlers": ["console"],
+ },
+ },
+ }
+
+}