--- - hosts: buildservers vars: fedora_version: f31 patch_file: acso-5.0.5.patch # This patch has been the same since 4.18, renamed to appear more relevant run_epoch: "{{ ansible_date_time.epoch }}" build_dir: /tmp/{{ fedora_version }}_kernel tasks: # - name: Ensure libselinux-python is installed # dnf: # name: libselinux-python # state: present # become: true - name: Ensure fedpkg is installed dnf: name: fedpkg state: present become: true - name: Find old mock chroots find: paths: /var/lib/mock/ patterns: "*" file_type: directory recurse: yes register: chroots_to_delete - name: Clean old mock chroots file: path: "{{ item.path }}" state: absent with_items: "{{ chroots_to_delete.files }}" become: true - name: Clean old build dir file: path: "{{ build_dir }}" state: absent become: true - name: Clone {{ fedora_version }} kernel to {{ build_dir }} shell: fedpkg clone -a -b {{ fedora_version }} kernel {{ build_dir }} - name: Copy patch to build dir copy: src: payload/{{ patch_file }} dest: "{{ build_dir }}" - name: Apply patch and build kernel (logs in {{ build_dir }}/results_kernel/*) command: "{{ item }} chdir={{ build_dir }}" with_items: - ./scripts/newpatch.sh {{ patch_file }} - /usr/bin/sed -i -e 's/%define buildid .*$/%define buildid .acspatch/' kernel.spec - /usr/bin/make release - fedpkg mockbuild become: true - name: Find RPMs in {{ build_dir }}/results_kernel/*/*/*.rpm find: paths: "{{ build_dir }}/results_kernel/" recurse: yes patterns: '*.rpm' register: rpms - name: Copy RPMs to /tmp/ (local) fetch: src: "{{ item.path }}" dest: /tmp/ flat: yes with_items: "{{ rpms.files }}"