Make kernel and ramdisk filename configurable

This patch add two params in inspector_pxelinux_cfg template,
to make kernel and ramdisk filename configurable.

Change-Id: I5a421cd6135d001763e4d83da778ab33e5b1baca
This commit is contained in:
Xingchao Yu 2017-04-27 08:57:10 +08:00
parent fc2adf7fb8
commit 6071888f14
4 changed files with 23 additions and 8 deletions

View File

@ -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',

View File

@ -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.

View File

@ -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

View File

@ -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