From 5704275b694435ba3fda4e8bd2516e00344ff2d0 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Tue, 16 Feb 2016 13:31:28 +0100 Subject: [PATCH] [inspector] allow sending random kernel arguments to the IPA IPA accepts plenty of kernel arguments, adding all them explicitly may be not practical. New option ramdisk_kernel_args allows to set a string to append to the kernel command line when booting IPA. The first use case that comes to my mind is ipa-inspection-benchmarks option, enabling benchmarking during inspection. Change-Id: Id6bb8f38beb299e72fb5ab0e4d9a89ac00a47df2 --- manifests/inspector.pp | 5 +++++ spec/classes/ironic_inspector_spec.rb | 3 ++- templates/inspector_ipxe.erb | 2 +- templates/inspector_pxelinux_cfg.erb | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/manifests/inspector.pp b/manifests/inspector.pp index 65b6756d..f379f484 100644 --- a/manifests/inspector.pp +++ b/manifests/inspector.pp @@ -138,6 +138,10 @@ # Comma-separated list of processing hooks to append to the default list. # Defaults to undef # +# [*ramdisk_kernel_args*] +# String with kernel arguments to send to the ramdisk on boot. +# Defaults to undef +# class ironic::inspector ( $package_ensure = 'present', $enabled = true, @@ -169,6 +173,7 @@ class ironic::inspector ( $sync_db = true, $ramdisk_collectors = 'default', $additional_processing_hooks = undef, + $ramdisk_kernel_args = undef, ) { include ::ironic::params diff --git a/spec/classes/ironic_inspector_spec.rb b/spec/classes/ironic_inspector_spec.rb index 658dd8c5..76863948 100644 --- a/spec/classes/ironic_inspector_spec.rb +++ b/spec/classes/ironic_inspector_spec.rb @@ -143,6 +143,7 @@ describe 'ironic::inspector' do :swift_auth_url => 'http://192.168.0.1:5000/v2.0', :pxe_transfer_protocol => 'http', :additional_processing_hooks => 'hook1,hook2', + :ramdisk_kernel_args => 'foo=bar', ) end it 'should replace default parameter with new value' do @@ -171,7 +172,7 @@ describe 'ironic::inspector' do 'content' => /ipxe/, ) is_expected.to contain_file('/httpboot/inspector.ipxe').with_content( - /kernel http:\/\/192.168.0.1:8088\/agent.kernel ipa-inspection-callback-url=http:\/\/192.168.0.1:5050\/v1\/continue ipa-inspection-collectors=default/ + /kernel http:\/\/192.168.0.1:8088\/agent.kernel ipa-inspection-callback-url=http:\/\/192.168.0.1:5050\/v1\/continue ipa-inspection-collectors=default.* foo=bar/ ) end end diff --git a/templates/inspector_ipxe.erb b/templates/inspector_ipxe.erb index 957626e8..9f7a7930 100644 --- a/templates/inspector_ipxe.erb +++ b/templates/inspector_ipxe.erb @@ -2,6 +2,6 @@ dhcp -kernel http://<%= @dnsmasq_local_ip %>:8088/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} +kernel http://<%= @dnsmasq_local_ip %>:8088/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 http://<%= @dnsmasq_local_ip %>:8088/agent.ramdisk boot diff --git a/templates/inspector_pxelinux_cfg.erb b/templates/inspector_pxelinux_cfg.erb index 8730ea7e..0e5c27b5 100644 --- a/templates/inspector_pxelinux_cfg.erb +++ b/templates/inspector_pxelinux_cfg.erb @@ -2,5 +2,5 @@ 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 +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 %> ipappend 3