generate_disks_base.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. - "{{ cert_dir }}"
  22. - name: Copy helper apps
  23. copy:
  24. src: "{{ item }}"
  25. dest: "{{ netbootxyz_root }}"
  26. with_items:
  27. - memdisk
  28. - wimboot
  29. - name: Install required packages
  30. package:
  31. name: "{{ item }}"
  32. state: present
  33. with_items: "{{ netbootxyz_packages }}"
  34. - name: Check out latest iPXE sources
  35. git:
  36. repo: "{{ ipxe_repo }}"
  37. dest: "{{ ipxe_source_dir }}"
  38. version: "{{ ipxe_branch }}"
  39. force: true
  40. register: ipxe_git_checkout
  41. - name: Copy iPXE Bootloader template to iPXE source directory
  42. template:
  43. src: "disks/{{ bootloader_filename }}.j2"
  44. dest: "{{ ipxe_source_dir }}/src/{{ bootloader_filename }}"
  45. - name: Touch iPXE config local files
  46. file:
  47. path: "{{ ipxe_source_dir }}/{{ item }}"
  48. state: touch
  49. with_items:
  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
  64. - name: Retrieve iPXE CA
  65. get_url:
  66. url: "{{ ipxe_ca_url }}"
  67. dest: "{{ cert_dir }}/{{ ipxe_ca_filename }}"