diff --git a/defaults/main.yml b/defaults/main.yml index 3fcd0eb..b9d24f7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -63,3 +63,8 @@ kojid_buildtools_repo_gpgkey: RPM-GPG-KEY-Rocky-Infra # SSH Pubkeys, define them in a playbook # mockbuilder_pub_key # kojibuilder_pub_key + +# Are the kojid builders "shared" builders between different ecosystems +# "production" and "staging" are the predetermined names and are sorted +# as such. +kojid_shared_builders: false diff --git a/handlers/main.yml b/handlers/main.yml index 8a3add4..aca02d1 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -4,7 +4,26 @@ service: name: kojid state: restarted + enabled: true + +- name: disable_kojid + service: + name: kojid + state: stopped + enabled: false - name: reload_systemd systemd: daemon_reload: true + +- name: restart_kojid_staging + service: + name: kojid_staging + state: restarted + enabled: true + +- name: restart_kojid_production + service: + name: kojid_production + state: restarted + enabled: true diff --git a/tasks/main.yml b/tasks/main.yml index 23df3cf..42b81b0 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -12,3 +12,8 @@ - name: Configure kojid import_tasks: config.yml + when: not kojid_shared_builders + +- name: Configure shared kojid + import_tasks: shared/config_shared.yml + when: kojid_shared_builders diff --git a/tasks/shared/config_shared.yml b/tasks/shared/config_shared.yml new file mode 100644 index 0000000..fec1aed --- /dev/null +++ b/tasks/shared/config_shared.yml @@ -0,0 +1,2 @@ +--- +# kojid shared configuration diff --git a/tasks/shared/storage_shared.yml b/tasks/shared/storage_shared.yml new file mode 100644 index 0000000..4342cc7 --- /dev/null +++ b/tasks/shared/storage_shared.yml @@ -0,0 +1,2 @@ +--- +# Shared Storage diff --git a/templates/production/koji.conf.j2 b/templates/production/koji.conf.j2 new file mode 100644 index 0000000..e356ab5 --- /dev/null +++ b/templates/production/koji.conf.j2 @@ -0,0 +1,15 @@ +[koji] +;url of XMLRPC server +server = {{ kojid_production_hub_url }} + +;url of web interface +weburl = {{ kojid_production_web_url }} + +;url of package download site +topurl = {{ kojid_production_files_url }} + +;path to the koji top directory +topdir = {{ kojid_production_mount }} + +; https ca, not for ssl auth +serverca = {{ kojid_ca_bundle }} diff --git a/templates/production/kojid.conf.j2 b/templates/production/kojid.conf.j2 new file mode 100644 index 0000000..1f04e87 --- /dev/null +++ b/templates/production/kojid.conf.j2 @@ -0,0 +1,36 @@ +[kojid] +sleeptime=15 +maxjobs={{ kojid_maxjobs }} +minspace={{ kojid_minspace }} +topdir={{ kojid_production_mount }} +workdir=/tmp/koji +mockdir=/var/lib/mock +mockuser=kojibuilder +vendor={{ kojid_vendor }} +packager={{ kojid_packager }} +mockhost=redhat-linux-gnu +server={{ kojid_production_hub_url }} +topurl={{ kojid_production_files_url }} +use_createrepo_c=True +from_addr=Koji Build System +admin_emails="infrastructure@rockylinux.org" +;smtphost={{ kojid_smtp_host }} +;smtp_user={{ kojid_smtp_user }} +;smtp_pass={{ kojid_smtp_pass }} +host_principal_format = compile/%s@ROCKYLINUX.ORG +keytab = {{ kojid_keytab }} +serverca = {{ kojid_ca_bundle }} + +; Modify +allowed_scms={{ kojid_allowed_scm }} + +; Other settings +build_arch_can_fail = true + +{% set plugins = [] %} + +{% if kojid_runroot_builder %} +{{ plugins.append("runroot") }} +{% endif %} + +plugins = {{ plugins | join(" ") }} diff --git a/templates/production/runroot.conf.j2 b/templates/production/runroot.conf.j2 new file mode 100644 index 0000000..ff298c1 --- /dev/null +++ b/templates/production/runroot.conf.j2 @@ -0,0 +1,37 @@ +[paths] +; comma-delimited list of default mountpoints +; They will be mounted during each run. It is suggested, that these +; paths has readonly options and are made writable via extra_mounts +; parameter for individual calls. +default_mounts = {{ kojid_production_mount }} + +; comma-delimited list of safe roots. +; Each extra_mount need to start with some of these prefixes. Other paths are +; not allowed for mounting. Only absolute paths are allowed here, no +; wildcards. +safe_roots = {{ kojid_production_mount }}/compose,/srv/odcs + +; path substitutions is tuple per line, delimited by comma, order is +; important. +; Path prefixes which can be substituted for other mountpoints. +; Usable for locations symlinked from other mounts. +; path_subs = /mnt/archive/prehistory/,/mnt/prehistoric_disk/archive/prehistory + +; mount origins, order is important here, ordered by best catch +[path0] +mountpoint = {{ kojid_production_mount }}/compose +path = {{ kojid_production_mount }}/compose +fstype = bind +options = bind + +[path1] +mountpoint = {{ kojid_production_mount }} +path = {{ kojid_production_mount }} +fstype = bind +options = bind + +[path2] +mountpoint = /srv/odcs +path = /srv/odcs +fstype = bind +options = bind diff --git a/templates/staging/koji.conf.j2 b/templates/staging/koji.conf.j2 new file mode 100644 index 0000000..9139b4c --- /dev/null +++ b/templates/staging/koji.conf.j2 @@ -0,0 +1,15 @@ +[koji] +;url of XMLRPC server +server = {{ kojid_staging_hub_url }} + +;url of web interface +weburl = {{ kojid_staging_web_url }} + +;url of package download site +topurl = {{ kojid_staging_files_url }} + +;path to the koji top directory +topdir = {{ kojid_staging_mount }} + +; https ca, not for ssl auth +serverca = {{ kojid_ca_bundle }} diff --git a/templates/staging/kojid.conf.j2 b/templates/staging/kojid.conf.j2 new file mode 100644 index 0000000..d1a3b49 --- /dev/null +++ b/templates/staging/kojid.conf.j2 @@ -0,0 +1,36 @@ +[kojid] +sleeptime=15 +maxjobs={{ kojid_maxjobs }} +minspace={{ kojid_minspace }} +topdir={{ kojid_staging_mount }} +workdir=/tmp/koji +mockdir=/var/lib/mock +mockuser=kojibuilder +vendor={{ kojid_vendor }} +packager={{ kojid_packager }} +mockhost=redhat-linux-gnu +server={{ kojid_staging_hub_url }} +topurl={{ kojid_staging_files_url }} +use_createrepo_c=True +from_addr=Koji Build System +admin_emails="infrastructure@rockylinux.org" +;smtphost={{ kojid_smtp_host }} +;smtp_user={{ kojid_smtp_user }} +;smtp_pass={{ kojid_smtp_pass }} +host_principal_format = compile/%s@ROCKYLINUX.ORG +keytab = {{ kojid_keytab }} +serverca = {{ kojid_ca_bundle }} + +; Modify +allowed_scms={{ kojid_allowed_scm }} + +; Other settings +build_arch_can_fail = true + +{% set plugins = [] %} + +{% if kojid_runroot_builder %} +{{ plugins.append("runroot") }} +{% endif %} + +plugins = {{ plugins | join(" ") }} diff --git a/templates/staging/runroot.conf.j2 b/templates/staging/runroot.conf.j2 new file mode 100644 index 0000000..c59a802 --- /dev/null +++ b/templates/staging/runroot.conf.j2 @@ -0,0 +1,37 @@ +[paths] +; comma-delimited list of default mountpoints +; They will be mounted during each run. It is suggested, that these +; paths has readonly options and are made writable via extra_mounts +; parameter for individual calls. +default_mounts = {{ kojid_staging_mount }} + +; comma-delimited list of safe roots. +; Each extra_mount need to start with some of these prefixes. Other paths are +; not allowed for mounting. Only absolute paths are allowed here, no +; wildcards. +safe_roots = {{ kojid_staging_mount }}/compose,/srv/odcs + +; path substitutions is tuple per line, delimited by comma, order is +; important. +; Path prefixes which can be substituted for other mountpoints. +; Usable for locations symlinked from other mounts. +; path_subs = /mnt/archive/prehistory/,/mnt/prehistoric_disk/archive/prehistory + +; mount origins, order is important here, ordered by best catch +[path0] +mountpoint = {{ kojid_staging_mount }}/compose +path = {{ kojid_staging_mount }}/compose +fstype = bind +options = bind + +[path1] +mountpoint = {{ kojid_staging_mount }} +path = {{ kojid_staging_mount }} +fstype = bind +options = bind + +[path2] +mountpoint = /srv/odcs +path = /srv/odcs +fstype = bind +options = bind