add initial koji bits

This commit is contained in:
Louis Abel 2022-12-13 22:19:02 -07:00
parent dff8c22030
commit 7f5d0fc6e7
Signed by: label
GPG Key ID: B37E62D143879B36
9 changed files with 3370 additions and 0 deletions

View File

@ -0,0 +1,20 @@
---
# This playbook is meant to be used with callable variables, like adhoc or AWX.
# What: Creates a simple koji tag. That's it.
- name: Create Koji Tag
hosts: all
become: true
become_user: koji
vars_files:
- "vars/common.yml"
tasks:
- name: "Create tag"
ktdreyer.koji_ansible.koji_tag:
koji: "{{ koji_profile | default(primary_koji_profile) }}"
name: "{{ koji_tag }}"
arches: "{{ arches }}"
state: present
packages: "{{ koji_pkg | default(omit) }}"
groups: "{{ koji_build_groups | default(omit) }}"
...

17
adhoc-koji-create-tag.yml Normal file
View File

@ -0,0 +1,17 @@
---
# This playbook is meant to be used with callable variables, like adhoc or AWX.
# What: Creates a simple koji tag. That's it.
- name: Create Koji Tag
hosts: all
become: true
become_user: koji
vars_files:
- "vars/common.yml"
tasks:
- name: "Create tag"
ktdreyer.koji_ansible.koji_tag:
koji: "{{ koji_profile | default(primary_koji_profile) }}"
name: "{{ koji_tag }}"
state: present
...

View File

@ -0,0 +1,19 @@
---
# This playbook is meant to be used with callable variables, like adhoc or AWX.
# What: Creates a koji user.
- name: Create Koji User
hosts: all
become: true
become_user: koji
vars_files:
- "vars/common.yml"
tasks:
- name: "Create user"
ktdreyer.koji_ansible.koji_user:
koji: "{{ koji_profile | default(primary_koji_profile) }}"
name: "{{ koji_user }}"
permissions: "{{ koji_permissions }}"
krb_principal: "{{ koji_user }}@{{ ipa_realm }}"
state: enabled
...

View File

@ -0,0 +1,6 @@
---
collections:
- name: community.general
- name: ansible.posix
- name: ktdreyer.koji_ansible
...

46
init-ansible-host.yml Normal file
View File

@ -0,0 +1,46 @@
---
# YOU SHOULD ONLY RUN THIS IF YOU ARE USING THIS LOCALLY. DO NOT RUN IN AWX.
- hosts: localhost
connection: local
vars:
force_purge: true
roles_installation_dir: roles/public
collection_installation_dir: collections
installation_prefix: ./
pre_tasks:
- name: Remove existing public roles
ansible.builtin.file:
path: "{{ installation_prefix }}{{ roles_installation_dir }}"
state: absent
when: force_purge | bool
- name: Install all public roles and collections
ansible.builtin.command: >
ansible-galaxy role install
{{ ( force_purge | bool ) | ternary('--force','') }}
--role-file {{ installation_prefix }}roles/requirements.yml
--roles-path {{ installation_prefix }}{{ roles_installation_dir }}
register: galaxy_install_role
changed_when: '"Installing " in galaxy_install_role.stdout'
- name: Install needed collections
ansible.builtin.command: >
ansible-galaxy collection install
{{ ( force_purge | bool ) | ternary('--force-with-deps','') }}
-r {{ installation_prefix }}collections/requirements.yml
-p {{ installation_prefix }}{{ collection_installation_dir }}
register: galaxy_install_collection
changed_when: '"Installing " in galaxy_install_collection.stdout'
- name: cleanup old ssh known_hosts - remove
ansible.builtin.file:
path: "./tmp/known_hosts"
state: absent
mode: "0644"
- name: cleanup old ssh known_hosts - blank
ansible.builtin.file:
path: "./tmp/known_hosts"
state: touch
mode: "0644"
...

3
roles/requirements.yml Normal file
View File

@ -0,0 +1,3 @@
---
# none
...

4
vars/common.yml Normal file
View File

@ -0,0 +1,4 @@
---
primary_koji_profile: "koji"
ipa_realm: "ROCKYLINUX.ORG"
...

86
vars/koji.yml Normal file
View File

@ -0,0 +1,86 @@
---
# all standard tags
koji_default_owner: "rockykoji"
all_koji_r_tags:
- el8
- el8_0
- el8_1
- el8_2
- el8_3
- el8_4
- el8_5
- el8_6
- el8_7
- el8_8
- el8_9
- el8_10
all_koji_nb_tags:
- dist-rocky8
- dist-rocky8-compose
- dist-rocky8-updates
- dist-rocky8-lookahead
- dist-rocky8-lookahead-compose
- dist-rocky8-prep
- dist-rocky8-prep-compose
all_koji_b_tags:
- dist-rocky8-build
- dist-rocky8-updates-build
all_koji_m_tags:
- build-modules
- prep-build-modules
- lookahead-build-modules
- modular-updates-candidate
- prep-modular-updates-candidate
- lookahead-modular-updates-candidate
- dist-rocky8-module-compose
- dist-rocky8-prep-module-compose
- dist-rocky8-lookahead-module-compose
all_koji_nbe_tags:
- dist-rocky8-extras
- dist-rocky8-extras-compose
- dist-rocky8-infra
- dist-rocky8-infra-compose
- dist-rocky8-plus
- dist-rocky8-plus-compose
koji_el8_srpm_group:
- bash
- buildsys-macros-el8
- git
- redhat-rpm-config
- rocky-release
- rpm-build
- scl-utils-build
- shadow-utils
- srpmproc
- system-release
koji_el8_build_group:
- bash
- buildsys-macros-el8
- bzip2
- coreutils
- cpio
- diffutils
- findutils
- gawk
- gcc
- gcc-c++
- git
- grep
- gzip
- info
- make
- module-build-macros
- patch
- redhat-rpm-config
- rocky-release
- rpm-build
- scl-utils-build
- sed
- shadow-utils
- srpmproc
- tar
- unzip
- util-linux
- which
- xz
...

3169
vars/koji_pkgs.yml Normal file

File diff suppressed because it is too large Load Diff