refactor(ansible): Estandariza nombres de roles y actualiza Koji

Se estandarizan los nombres de los directorios de roles, cambiando guiones por guiones bajos.

Se añaden nuevos scripts para limpieza y callbacks en Koji Hub. Además, se actualizan las configuraciones de Kojid, Kojira y PostgreSQL, incluyendo la instalación de paquetes, ajustes de mock y la gestión de variables.
This commit is contained in:
Rénich Bon Ćirić 2025-11-15 20:07:11 -06:00
commit 39aeb2d6b6
Signed by: renich
GPG key ID: AB2A9F49384FE324
91 changed files with 1037 additions and 957 deletions

View file

@ -6,7 +6,7 @@
# List of certificates to generate.
# is_user: true will generate a .p12 file for browser import.
koji_certs_to_generate:
common_koji_certs_to_generate:
- name: kojihub
cn: "{{ koji_hub_fqdn }}" # Server certs must use the FQDN for the CN
is_user: false

View file

@ -18,6 +18,7 @@
- name: Create temporary OpenSSL config for signing
ansible.builtin.copy:
dest: "{{ koji_pki_dir }}/openssl-{{ cert.name }}.cnf"
mode: "0644"
content: |
[v3_ca]
basicConstraints = CA:FALSE
@ -30,11 +31,11 @@
subjectAltName = @alt_names
[alt_names]
DNS.1 = {{ cert.cn }}
{% for san in cert.sans|default([]) %}
{% for san in cert.sans | default([]) %}
DNS.{{ loop.index + 1 }} = {{ san }}
{% endfor %}
- name: "Sign certificate for {{ cert.name }} with our CA"
- name: "Sign certificate with our CA"
ansible.builtin.shell:
cmd: >
openssl x509 -req
@ -55,8 +56,6 @@
path: "{{ koji_pki_dir }}/openssl-{{ cert.name }}.cnf"
state: absent
- name: "Generate PKCS12 bundle for user {{ cert.name }}"
community.crypto.openssl_pkcs12:
action: export
@ -72,4 +71,4 @@
- name: "Create PEM file for {{ cert.name }}"
ansible.builtin.shell:
cmd: "cat {{ koji_pki_dir }}/{{ cert.name }}.crt {{ koji_pki_dir }}/{{ cert.name }}.key > {{ koji_pki_dir }}/{{ cert.name }}.pem"
creates: "{{ koji_pki_dir }}/{{ cert.name }}.pem"
creates: "{{ koji_pki_dir }}/{{ cert.name }}.pem"

View file

@ -1,6 +1,7 @@
# SPDX-License-Identifier: MIT-0
---
- hosts: localhost
- name: Test common role
hosts: localhost
remote_user: root
roles:
- roles/common
- common

View file

@ -1,3 +1,3 @@
---
common_ca_key_path: "{{ common_koji_pki_dir }}/{{ common_ca_name }}_cert.key"
common_ca_cert_path: "{{ common_koji_pki_dir }}/{{ common_ca_name }}_cert.crt"
common_ca_key_path: "{{ koji_pki_dir }}/{{ common_ca_name }}_cert.key"
common_ca_cert_path: "{{ koji_pki_dir }}/{{ common_ca_name }}_cert.crt"