build-kernel/playbook.yml

71 lines
2.1 KiB
YAML
Raw Permalink Normal View History

2019-02-26 03:48:16 +00:00
---
- hosts: buildservers
become: true
2019-02-26 03:48:16 +00:00
vars:
fedora_version: f32
patch_files:
- acso-5.4.6.patch # This patch has been modified to work on 5.6+
- fsync-5.6.patch
2019-02-26 03:48:16 +00:00
run_epoch: "{{ ansible_date_time.epoch }}"
build_dir: /tmp/{{ fedora_version }}_kernel
tasks:
2019-12-27 15:13:11 +00:00
# - name: Ensure libselinux-python is installed - no longer required on f31+?
# dnf:
# name: libselinux-python
# state: present
# become: true
2019-02-26 03:48:16 +00:00
- name: Ensure fedpkg is installed
dnf:
name: fedpkg
state: present
- 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 }}"
- name: Clean old build dir
file:
path: "{{ build_dir }}"
state: absent
- 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/{{ item }}"
2019-02-26 03:48:16 +00:00
dest: "{{ build_dir }}"
with_items: "{{ patch_files }}"
- name: Copy newpatch.sh on master branch, for 5.6 on f31
copy:
src: files/newpatch.sh
mode: 0775
dest: "{{ build_dir }}/scripts/"
when: (fedora_version in ['master', 'f32'])
- name: Apply patches
command: "./scripts/newpatch.sh {{ item }} chdir={{ build_dir }}"
with_items: "{{ patch_files }}"
- name: Build kernel (logs in {{ build_dir }}/results_kernel/*)
2019-02-26 03:48:16 +00:00
command: "{{ item }} chdir={{ build_dir }}"
with_items:
- /usr/bin/sed -i -e 's/%define buildid .*$/%define buildid .acsfsync/' kernel.spec
2019-02-26 03:48:16 +00:00
- /usr/bin/make release
- fedpkg mockbuild
- 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 }}"