diff --git a/manifests/inspector.pp b/manifests/inspector.pp index 89333c9e..4160777c 100644 --- a/manifests/inspector.pp +++ b/manifests/inspector.pp @@ -164,6 +164,14 @@ # String with kernel arguments to send to the ramdisk on boot. # Defaults to undef # +# [*ramdisk_filename*] +# The filename of ramdisk which is used in pxelinux_cfg/ipxelinux_cfg templates +# Defaults to 'agent.ramdisk' +# +# [*kernel_filename*] +# The filename of kernel which is used in pxelinux_cfg/ipxelinux_cfg templates +# Defaults to 'agent.kernel' +# # [*ipxe_timeout*] # (optional) ipxe timeout in second. Should be an integer. # Defaults to $::os_service_default @@ -235,6 +243,8 @@ class ironic::inspector ( $dnsmasq_local_ip = '192.168.0.1', $sync_db = true, $ramdisk_collectors = 'default', + $ramdisk_filename = 'agent.ramdisk', + $kernel_filename = 'agent.kernel', $additional_processing_hooks = undef, $ramdisk_kernel_args = undef, $ipxe_timeout = $::os_service_default, @@ -280,10 +290,10 @@ tftpboot and httpboot setup, please include ::ironic::pxe") include ::ironic::pxe - $tftp_root_real = pick($::ironic::pxe::common::tftp_root, $tftp_root) - $http_root_real = pick($::ironic::pxe::common::http_root, $http_root) - $http_port_real = pick($::ironic::pxe::common::http_port, $http_port) - $ipxe_timeout_real = pick($::ironic::pxe::common::ipxe_timeout, $ipxe_timeout) + $tftp_root_real = pick($::ironic::pxe::common::tftp_root, $tftp_root) + $http_root_real = pick($::ironic::pxe::common::http_root, $http_root) + $http_port_real = pick($::ironic::pxe::common::http_port, $http_port) + $ipxe_timeout_real = pick($::ironic::pxe::common::ipxe_timeout, $ipxe_timeout) file { '/etc/ironic-inspector/inspector.conf': ensure => 'present', diff --git a/releasenotes/notes/make-inspector_pxelinux_cfg-configurable-fb1d39933770c70d.yaml b/releasenotes/notes/make-inspector_pxelinux_cfg-configurable-fb1d39933770c70d.yaml new file mode 100644 index 00000000..59b76986 --- /dev/null +++ b/releasenotes/notes/make-inspector_pxelinux_cfg-configurable-fb1d39933770c70d.yaml @@ -0,0 +1,5 @@ +--- +features: + - add kernel_filename and ramdisk_filename parameters in inspector_pxelinux_cfg + and inspector_ipxelinux_cfg erb tempaltes to make kernel and ramdisk filename + configurable in tftp ipxelinux_cfg and pxelinux_cfg files. diff --git a/templates/inspector_ipxe.erb b/templates/inspector_ipxe.erb index a4cd2b4f..c80e299a 100644 --- a/templates/inspector_ipxe.erb +++ b/templates/inspector_ipxe.erb @@ -2,6 +2,6 @@ :retry_boot imgfree -kernel <% if @ipxe_timeout_real != "0" %>--timeout <%= Integer(@ipxe_timeout_real) * 1000 %> <% end %>http://<%= @dnsmasq_local_ip %>:<%= @http_port_real %>/agent.kernel ipa-inspection-callback-url=http://<%= @dnsmasq_local_ip %>:5050/v1/continue ipa-inspection-collectors=<%= @ramdisk_collectors %> systemd.journald.forward_to_console=yes BOOTIF=${mac} <%= @ramdisk_kernel_args %> initrd=agent.ramdisk || goto retry_boot -initrd <% if @ipxe_timeout_real != "0" %>--timeout <%= Integer(@ipxe_timeout_real) * 1000 %> <% end %>http://<%= @dnsmasq_local_ip %>:<%= @http_port_real %>/agent.ramdisk || goto retry_boot +kernel <% if @ipxe_timeout_real != "0" %>--timeout <%= Integer(@ipxe_timeout_real) * 1000 %> <% end %>http://<%= @dnsmasq_local_ip %>:<%= @http_port_real %>/<%= @kernel_filename %> ipa-inspection-callback-url=http://<%= @dnsmasq_local_ip %>:5050/v1/continue ipa-inspection-collectors=<%= @ramdisk_collectors %> systemd.journald.forward_to_console=yes BOOTIF=${mac} <%= @ramdisk_kernel_args %> initrd=<%= @ramdisk_filename %> || goto retry_boot +initrd <% if @ipxe_timeout_real != "0" %>--timeout <%= Integer(@ipxe_timeout_real) * 1000 %> <% end %>http://<%= @dnsmasq_local_ip %>:<%= @http_port_real %>/<%= @ramdisk_filename %> || goto retry_boot boot diff --git a/templates/inspector_pxelinux_cfg.erb b/templates/inspector_pxelinux_cfg.erb index 0e5c27b5..dea8ec73 100644 --- a/templates/inspector_pxelinux_cfg.erb +++ b/templates/inspector_pxelinux_cfg.erb @@ -1,6 +1,6 @@ default inspector label inspector -kernel agent.kernel -append initrd=agent.ramdisk ipa-inspection-callback-url=http://<%= @dnsmasq_local_ip %>:5050/v1/continue ipa-inspection-collectors=<%= @ramdisk_collectors %> systemd.journald.forward_to_console=yes <%= @ramdisk_kernel_args %> +kernel <%= @kernel_filename %> +append initrd=<%= @ramdisk_filename %> ipa-inspection-callback-url=http://<%= @dnsmasq_local_ip %>:5050/v1/continue ipa-inspection-collectors=<%= @ramdisk_collectors %> systemd.journald.forward_to_console=yes <%= @ramdisk_kernel_args %> ipappend 3