diff --git a/inventory/cloud b/inventory/cloud index 6ed145486b..f62d0a4ace 100644 --- a/inventory/cloud +++ b/inventory/cloud @@ -46,7 +46,6 @@ iddev.fedorainfracloud.org retrace-stg.aws.fedoraproject.org # This is not in aws, but here is good enough for now ppc64le-test.fedorainfracloud.org -simple-koji-ci-prod.fedorainfracloud.org [cloud:children] cloud_aws diff --git a/playbooks/groups/simple-koji-ci.yml b/playbooks/groups/simple-koji-ci.yml deleted file mode 100644 index 53c8c9c468..0000000000 --- a/playbooks/groups/simple-koji-ci.yml +++ /dev/null @@ -1,44 +0,0 @@ -- name: check/create instance - hosts: simple-koji-ci-prod.fedorainfracloud.org - gather_facts: False - - vars_files: - - /srv/web/infra/ansible/vars/global.yml - - /srv/private/ansible/vars.yml - - /srv/private/ansible/files/openstack/passwords.yml - - tasks: - - import_tasks: "{{ tasks_path }}/persistent_cloud.yml" - - handlers: - - import_tasks: "{{ handlers_path }}/restart_services.yml" - -- name: setup all the things - hosts: simple-koji-ci-prod.fedorainfracloud.org - gather_facts: True - vars_files: - - /srv/web/infra/ansible/vars/global.yml - - /srv/private/ansible/vars.yml - - /srv/private/ansible/files/openstack/passwords.yml - - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml - - pre_tasks: - - import_tasks: "{{ tasks_path }}/cloud_setup_basic.yml" - - - name: set hostname (required by some services, at least postfix need it) - hostname: name="{{inventory_hostname}}" - - - import_tasks: "{{ tasks_path }}/yumrepos.yml" - - handlers: - - import_tasks: "{{ handlers_path }}/restart_services.yml" - - roles: - # - base - - rkhunter - - nagios_client - - role: simple-koji-ci - - role: keytab/service - service: simple-koji-ci - owner_user: fedmsg - - role: chrony diff --git a/roles/openshift-apps/simple-koji-ci/templates/buildconfig.yml b/roles/openshift-apps/simple-koji-ci/templates/buildconfig.yml deleted file mode 100644 index 76bce8c472..0000000000 --- a/roles/openshift-apps/simple-koji-ci/templates/buildconfig.yml +++ /dev/null @@ -1,25 +0,0 @@ -apiVersion: v1 -kind: BuildConfig -metadata: - name: simple-koji-ci-build - labels: - environment: "simple-koji-ci" -spec: - source: - git: -{% if env == 'staging' %} - uri: https://pagure.io/forks/pingou/fedora-ci/simple-koji-ci.git - ref: "staging" -{% else %} - uri: https://pagure.io/fedora-ci/simple-koji-ci/.git - ref: "production" -{% endif %} - strategy: - type: Docker - triggers: - - type: ConfigChange - - type: ImageChange - output: - to: - kind: ImageStreamTag - name: simple-koji-ci:latest diff --git a/roles/openshift-apps/simple-koji-ci/templates/configmap.yml b/roles/openshift-apps/simple-koji-ci/templates/configmap.yml deleted file mode 100644 index 3c477949e2..0000000000 --- a/roles/openshift-apps/simple-koji-ci/templates/configmap.yml +++ /dev/null @@ -1,23 +0,0 @@ -{% macro load_file(filename) %}{% include filename %}{%- endmacro -%} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: simple-koji-ci-fedmsg - labels: - app: simple-koji-ci -data: - endpoints.py: |- - {{ load_file('endpoints.py') | indent }} - simple_koji_ci.py: |- - {{ load_file('simple_koji_ci.py') | indent }} ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: simple-koji-ci-krb - labels: - app: simple-koji-ci -data: - krb5.conf: | - {{ lookup('template', roles_path + '/base/templates/krb5.conf.j2') | indent }} diff --git a/roles/openshift-apps/simple-koji-ci/templates/deploymentconfig.yml b/roles/openshift-apps/simple-koji-ci/templates/deploymentconfig.yml deleted file mode 100644 index dc483657f4..0000000000 --- a/roles/openshift-apps/simple-koji-ci/templates/deploymentconfig.yml +++ /dev/null @@ -1,66 +0,0 @@ ---- -apiVersion: v1 -kind: DeploymentConfig -metadata: - labels: - app: simple-koji-ci - name: simple-koji-ci -spec: - replicas: 1 - selector: - app: simple-koji-ci - deploymentconfig: simple-koji-ci - strategy: - type: Recreate - template: - metadata: - labels: - app: simple-koji-ci - deploymentconfig: simple-koji-ci - spec: - hostAliases: - - hostnames: - - apps.stg.fedoraproject.org - ip: 10.5.128.177 - containers: - - name: simple-koji-ci - image: simple-koji-ci:latest - resources: {} - env: - - name: KRB5_CONFIG - value: /etc/krb/krb5.conf - - name: KRB5_CLIENT_KTNAME - value: /etc/keytab/koji-keytab - - name: OPENSHIFT - value: "True" - volumeMounts: - - name: keytab-volume - mountPath: /etc/keytabs - readOnly: true - - name: simple-koji-ci-krb-volume - mountPath: /etc/krb/ - readOnly: true - - name: simple-koji-ci-fedmsg-volume - mountPath: /opt/config - readOnly: true - volumes: - - name: keytab-volume - secret: - secretName: simple-koji-ci-keytab - - name: simple-koji-ci-krb-volume - configMap: - name: simple-koji-ci-krb - - name: simple-koji-ci-fedmsg-volume - configMap: - name: simple-koji-ci-fedmsg - - triggers: - - type: ConfigChange - - type: ImageChange - imageChangeParams: - automatic: true - containerNames: - - simple-koji-ci - from: - kind: ImageStreamTag - name: simple-koji-ci:latest diff --git a/roles/openshift-apps/simple-koji-ci/templates/endpoints.py b/roles/openshift-apps/simple-koji-ci/templates/endpoints.py deleted file mode 100644 index 8a06a35735..0000000000 --- a/roles/openshift-apps/simple-koji-ci/templates/endpoints.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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 -# -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/openshift-apps/simple-koji-ci/templates/imagestream.yml b/roles/openshift-apps/simple-koji-ci/templates/imagestream.yml deleted file mode 100644 index f83ff4d1db..0000000000 --- a/roles/openshift-apps/simple-koji-ci/templates/imagestream.yml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: ImageStream -metadata: - name: "simple-koji-ci" diff --git a/roles/openshift-apps/simple-koji-ci/templates/simple_koji_ci.py b/roles/openshift-apps/simple-koji-ci/templates/simple_koji_ci.py deleted file mode 100644 index a9ad1af929..0000000000 --- a/roles/openshift-apps/simple-koji-ci/templates/simple_koji_ci.py +++ /dev/null @@ -1,83 +0,0 @@ -class TargetTagsDict(dict): - """A dict that returns the key for missing values""" - def __missing__(self, key): - return key - - def get(self, key, default): - """Normally, get() doesn't go trough __missing__""" - return self[key] - - -config = { - 'simple-koji-ci.enabled': True, - - 'simple-koji-ci.koji': { - {% if env == 'staging' %} - 'server': 'https://koji.stg.fedoraproject.org/kojihub', - 'weburl': 'https://koji.stg.fedoraproject.org/koji', - 'git_url': 'https://src.stg.fedoraproject.org/rpms/{package}.git', - 'krb_principal': 'simple-koji-ci/simple-koji-ci-dev.fedorainfracloud.org@STG.FEDORAPROJECT.ORG', - 'krb_keytab': '/etc/krb5.simple-koji-ci_simple-koji-ci-dev.fedorainfracloud.org.keytab', - {% else %} - 'server': 'https://koji.fedoraproject.org/kojihub', - 'weburl': 'https://koji.fedoraproject.org/koji', - 'git_url': 'https://src.fedoraproject.org/rpms/{package}.git', - 'krb_principal': 'simple-koji-ci/simple-koji-ci-prod.fedorainfracloud.org@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 @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': TargetTagsDict(master='rawhide'), - }, - - "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 }}", - {% else %} - "simple-koji-ci.pagure_url" : "https://src.fedoraproject.org", - "simple-koji-ci.pagure_token" : "{{ simple_koji_ci_pagure_token }}", - {% 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": { - "handlers": { - "console": { - "class": "logging.StreamHandler", - "formatter": "bare", - "level": "DEBUG", - "stream": "ext://sys.stdout", - }, - }, - "loggers": { - "simple_koji_ci": { - "level": "DEBUG", - "propagate": True, - "handlers": ["console"], - }, - }, - } - -} diff --git a/roles/simple-koji-ci/tasks/main.yml b/roles/simple-koji-ci/tasks/main.yml deleted file mode 100644 index 56c81363c2..0000000000 --- a/roles/simple-koji-ci/tasks/main.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -# Configuration for simple-koji-ci - -- name: install needed packages - package: - name: ["simple-koji-ci", "python-qpid", "python2-koji", "git", "fedpkg", "mock"] - state: present - 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 } - - { file: krb5.conf, location: /etc/ } - 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 deleted file mode 100644 index da1c5efdf5..0000000000 --- a/roles/simple-koji-ci/templates/endpoints.py +++ /dev/null @@ -1,36 +0,0 @@ -# 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 -# -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/krb5.conf b/roles/simple-koji-ci/templates/krb5.conf deleted file mode 100644 index 4bb007188a..0000000000 --- a/roles/simple-koji-ci/templates/krb5.conf +++ /dev/null @@ -1,35 +0,0 @@ -[logging] - default = FILE:/var/log/krb5libs.log - kdc = FILE:/var/log/krb5kdc.log - admin_server = FILE:/var/log/kadmind.log - -[libdefaults] -{% if env == 'staging' %} - default_realm = STG.FEDORAPROJECT.ORG -{% else %} - default_realm = FEDORAPROJECT.ORG -{% endif %} - rdns = false - dns_canonicalize_hostname = false - dns_lookup_realm = false - dns_lookup_kdc = false - ticket_lifetime = 24h - renew_lifetime = 7d - forwardable = true - -[realms] -{% if env == 'staging' %} - STG.FEDORAPROJECT.ORG = { - kdc = https://id.stg.fedoraproject.org/KdcProxy - } -{% else %} - FEDORAPROJECT.ORG = { - kdc = https://id.fedoraproject.org/KdcProxy - } -{% endif %} - -[domain_realm] - .fedoraproject.org = FEDORAPROJECT.ORG - fedoraproject.org = FEDORAPROJECT.ORG - .stg.fedoraproject.org = STG.FEDORAPROJECT.ORG - stg.fedoraproject.org = STG.FEDORAPROJECT.ORG diff --git a/roles/simple-koji-ci/templates/simple_koji_ci.py b/roles/simple-koji-ci/templates/simple_koji_ci.py deleted file mode 100644 index 0f88935ce6..0000000000 --- a/roles/simple-koji-ci/templates/simple_koji_ci.py +++ /dev/null @@ -1,75 +0,0 @@ -class TargetTagsDict(dict): - """A dict that returns the key for missing values""" - def __missing__(self, key): - return key - - def get(self, key, default): - """Normally, get() doesn't go trough __missing__""" - return self[key] - - -config = { - 'simple-koji-ci.enabled': True, - - 'simple-koji-ci.koji': { - {% if env == 'staging' %} - 'server': 'https://koji.stg.fedoraproject.org/kojihub', - 'weburl': 'https://koji.stg.fedoraproject.org/koji', - 'git_url': 'https://src.stg.fedoraproject.org/rpms/{package}.git', - 'krb_principal': 'simple-koji-ci/simple-koji-ci-dev.fedorainfracloud.org@STG.FEDORAPROJECT.ORG', - 'krb_keytab': '/etc/krb5.simple-koji-ci_simple-koji-ci-dev.fedorainfracloud.org.keytab', - {% else %} - 'server': 'https://koji.fedoraproject.org/kojihub', - 'weburl': 'https://koji.fedoraproject.org/koji', - 'git_url': 'https://src.fedoraproject.org/rpms/{package}.git', - 'krb_principal': 'simple-koji-ci/simple-koji-ci-prod.fedorainfracloud.org@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 @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': TargetTagsDict(master='rawhide'), - }, - - "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 }}", - {% else %} - "simple-koji-ci.pagure_url" : "https://src.fedoraproject.org", - "simple-koji-ci.pagure_token" : "{{ simple_koji_ci_pagure_token }}", - {% 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"], - }, - }, - } - -}