1
0

generate_disks_base.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. ---
  2. - name: Gathering facts
  3. setup:
  4. - name: Gather variables for each operating system
  5. include_vars: "{{ item }}"
  6. with_first_found:
  7. - "{{ ansible_distribution | lower }}-{{ ansible_distribution_version | lower }}.yml"
  8. - "{{ ansible_distribution | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
  9. - "{{ ansible_os_family | lower }}-{{ ansible_distribution_major_version | lower }}.yml"
  10. - "{{ ansible_distribution | lower }}.yml"
  11. - "{{ ansible_os_family | lower }}.yml"
  12. - name: Set var to bootloader of loop
  13. set_fact:
  14. bootloader_filename: "{{ bootloader_file }}"
  15. - name: Create iPXE file directories
  16. file:
  17. path: "{{ item }}"
  18. state: directory
  19. with_items:
  20. - "{{ netbootxyz_root }}/ipxe"
  21. - name: Copy helper apps
  22. copy:
  23. src: "{{ item }}"
  24. dest: "{{ netbootxyz_root }}"
  25. with_items:
  26. - memdisk
  27. - wimboot
  28. - name: Install required packages
  29. package:
  30. name: "{{ item }}"
  31. state: present
  32. with_items: "{{ netbootxyz_packages }}"
  33. - name: Check out latest iPXE sources
  34. git:
  35. repo: "{{ ipxe_repo }}"
  36. dest: "{{ ipxe_source_dir }}"
  37. version: "{{ ipxe_branch }}"
  38. force: true
  39. register: ipxe_git_checkout
  40. - name: Copy iPXE Bootloader template to iPXE source directory
  41. template:
  42. src: "disks/{{ bootloader_filename }}.j2"
  43. dest: "{{ ipxe_source_dir }}/src/{{ bootloader_filename }}"
  44. - name: Touch iPXE config local files
  45. file:
  46. path: "{{ ipxe_source_dir }}/{{ item }}"
  47. state: touch
  48. with_items:
  49. - src/config/local/console.h
  50. - src/config/local/umalloc.h
  51. - src/config/local/nap.h
  52. - src/config/local/timer.h
  53. - src/config/local/branding.h
  54. - src/config/local/serial.h
  55. - src/config/local/reboot.h
  56. - src/config/local/sanboot.h
  57. - src/config/local/fault.h
  58. - src/config/local/dhcp.h
  59. - src/config/local/sideband.h
  60. - src/config/local/entropy.h
  61. - src/config/local/crypto.h
  62. - src/config/local/usb.h
  63. - src/config/local/settings.h