--- - name: Install Koji-Builder packages and rpm-build ansible.builtin.dnf: name: - koji-builder - rpm-build - rpmdevtools - mock - centos-stream-repos - koji-builder-plugins state: present - name: Create kojid work directory ansible.builtin.file: path: "{{ kojid_work_dir }}" state: directory owner: root group: root mode: "0755" - name: Ensure kojibuilder user exists and is in the mock group ansible.builtin.user: name: kojibuilder groups: mock state: present - name: Ensure /etc/mock/koji has correct permissions ansible.builtin.file: path: /etc/mock/koji state: directory owner: root group: mock mode: "2775" - name: Configure mock site defaults ansible.builtin.template: src: site-defaults.cfg.j2 dest: /etc/mock/site-defaults.cfg mode: "0644" - name: Configure kojid ansible.builtin.template: src: kojid.conf.j2 dest: /etc/kojid/kojid.conf mode: "0644" notify: Restart kojid - name: Ensure /etc/pki/koji directory exists ansible.builtin.file: path: /etc/pki/koji state: directory owner: root group: root mode: "0755" - name: Copy Koji certificates to the builder ansible.builtin.copy: src: "{{ koji_pki_dir }}/{{ item.src }}" dest: "{{ item.dest }}" owner: root group: root mode: "{{ item.mode }}" loop: - {src: "{{ koji_ca_name }}_cert.crt", dest: "{{ koji_remote_ca_trust_path }}", mode: "0644"} - {src: "kojid.crt", dest: "{{ kojid_crt_path }}", mode: "0644"} - {src: "kojid.key", dest: "{{ kojid_key_path }}", mode: "0600"} - name: "Concatenate certificate and key into a PEM file" ansible.builtin.shell: cmd: "cat {{ kojid_crt_path }} {{ kojid_key_path }} > {{ kojid_pem_path }}" creates: "{{ kojid_pem_path }}" - name: Set ownership and permissions on kojid.pem ansible.builtin.file: path: "{{ kojid_pem_path }}" owner: root group: root mode: "0600" - name: Update CA trust ansible.builtin.command: update-ca-trust - name: Start and enable kojid service ansible.builtin.service: name: kojid state: started enabled: true - name: Add koji hub to /etc/hosts ansible.builtin.lineinfile: path: /etc/hosts line: "{{ hostvars[groups['kojihub'][0]].ansible_default_ipv4.address }} {{ koji_hub_fqdn }}" regexp: ".*{{ koji_hub_fqdn }}" state: present