summaryrefslogtreecommitdiffstats
path: root/dracut-initramfs-builder/tasks/main.yml
blob: fbd18a42bc4259cf9706970c7d9e4cc81e634aeb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- include: tasks/distro.yml

- name: Install dependencies for OpenSLX dracut module
  package: name={{ item }} state=installed
  with_items: "{{ pkgnames }}"

- name: Checkout repository of OpenSLX dracut module
  git:
    repo: "{{ gitsource }}"
    dest: "{{ gittarget }}"
    depth: 1

- include: tasks/dnbd3-fixes.yml

- name: Build initramfs with dracut
  shell: "{{ gittarget }}/builder/build-initramfs.sh -s -d -p {{ gittarget }}/initramfs"
  args:
    creates: "{{ gittarget }}/initramfs"

- name: Fetch built initramfs and kernel (+ hack for weird /@ prefix of BOOT_IMAGE)
  fetch:
    src: "{{ item }}"
    dest: "{{ playbook_dir }}/boot_files/"
    fail_on_missing: yes
    flat: yes
  with_items:
    - "{{ gittarget }}/initramfs"
    - "{{ ansible_cmdline.BOOT_IMAGE | regex_replace('^/@(/boot/.*)+$', '\\1') }}"

- name: Cleanup
  file:
    path: "{{ gittarget }}"
    state: absent