51 lines
1.4 KiB
YAML
51 lines
1.4 KiB
YAML
- name: "Find linux kernel images"
|
|
ansible.builtin.find:
|
|
paths: "/srv/fai/nfsroot/boot"
|
|
patterns: "vmlinuz-*"
|
|
register: fai_live_vmlinuz
|
|
|
|
- name: "Find linux initial ram-disks"
|
|
ansible.builtin.find:
|
|
paths: "/srv/fai/nfsroot/boot"
|
|
patterns: "initrd.img-*"
|
|
register: fai_live_initrd
|
|
|
|
- name: "Manipulate file pathes"
|
|
ansible.builtin.set_fact:
|
|
fai_live_vmlinuz: "{{ fai_live_vmlinuz.files[0].path |regex_replace('.*/', '') }}"
|
|
fai_live_initrd: "{{ fai_live_initrd.files[0].path |regex_replace('.*/', '') }}"
|
|
|
|
- name: "Copy linux kernel and initrd to tftp root"
|
|
ansible.builtin.copy:
|
|
src: "/srv/fai/nfsroot/boot/{{ item }}"
|
|
dest: "{{ ipxe_download_dir + '/' + item }}"
|
|
owner: root
|
|
group: root
|
|
mode: '0544'
|
|
remote_src: true
|
|
with_items:
|
|
- "{{ fai_live_vmlinuz }}"
|
|
- "{{ fai_live_initrd }}"
|
|
|
|
- name: "Check for generated squashfs image"
|
|
ansible.builtin.stat:
|
|
path: "{{ fai_squashfs_path }}"
|
|
register: squash_img
|
|
|
|
- name: "Generate a downloadable squashfs of root filesystem"
|
|
shell: "fai-cd -f -M -S {{ fai_squashfs_path }} -d {{ http_mirror_fai_profiles_url }}"
|
|
when:
|
|
- not squash_img.stat.exists
|
|
|
|
- name: "Copy additional files"
|
|
ansible.builtin.copy:
|
|
src: "{{ item.value.files + '/' }}"
|
|
dest: "{{ ipxe_download_dir + '/' + item.key }}"
|
|
mode: push
|
|
force: yes
|
|
recursive: yes
|
|
loop: "{{ ipxe_additional_entries
|
|
|dict2items }}"
|
|
tags:
|
|
- copy_additional_files
|