voxpupuli / puppet-pxe

Puppet module for deploying a PXE boot server
https://forge.puppet.com/puppet/pxe
51 stars 38 forks source link

Bugs in per-machine menus #16

Closed TheLQ closed 7 years ago

TheLQ commented 10 years ago

Was testing out automated PXE imaging but ran into some issues with the config file. I added this to my puppet config:

pxe::menu::entry { "quackmunin":
    file    => "01-08-00-27-5b-dd-5c",
    kernel  => "images/ubuntu/trusty/i386/linux",
    append  => "initrd=images/ubuntu/trusty/i386/initrd.gz netcfg/get_hostname=quackmunin"
}

If the file doesn't exist this fails with Error: Failed to apply catalog: Could not find dependent Exec[concat_/srv/tftp/pxelinux.cfg/01-08-00-27-5b-dd-5c] for File[/var/lib/puppet/concat/_srv_tftp_pxelinux.cfg_01-08-00-27-5b-dd-5c/fragments/10_01-08-00-27-5b-dd-5c-menu-entry-quackmunin] at /etc/puppet/environments/production/modules/concat/manifests/fragment.pp:120

I discovered however that adding this line to manifests/menu/entry.pp fixes the issue (stdlib is a transitive dependency so this works)

ensure_resource('concat', "${fullpath}/${file_string}", {})

This creates the config file but it's missing several options like DEFAULT which breaks pxelinux. This is the full config it generates

LABEL quackmunin
  KERNEL images/ubuntu/trusty/i386/linux
  APPEND initrd=images/ubuntu/trusty/i386/initrd.gz netcfg/get_hostname=quackmunin

Since pxe::menu::entry is also used for standard menus I'm not sure how to fix this issue.

zachfi commented 7 years ago

I think I read this long ago, but never responded. I'm sorry for that.

Is this still an issue for you? Are you still using this module? If so, I'll try to work up a test for this, and if not, then I'd like to close this out. I've written a few tests, and I think this could be a case where we might want to add one if its still an issue.

TheLQ commented 7 years ago

I don't use pxe anymore so it's up to you

zachfi commented 7 years ago

@TheLQ Thanks for coming back with that. I don't either, so unless someone else runs into this, I'll mark this closed.