From 271da81d458ecb92c17a613b354e73e6c06f8ff6 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Mon, 4 Jan 2016 13:13:58 +0100 Subject: [PATCH] Enable changing list of inspection collectors Inspection collectors are IPA plugins that collect additional information for inspection. This patch allow changing their list, with default remaining the same (for now). Change-Id: I1e5ea1cd5ee24872375cd53d3eebf14b1082d874 --- manifests/inspector.pp | 5 +++++ spec/classes/ironic_inspector_spec.rb | 6 ++++++ templates/inspector_ipxe.erb | 2 +- templates/inspector_pxelinux_cfg.erb | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/manifests/inspector.pp b/manifests/inspector.pp index 98b625be..dc7829e3 100644 --- a/manifests/inspector.pp +++ b/manifests/inspector.pp @@ -130,6 +130,10 @@ # Enable dbsync # Defaults to true # +# [*ramdisk_collectors*] +# Comma-separated list of IPA inspection collectors +# Defaults to 'default' +# class ironic::inspector ( $package_ensure = 'present', $enabled = true, @@ -159,6 +163,7 @@ class ironic::inspector ( $dnsmasq_ip_range = '192.168.0.100,192.168.0.120', $dnsmasq_local_ip = '192.168.0.1', $sync_db = true, + $ramdisk_collectors = 'default', ) { include ::ironic::params diff --git a/spec/classes/ironic_inspector_spec.rb b/spec/classes/ironic_inspector_spec.rb index dccd155a..9fd8839e 100644 --- a/spec/classes/ironic_inspector_spec.rb +++ b/spec/classes/ironic_inspector_spec.rb @@ -118,6 +118,9 @@ describe 'ironic::inspector' do 'require' => 'Package[ironic-inspector]', 'content' => /default/, ) + is_expected.to contain_file('/tftpboot/pxelinux.cfg/default').with_content( + /initrd=agent.ramdisk ipa-inspection-callback-url=http:\/\/192.168.0.1:5050\/v1\/continue ipa-inspection-collectors=default/ + ) end it 'should contain directory /tftpboot with selinux type tftpdir_t' do is_expected.to contain_file('/tftpboot').with( @@ -164,6 +167,9 @@ describe 'ironic::inspector' do 'require' => 'Package[ironic-inspector]', '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/ + ) end end end diff --git a/templates/inspector_ipxe.erb b/templates/inspector_ipxe.erb index d5129f30..957626e8 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 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} initrd http://<%= @dnsmasq_local_ip %>:8088/agent.ramdisk boot diff --git a/templates/inspector_pxelinux_cfg.erb b/templates/inspector_pxelinux_cfg.erb index f25c4c7c..8730ea7e 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 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 ipappend 3