ansible-install-server/roles/fai/tasks/fai-pxe.yml

44 lines
1.2 KiB
YAML

- find:
paths: /srv/fai/nfsroot/boot
patterns: "vmlinuz-*"
register: fai_live_vmlinuz
- find:
paths: /srv/fai/nfsroot/boot
patterns: "initrd.img-*"
register: fai_live_initrd
- 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
copy:
src: "/srv/fai/nfsroot/boot/{{ item }}"
dest: "{{ ipxe_download_dir }}/{{ item }}"
owner: root
group: root
mode: u=rw,g=r,o=r
remote_src: true
with_items:
- "{{ fai_live_vmlinuz }}"
- "{{ fai_live_initrd }}"
- name: generate squashfs image of root files
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
synchronize:
src: "{{ item.value.files }}/"
dest: "{{ ipxe_download_dir }}/{{ item.key }}"
mode: push
delete: yes
recursive: yes
with_dict: "{{ ipxe_additional_entries }}"