Initial commit

This commit is contained in:
Oliver Traber 2022-05-12 23:15:51 +02:00
commit 50f2a54331
Signed by: Bluemedia
GPG key ID: C0674B105057136C
21 changed files with 276 additions and 0 deletions

View 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