feat: Configurar Dist-Git como Lookaside Cache y corregir bootstrap
- Configurar rol dist_git como Lookaside Cache únicamente (sin git-daemon). - Actualizar estructura de caché a 'rpms/pkg/file/algo/hash/file' compatible con upstream. - Añadir scripts bin/sync-sources.bash y bin/sync-all-sources.bash para sincronizar fuentes desde CentOS Stream. - Eliminar bin/import-srpm.bash obsoleto. - Actualizar script mxos-get-sources.bash en kojid para usar la nueva estructura de URL. - Corregir lógica de 'add-host' en koji_bootstrap para manejar reintentos limpiamente. - Actualizar documentación (README.rst, docs/instalación.rst) reflejando los cambios. - Correcciones menores en rutas de configuración y nombres de grupos en deploy.yaml.
This commit is contained in:
parent
3aec0d2e01
commit
fa97cba322
13 changed files with 282 additions and 216 deletions
|
|
@ -10,11 +10,38 @@
|
|||
changed_when: "'Host added' in koji_add_host_result.stdout"
|
||||
failed_when: "'is already in the database' not in koji_add_host_result.stderr and koji_add_host_result.rc != 0"
|
||||
rescue:
|
||||
- name: Convert user to host in DB if it exists as user
|
||||
- name: Get user ID of the non-host user
|
||||
ansible.builtin.command: >
|
||||
sudo -u postgres psql {{ koji_db_name }} -tAc
|
||||
"SELECT id FROM users WHERE name = '{{ item }}' AND usertype = 0;"
|
||||
register: non_host_user_id
|
||||
delegate_to: "{{ koji_db_host }}"
|
||||
changed_when: false
|
||||
|
||||
- name: Delete sessions for non-host user
|
||||
ansible.builtin.command: >
|
||||
sudo -u postgres psql {{ koji_db_name }} -c
|
||||
"UPDATE users SET usertype = 1 WHERE name = '{{ item }}' AND usertype = 0;"
|
||||
"DELETE FROM sessions WHERE user_id = {{ non_host_user_id.stdout | trim }};"
|
||||
when:
|
||||
- non_host_user_id.stdout | trim | length > 0
|
||||
- "'already exists and it is not a host' in koji_add_host_result.stderr"
|
||||
delegate_to: "{{ koji_db_host }}"
|
||||
changed_when: true
|
||||
|
||||
- name: Delete non-host user
|
||||
ansible.builtin.command: >
|
||||
sudo -u postgres psql {{ koji_db_name }} -c
|
||||
"DELETE FROM users WHERE id = {{ non_host_user_id.stdout | trim }};"
|
||||
when:
|
||||
- non_host_user_id.stdout | trim | length > 0
|
||||
- "'already exists and it is not a host' in koji_add_host_result.stderr"
|
||||
delegate_to: "{{ koji_db_host }}"
|
||||
changed_when: true
|
||||
|
||||
- name: Retry adding Koji builder host
|
||||
ansible.builtin.command: >
|
||||
sudo -u {{ koji_admin_user }} koji
|
||||
--config={{ koji_hub_admin_user_koji_dir }}/config
|
||||
add-host {{ item }} x86_64
|
||||
when:
|
||||
- "'already exists and it is not a host' in koji_add_host_result.stderr"
|
||||
changed_when: true
|
||||
delegate_to: "{{ koji_db_host }}"
|
||||
|
|
|
|||
Loading…
Reference in a new issue