From 4d29d49b2dc997d79578b86185f01d9ba0d21201 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Tue, 21 Nov 2017 16:01:34 +0100 Subject: [PATCH] Start working on the simple-koji-ci playbook --- ...imple-koji-ci-dev.fedorainfracloud.org.yml | 6 +++ roles/simple-koji-ci/tasks/main.yml | 24 +++++++++++ .../templates/simple-koji-ci.py | 43 +++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 roles/simple-koji-ci/tasks/main.yml create mode 100644 roles/simple-koji-ci/templates/simple-koji-ci.py diff --git a/playbooks/hosts/simple-koji-ci-dev.fedorainfracloud.org.yml b/playbooks/hosts/simple-koji-ci-dev.fedorainfracloud.org.yml index 9c4d8e2383..a2b4cd56bc 100644 --- a/playbooks/hosts/simple-koji-ci-dev.fedorainfracloud.org.yml +++ b/playbooks/hosts/simple-koji-ci-dev.fedorainfracloud.org.yml @@ -31,3 +31,9 @@ hostname: name="{{inventory_hostname}}" - import_tasks: "{{ tasks_path }}/yumrepos.yml" + + roles: + - role: keytab/service + service: simple-koji-ci + - role: simple-koji-ci + diff --git a/roles/simple-koji-ci/tasks/main.yml b/roles/simple-koji-ci/tasks/main.yml new file mode 100644 index 0000000000..40b74dac16 --- /dev/null +++ b/roles/simple-koji-ci/tasks/main.yml @@ -0,0 +1,24 @@ +--- +# Configuration for simple-koji-ci + +- name: install needed packages + package: name={{ item }} state=present + with_items: + - simple-koji-ci + tags: + - packages + - simple-koji-ci + +- name: copy simple-koji-ci configuration + template: src={{ item.file }} + dest={{ item.location }}/{{ item.file }} + owner=root, group=root mode=0640 + with_items: + - { file: simple-koji-ci.py, location: /etc/fedmsg} + changed_when: "1 != 1" + tags: + - config + - simple-koji-ci + notify: + - restart fedmsg-hub + 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 0000000000..b3c004a9d9 --- /dev/null +++ b/roles/simple-koji-ci/templates/simple-koji-ci.py @@ -0,0 +1,43 @@ +config = { + 'simple-koji-ci.enabled': True, + + 'simple-koji-ci.koji': { + 'server': 'https://koji.stg.fedoraproject.org/kojihub', + 'weburl': 'https://koji.stg.fedoraproject.org/koji', + # Kerberos configuration to authenticate with Koji. In development + # environments, use `kinit @FEDORAPROJECT.ORG` to get a + # Kerberos ticket and use the default settings below. + 'krb_principal': None, + 'krb_keytab': None, + 'krb_ccache': None, + 'krb_proxyuser': None, + 'krb_sessionopts': {'timeout': 3600, 'krb_rdns': False}, + 'git_url': 'https://src.stg.fedoraproject.org/rpms/{package}.git', + 'opts': {'scratch': True}, + 'priority': 30, + 'target_tag': 'rawhide', + + }, + + "simple-koji-ci.cache": { + "backend": "dogpile.cache.dbm", + "expiration_time": 300, + "arguments": { + "filename": "/var/tmp/simple-koji-ci-cache.dbm", + }, + }, + + "simple-koji-ci.pagure_url" : "https://src.stg.fedoraproject.org", + "simple-koji-ci.pagure_token" : "{{ simple_koji_ci_pagure_token_stg }}", + + # 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, +} +