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
This commit is contained in:
Dmitry Tantsur 2016-01-04 13:13:58 +01:00
parent 401a1e1449
commit 271da81d45
4 changed files with 13 additions and 2 deletions

View File

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

View File

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

View File

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

View File

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