diff --git a/roles/fai/tasks/fai-nfsroot.yml b/roles/fai/tasks/fai-nfsroot.yml index dad9134..e8943c6 100644 --- a/roles/fai/tasks/fai-nfsroot.yml +++ b/roles/fai/tasks/fai-nfsroot.yml @@ -50,3 +50,23 @@ - fai_loguser is not none - false +- name: "Check for squashfs image of nfsroot in '{{ fai_squashfs_path }}'" + ansible.builtin.stat: + path: "{{ fai_squashfs_path }}" + register: squashfs + tags: + - ipxe + - fai_squashfs_stat + +- name: "Generate a squashfs of nfsroot filesystem in '{{ fai_squashfs_path }}'" + become: true + ansible.builtin.shell: + cmd: > + fai-cd -f -M -S "{{ fai_squashfs_path }}" + -d "{{ http_mirror_fai_profiles_url }}" + when: + - not squashfs.stat.exists or + fai_nfsroot_force_rebuild + tags: + - ipxe + - fai_squashfs_generate diff --git a/roles/fai/tasks/fai-pxe.yml b/roles/fai/tasks/fai-pxe.yml index 4618303..5cd733f 100644 --- a/roles/fai/tasks/fai-pxe.yml +++ b/roles/fai/tasks/fai-pxe.yml @@ -53,7 +53,8 @@ fai-cd -f -M -S "{{ fai_squashfs_path }}" -d "{{ http_mirror_fai_profiles_url }}" when: - - not squashfs.stat.exists + - not squashfs.stat.exists or + fai_nfsroot_force_rebuild tags: - ipxe - fai_squashfs_generate diff --git a/roles/fai/tasks/main.yml b/roles/fai/tasks/main.yml index 5dd3748..97f1113 100644 --- a/roles/fai/tasks/main.yml +++ b/roles/fai/tasks/main.yml @@ -104,6 +104,7 @@ import_tasks: fai-pxe.yml tags: - fai_pxe + - fai_ipxe - name: "Configure FAI iPXE" import_tasks: fai-ipxe.yml