- name: ansible copy file locally - vmlinuz. copy: src: "{{ item }}" dest: "{{ root_image }}/vmlinuz" remote_src: yes with_fileglob: "{{ root_chroot }}/boot/vmlinuz-*" - name: ansible copy file locally - initrd. copy: src: "{{ item }}" dest: "{{ root_image }}/initrd" remote_src: yes with_fileglob: "{{ root_chroot }}/boot/initrd.img-*" - name: ansible copy file locally - config. copy: src: "{{ item }}" dest: "{{ root_image }}/config" remote_src: yes with_fileglob: "{{ root_chroot }}/boot/config-*" - name: "Stamp out a marker file for grub to use when identifying the desired boot volume" copy: #TODO: populate this with meaningful content content: "{{ ansible_date_time.date }}" dest: "{{ root_image }}/AIRSHIP_EPHEMERAL" - name: "create directory for boot image assembly" tempfile: state: directory suffix: bootimg register: bootimg_builddir - name: "write out grub config" template: src: grub-livecd.cfg.j2 dest: "{{ bootimg_builddir.path }}/grub.cfg" - name: "making standalone grub" shell: cmd: | grub-mkstandalone \ --format=i386-pc \ --output="{{ bootimg_builddir.path }}/core.img" \ --install-modules="linux normal iso9660 biosdisk memdisk search tar ls all_video" \ --modules="linux normal iso9660 biosdisk search" \ --locales="" \ --fonts="" \ boot/grub/grub.cfg="{{ bootimg_builddir.path }}/grub.cfg" - name: "ensuring directory {{ root_image }}/boot/grub exists" file: path: "{{ root_image }}/boot/grub" state: directory mode: '0755' - name: "assembling boot img" shell: cmd: cat /usr/lib/grub/i386-pc/cdboot.img {{ bootimg_builddir.path }}/core.img > {{ root_image }}/boot/grub/bios.img