From 919e64d84a1d0849e17df9e73856fa85cc47e498 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Feb 01 2019 16:46:34 +0000 Subject: Use Ansible to configure hub tags/targets --- diff --git a/ansible.cfg b/ansible.cfg index f8fc6cd..e9892d7 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,2 +1,4 @@ [defaults] inventory = inventory +library = /home/kojan/git/koji-ansible/library +module_utils = /home/kojan/git/koji-ansible/module_utils diff --git a/host_vars/koji.kjnet.xyz b/host_vars/koji.kjnet.xyz index 6e3f20c..3aedbb9 100644 --- a/host_vars/koji.kjnet.xyz +++ b/host_vars/koji.kjnet.xyz @@ -1,2 +1,265 @@ ec2_ip: 3.121.240.12 ec2_groups: ssh-anywhere,http-anywhere + +packages: + - ant + - ant-contrib + - antlr + - aopalliance + - apache-commons-beanutils + - apache-commons-cli + - apache-commons-codec + - apache-commons-collections + - apache-commons-compress + - apache-commons-exec + - apache-commons-io + - apache-commons-jxpath + - apache-commons-lang + - apache-commons-lang3 + - apache-commons-logging + - apache-commons-net + - apache-commons-parent + - apache-ivy + - apache-parent + - apache-resource-bundles + - aqute-bnd + - assertj-core + - atinject + - bcel + - beust-jcommander + - bsf + - bsh + - byaccj + - cal10n + - cdi-api + - cglib + - easymock + - exec-maven-plugin + - felix-osgi-compendium + - felix-osgi-core + - felix-osgi-foundation + - felix-parent + - felix-utils + - forge-parent + - fusesource-pom + - geronimo-annotation + - geronimo-jms + - geronimo-jpa + - geronimo-parent-poms + - glassfish-annotation-api + - glassfish-el + - glassfish-jsp-api + - glassfish-legal + - glassfish-master-pom + - glassfish-servlet-api + - google-guice + - guava20 + - hamcrest + - hawtjni + - httpcomponents-client + - httpcomponents-core + - httpcomponents-project + - isorelax + - jakarta-commons-httpclient + - jakarta-oro + - jansi + - jansi-native + - java_cup + - javacc + - javacc-maven-plugin + - javamail + - javapackages-tools + - javassist + - jaxen + - jboss-interceptors-1.2-api + - jboss-parent + - jdepend + - jdependency + - jdom + - jdom2 + - jflex + - jline + - jsch + - jsoup + - jsr-305 + - jtidy + - junit + - jvnet-parent + - jzlib + - log4j12 + - maven + - maven-antrun-plugin + - maven-archiver + - maven-artifact-resolver + - maven-artifact-transfer + - maven-assembly-plugin + - maven-clean-plugin + - maven-common-artifact-filters + - maven-compiler-plugin + - maven-dependency-analyzer + - maven-dependency-plugin + - maven-dependency-tree + - maven-doxia + - maven-doxia-sitetools + - maven-enforcer + - maven-file-management + - maven-filtering + - maven-install-plugin + - maven-invoker + - maven-invoker-plugin + - maven-jar-plugin + - maven-parent + - maven-plugin-build-helper + - maven-plugin-bundle + - maven-plugin-testing + - maven-plugin-tools + - maven-plugins-pom + - maven-remote-resources-plugin + - maven-reporting-api + - maven-reporting-impl + - maven-resolver + - maven-resources-plugin + - maven-script-interpreter + - maven-shade-plugin + - maven-shared + - maven-shared-incremental + - maven-shared-io + - maven-shared-utils + - maven-source-plugin + - maven-surefire + - maven-verifier + - maven-wagon + - maven2 + - mockito + - modello + - mojo-parent + - munge-maven-plugin + - objectweb-asm + - objectweb-pom + - objenesis + - os-maven-plugin + - osgi-annotation + - osgi-compendium + - osgi-core + - plexus-ant-factory + - plexus-archiver + - plexus-bsh-factory + - plexus-build-api + - plexus-cipher + - plexus-classworlds + - plexus-cli + - plexus-compiler + - plexus-component-api + - plexus-component-factories-pom + - plexus-components-pom + - plexus-containers + - plexus-i18n + - plexus-interactivity + - plexus-interpolation + - plexus-io + - plexus-languages + - plexus-pom + - plexus-resources + - plexus-sec-dispatcher + - plexus-utils + - plexus-velocity + - powermock + - qdox + - regexp + - sisu + - sisu-mojos + - slf4j + - sonatype-oss-parent + - sonatype-plugins-parent + - spec-version-maven-plugin + - spice-parent + - testng + - velocity + - weld-parent + - xalan-j2 + - xbean + - xerces-j2 + - xml-commons-apis + - xml-commons-resolver + - xmlunit + - xmvn + - xz-java + +external_repos: + - name: platform-external + url: https://kojifiles.kjnet.xyz/fedora/linux/releases/28/Everything/x86_64/os/ + - name: platform-f28 + url: https://kojifiles.kjnet.xyz/modules/platform/f28/ + - name: javapackages-tools-201801 + url: https://kojifiles.kjnet.xyz/modules/javapackages-tools/201801/ + +tags: + - name: platform-full + external_repos: + - repo: platform-external + priority: 0 + - name: platform + external_repos: + - repo: platform-f28 + priority: 0 + - name: javapackages-tools + external_repos: + - repo: javapackages-tools-201801 + priority: 0 + - name: module + packages: + mizdebsk: "{{ packages }}" + groups: + foo: + - bar + - name: module-build + inheritance: + - parent: module + priority: 10 + - parent: javapackages-tools + priority: 15 + - parent: platform + priority: 20 + groups: + build: + - rpm-build + - shadow-utils + - glibc-minimal-langpack + srpm-build: + - rpm-build + - shadow-utils + - fedpkg-minimal + - glibc-minimal-langpack + - name: module-full-build + inheritance: + - parent: module + priority: 10 + - parent: javapackages-tools + priority: 15 + - parent: platform-full + priority: 20 + groups: + build: + - rpm-build + - shadow-utils + - glibc-minimal-langpack + srpm-build: + - rpm-build + - shadow-utils + - fedpkg-minimal + - glibc-minimal-langpack + - name: hybrid + inheritance: + - parent: module + priority: 10 + - parent: platform + priority: 20 + +targets: + - name: module + build_tag: module-build + dest_tag: module + - name: module-full + build_tag: module-full-build + dest_tag: module + diff --git a/hub.yml b/hub.yml index a7a5333..08dc395 100644 --- a/hub.yml +++ b/hub.yml @@ -161,6 +161,44 @@ - name: Start and enable kojid service: name=kojid state=started enabled=true + - name: Configure Koji external repos + local_action: + module: koji_external_repo + name: "{{ item.name }}" + url: "{{ item.url }}" + with_items: "{{ external_repos }}" + loop_control: + label: "{{ item.name }}" + tags: + - config + + - name: Configure Koji tags + local_action: + module: koji_tag + name: "{{ item.name }}" + inheritance: "{{ item.get('inheritance') }}" + external_repos: "{{ item.get('external_repos') }}" + packages: "{{ item.get('packages') }}" + groups: "{{ item.get('groups') }}" + with_items: "{{ tags }}" + loop_control: + label: "{{ item.name }}" + tags: + - config + + - name: Configure Koji build targets + local_action: + module: koji_target + name: "{{ item.name }}" + build_tag: "{{ item.build_tag }}" + dest_tag: "{{ item.dest_tag }}" + with_items: "{{ targets }}" + loop_control: + label: "{{ item.name }}" + tags: + - config + + handlers: - name: restart postgresql action: service name=postgresql state=restarted diff --git a/setup.sh b/setup.sh deleted file mode 100644 index d77c1f6..0000000 --- a/setup.sh +++ /dev/null @@ -1,40 +0,0 @@ -k add-tag platform-full --arches x86_64 -k add-external-repo --tag platform-full platform-external https://kojifiles.kjnet.xyz/fedora/linux/releases/28/Everything/x86_64/os -k add-tag platform --arches x86_64 -k add-external-repo --tag platform platform-f28 https://kojifiles.kjnet.xyz/modules/platform/f28 -k add-tag javapackages-tools --arches x86_64 -k add-external-repo --tag javapackages-tools javapackages-tools-201801 https://kojifiles.kjnet.xyz/modules/javapackages-tools/201801 - -k add-tag module --arches x86_64 -k add-tag module-build --arches x86_64 -k add-tag-inheritance --priority 10 module-build module -k add-tag-inheritance --priority 15 module-build javapackages-tools -k add-tag-inheritance --priority 20 module-build platform -k add-target module module-build module -k add-tag module-full-build --arches x86_64 -k add-tag-inheritance --priority 10 module-full-build module -k add-tag-inheritance --priority 15 module-full-build javapackages-tools -k add-tag-inheritance --priority 20 module-full-build platform-full -k add-target module-full module-full-build module - -k add-tag hybrid --arches x86_64 -k add-tag-inheritance --priority 10 hybrid module -k add-tag-inheritance --priority 20 hybrid platform - -k add-group module-build build -k add-group-pkg module-build build rpm-build shadow-utils glibc-minimal-langpack -k add-group module-build srpm-build -k add-group-pkg module-build srpm-build rpm-build shadow-utils fedpkg-minimal glibc-minimal-langpack -k regen-repo --nowait module-build - -k add-group module-full-build build -k add-group-pkg module-full-build build rpm-build shadow-utils glibc-minimal-langpack -k add-group module-full-build srpm-build -k add-group-pkg module-full-build srpm-build rpm-build shadow-utils fedpkg-minimal glibc-minimal-langpack -k regen-repo --nowait module-full-build - -pkgs="ant ant-contrib antlr aopalliance apache-commons-beanutils apache-commons-cli apache-commons-codec apache-commons-collections apache-commons-compress apache-commons-exec apache-commons-io apache-commons-jxpath apache-commons-lang apache-commons-lang3 apache-commons-logging apache-commons-net apache-commons-parent apache-ivy apache-parent apache-resource-bundles aqute-bnd assertj-core atinject bcel beust-jcommander bsf bsh byaccj cal10n cdi-api cglib easymock exec-maven-plugin felix-osgi-compendium felix-osgi-core felix-osgi-foundation felix-parent felix-utils forge-parent fusesource-pom geronimo-annotation geronimo-jms geronimo-jpa geronimo-parent-poms glassfish-annotation-api glassfish-el glassfish-jsp-api glassfish-legal glassfish-master-pom glassfish-servlet-api google-guice guava20 hamcrest hawtjni httpcomponents-client httpcomponents-core httpcomponents-project isorelax jakarta-commons-httpclient jakarta-oro jansi jansi-native java_cup javacc javacc-maven-plugin javamail javapackages-tools javassist jaxen jboss-interceptors-1.2-api jboss-parent jdepend jdependency jdom jdom2 jflex jline jsch jsoup jsr-305 jtidy junit jvnet-parent jzlib log4j12 maven maven-antrun-plugin maven-archiver maven-artifact-resolver maven-artifact-transfer maven-assembly-plugin maven-clean-plugin maven-common-artifact-filters maven-compiler-plugin maven-dependency-analyzer maven-dependency-plugin maven-dependency-tree maven-doxia maven-doxia-sitetools maven-enforcer maven-file-management maven-filtering maven-install-plugin maven-invoker maven-invoker-plugin maven-jar-plugin maven-parent maven-plugin-build-helper maven-plugin-bundle maven-plugin-testing maven-plugin-tools maven-plugins-pom maven-remote-resources-plugin maven-reporting-api maven-reporting-impl maven-resolver maven-resources-plugin maven-script-interpreter maven-shade-plugin maven-shared maven-shared-incremental maven-shared-io maven-shared-utils maven-source-plugin maven-surefire maven-verifier maven-wagon maven2 mockito modello mojo-parent munge-maven-plugin objectweb-asm objectweb-pom objenesis os-maven-plugin osgi-annotation osgi-compendium osgi-core plexus-ant-factory plexus-archiver plexus-bsh-factory plexus-build-api plexus-cipher plexus-classworlds plexus-cli plexus-compiler plexus-component-api plexus-component-factories-pom plexus-components-pom plexus-containers plexus-i18n plexus-interactivity plexus-interpolation plexus-io plexus-languages plexus-pom plexus-resources plexus-sec-dispatcher plexus-utils plexus-velocity powermock qdox regexp sisu sisu-mojos slf4j sonatype-oss-parent sonatype-plugins-parent spec-version-maven-plugin spice-parent testng velocity weld-parent xalan-j2 xbean xerces-j2 xml-commons-apis xml-commons-resolver xmlunit xmvn xz-java" - -k add-pkg --owner mizdebsk module $pkgs - -for p in $pkgs; do k build --nowait module "git+https://src.fedoraproject.org/forks/mizdebsk/rpms/${p}.git?#origin/mbi"; done