mirror of
https://github.com/BluemediaDev/homelab.git
synced 2025-05-10 22:21:36 +02:00
Initial commit
This commit is contained in:
commit
50f2a54331
21 changed files with 276 additions and 0 deletions
37
metal/roles/pxe-server/tasks/main.yml
Normal file
37
metal/roles/pxe-server/tasks/main.yml
Normal file
|
@ -0,0 +1,37 @@
|
|||
- name: Download boot image
|
||||
get_url:
|
||||
url: "{{ os_download_url }}"
|
||||
dest: "{{ role_path }}/files/data/source/netboot.tar.gz"
|
||||
checksum: "{{ os_download_checksum }}"
|
||||
register: netboot_tar
|
||||
|
||||
- name: Extract boot image
|
||||
unarchive:
|
||||
src: "{{ netboot_tar.dest }}"
|
||||
dest: "{{ role_path }}/files/data/os"
|
||||
|
||||
- name: Generate DHCP config
|
||||
template:
|
||||
src: dhcpd.conf.j2
|
||||
dest: "{{ role_path }}/files/data/pxe-config/dhcpd.conf"
|
||||
mode: 0644
|
||||
|
||||
- name: Generate GRUB config
|
||||
template:
|
||||
src: grub.cfg.j2
|
||||
dest: "{{ role_path }}/files/data/pxe-config/grub.cfg"
|
||||
mode: 0644
|
||||
|
||||
- name: Generate preseed file for each machine
|
||||
template:
|
||||
src: preseed.cfg.j2
|
||||
dest: "{{ role_path }}/files/data/preseed/{{ hostvars[item]['mac'] }}.cfg"
|
||||
mode: 0644
|
||||
loop: "{{ groups['metal'] }}"
|
||||
|
||||
- name: Start PXE stack
|
||||
docker_compose:
|
||||
project_src: "{{ role_path }}/files"
|
||||
state: present
|
||||
restarted: true
|
||||
build: true
|
Loading…
Add table
Add a link
Reference in a new issue