From 7cdb09e3844ca4593998bf212d79d9172ffa766d Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Thu, 11 Jun 2015 17:47:36 +0000 Subject: [PATCH] Move kojid.conf from a file to a template to simplify stg/prod management. --- roles/koji_builder/files/kojid.conf | 59 ------------------- roles/koji_builder/tasks/main.yml | 12 +--- .../stg-kojid.conf => templates/kojid.conf} | 14 +++++ 3 files changed, 16 insertions(+), 69 deletions(-) delete mode 100644 roles/koji_builder/files/kojid.conf rename roles/koji_builder/{files/stg-kojid.conf => templates/kojid.conf} (85%) diff --git a/roles/koji_builder/files/kojid.conf b/roles/koji_builder/files/kojid.conf deleted file mode 100644 index 4719bfffa1..0000000000 --- a/roles/koji_builder/files/kojid.conf +++ /dev/null @@ -1,59 +0,0 @@ -[kojid] -; The number of seconds to sleep between tasks -; sleeptime=15 - -; The maximum number of jobs that kojid will handle at a time -; maxjobs=10 - -; The minimum amount of free space (in MBs) required for each build root -; minspace=8192 - -; The directory root where work data can be found from the koji hub -; topdir=/mnt/koji - -;url of package download site -topurl = http://kojipkgs.fedoraproject.org/ - -; The directory root for temporary storage -; workdir=/tmp/koji - -; The directory root for mock -; mockdir=/var/lib/mock - -; The user to run as when doing builds -; mockuser=kojibuilder - -; The vendor to use in rpm headers -vendor=Fedora Project - -; The packager to use in rpm headers -packager=Fedora Project - -; the distribution to use in rpm headers -distribution=Fedora Project - -; The _host string to use in mock -mockhost=redhat-linux-gnu - -; The URL for the xmlrpc server -server=http://koji.fedoraproject.org/kojihub - -; A space-separated list of hostname:repository pairs that kojid is authorized to checkout from (no quotes) -allowed_scms=pkgs.fedoraproject.org:/*:false:fedpkg,sources git.fedorahosted.org:/git/spin-kickstarts.git:false - -; The mail host to use for sending email notifications -smtphost=bastion.phx2.fedoraproject.org - -; The From address used when sending email notifications -from_addr=Fedora Koji Build System - -;configuration for SSL athentication - -;client certificate - puppet generated -cert = /etc/kojid/kojibuilder.pem - -;certificate of the CA that issued the client certificate -ca = /etc/kojid/cacert.pem - -;certificate of the CA that issued the HTTP server certificate -serverca = /etc/kojid/cacert.pem diff --git a/roles/koji_builder/tasks/main.yml b/roles/koji_builder/tasks/main.yml index 2ca36338cc..50612326d8 100644 --- a/roles/koji_builder/tasks/main.yml +++ b/roles/koji_builder/tasks/main.yml @@ -103,8 +103,8 @@ - koji_builder - name: /etc/kojid/kojid.conf - copy: src=kojid.conf dest=/etc/kojid/kojid.conf - when: not inventory_hostname.startswith(('arm01','arm03','aarch64','ppc8','koji01.stg','buildvm-01.stg')) + template: src=kojid.conf dest=/etc/kojid/kojid.conf + when: not inventory_hostname.startswith(('arm01','arm03','aarch64','ppc8')) notify: - restart kojid tags: @@ -118,14 +118,6 @@ tags: - koji_builder -- name: staging /etc/kojid/kojid.conf - copy: src=stg-kojid.conf dest=/etc/kojid/kojid.conf - when: inventory_hostname.startswith(('koji01.stg','buildvm-01.stg')) - notify: - - restart kojid - tags: - - koji_builder - - name: config for the kojid runroot plugin (only in staging) copy: src=runroot.conf dest=/etc/kojid/runroot.conf when: inventory_hostname.startswith(('koji01.stg','buildvm-01.stg')) diff --git a/roles/koji_builder/files/stg-kojid.conf b/roles/koji_builder/templates/kojid.conf similarity index 85% rename from roles/koji_builder/files/stg-kojid.conf rename to roles/koji_builder/templates/kojid.conf index 713fd1f5ab..064ae14969 100644 --- a/roles/koji_builder/files/stg-kojid.conf +++ b/roles/koji_builder/templates/kojid.conf @@ -11,8 +11,13 @@ ; The directory root where work data can be found from the koji hub ; topdir=/mnt/koji +{% if env == 'staging' %} +;url of package download site +topurl = http://kojipkgs.fedoraproject.org/ +{% else %} ;url of package download site topurl = http://kojipkgs.stg.fedoraproject.org/ +{% endif %} ; The directory root for temporary storage ; workdir=/tmp/koji @@ -35,11 +40,18 @@ distribution=Fedora Project ; The _host string to use in mock mockhost=redhat-linux-gnu +{% if env == 'staging' %} ; The URL for the xmlrpc server server=http://koji.stg.fedoraproject.org/kojihub +{% else %} +; The URL for the xmlrpc server +server=http://koji.fedoraproject.org/kojihub +{% endif %} +{% if env == 'staging' %} ; The URL for the packages tree pkgurl=http://kojipkgs.stg.fedoraproject.org/packages +{% endif %} ; A space-separated list of hostname:repository pairs that kojid is authorized to checkout from (no quotes) allowed_scms=pkgs.fedoraproject.org:/*:false:fedpkg,sources git.fedorahosted.org:/git/spin-kickstarts.git:false @@ -61,6 +73,7 @@ ca = /etc/kojid/cacert.pem ;certificate of the CA that issued the HTTP server certificate serverca = /etc/kojid/cacert.pem +{% if env == 'staging' %} ; Let's try the runroot plugin in staging. ; Config for it lives in /etc/kojid/runroot.conf plugins = runroot @@ -68,3 +81,4 @@ plugins = runroot ; We use the hub's plugin path since that's where ; the package installs the builder plugin. pluginpath = /usr/lib/koji-hub-plugins +{% endif %}