From bec450fc7faa885e9ce7b9b33a62d6afc48a4202 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Mon, 25 Oct 2021 10:08:24 +0200 Subject: [PATCH] . --- salt/states/atftp/init.sls | 26 ------------------ salt/states/{atftp => pxe}/files/grub.cfg | 0 .../states/{atftp => pxe}/files/harvester.cfg | 0 salt/states/{atftp => pxe}/files/opensuse.png | Bin .../{atftp => pxe}/files/pxelinux.cfg/default | 0 .../{atftp => pxe}/files/tlu-harvester.cfg | 0 salt/states/pxe/init.sls | 3 ++ salt/states/pxe/pxe.sls | 25 +++++++++++++++++ salt/states/top.sls | 1 + 9 files changed, 29 insertions(+), 26 deletions(-) rename salt/states/{atftp => pxe}/files/grub.cfg (100%) rename salt/states/{atftp => pxe}/files/harvester.cfg (100%) rename salt/states/{atftp => pxe}/files/opensuse.png (100%) rename salt/states/{atftp => pxe}/files/pxelinux.cfg/default (100%) rename salt/states/{atftp => pxe}/files/tlu-harvester.cfg (100%) create mode 100644 salt/states/pxe/init.sls create mode 100644 salt/states/pxe/pxe.sls diff --git a/salt/states/atftp/init.sls b/salt/states/atftp/init.sls index 13835bc..26c2c8c 100644 --- a/salt/states/atftp/init.sls +++ b/salt/states/atftp/init.sls @@ -6,32 +6,6 @@ Install atftp: pkg.installed: - name: atftp - -{% set files = ['memdisk', 'poweroff.com', 'pxelinux.0', 'vesamenu.c32'] -%} -{% for file in files -%} -Linking {{ file }}: - file.symlink: - - name: /srv/tftpboot/{{ file }} - - target: /usr/share/syslinux/{{ file }} -{% endfor %} - -copy bootx64.efi: - file.managed: - - name: /srv/tftpboot/bootx64.efi - - source: /usr/share/efi/x86_64/shim.efi - -copy grub.efi: - file.managed: - - name: /srv/tftpboot/grub.efi - - source: /usr/share/efi/x86_64/grub.efi - -Add files to tftpboot: - file.recurse: - - name: /srv/tftpboot - - source: salt://atftp/files - - include_empty: True - - replace: False - Start the atftpd.socket: service.running: - name: atftpd.socket diff --git a/salt/states/atftp/files/grub.cfg b/salt/states/pxe/files/grub.cfg similarity index 100% rename from salt/states/atftp/files/grub.cfg rename to salt/states/pxe/files/grub.cfg diff --git a/salt/states/atftp/files/harvester.cfg b/salt/states/pxe/files/harvester.cfg similarity index 100% rename from salt/states/atftp/files/harvester.cfg rename to salt/states/pxe/files/harvester.cfg diff --git a/salt/states/atftp/files/opensuse.png b/salt/states/pxe/files/opensuse.png similarity index 100% rename from salt/states/atftp/files/opensuse.png rename to salt/states/pxe/files/opensuse.png diff --git a/salt/states/atftp/files/pxelinux.cfg/default b/salt/states/pxe/files/pxelinux.cfg/default similarity index 100% rename from salt/states/atftp/files/pxelinux.cfg/default rename to salt/states/pxe/files/pxelinux.cfg/default diff --git a/salt/states/atftp/files/tlu-harvester.cfg b/salt/states/pxe/files/tlu-harvester.cfg similarity index 100% rename from salt/states/atftp/files/tlu-harvester.cfg rename to salt/states/pxe/files/tlu-harvester.cfg diff --git a/salt/states/pxe/init.sls b/salt/states/pxe/init.sls new file mode 100644 index 0000000..da035b6 --- /dev/null +++ b/salt/states/pxe/init.sls @@ -0,0 +1,3 @@ +include: + - pxe.pxe + - pxe.harvester diff --git a/salt/states/pxe/pxe.sls b/salt/states/pxe/pxe.sls new file mode 100644 index 0000000..48c71a8 --- /dev/null +++ b/salt/states/pxe/pxe.sls @@ -0,0 +1,25 @@ +{% set files = ['memdisk', 'poweroff.com', 'pxelinux.0', 'vesamenu.c32'] -%} +{% for file in files -%} +Linking {{ file }}: + file.symlink: + - name: /srv/tftpboot/{{ file }} + - target: /usr/share/syslinux/{{ file }} +{% endfor %} + +copy bootx64.efi: + file.managed: + - name: /srv/tftpboot/bootx64.efi + - source: /usr/share/efi/x86_64/shim.efi + +copy grub.efi: + file.managed: + - name: /srv/tftpboot/grub.efi + - source: /usr/share/efi/x86_64/grub.efi + +Add default files to tftpboot: + file.recurse: + - name: /srv/tftpboot + - source: salt://pxe/files + - include_empty: True + - replace: False + diff --git a/salt/states/top.sls b/salt/states/top.sls index 24762ea..57db3e1 100644 --- a/salt/states/top.sls +++ b/salt/states/top.sls @@ -15,5 +15,6 @@ base: - docker.registry - remote-desktop - wol + - pxe - tlu-harvester - nfs-server