Merge "iPXE: retry on failure during introspection"

This commit is contained in:
Jenkins 2016-05-03 16:10:58 +00:00 committed by Gerrit Code Review
commit 3b80104354
3 changed files with 27 additions and 5 deletions

View File

@ -146,6 +146,10 @@
# String with kernel arguments to send to the ramdisk on boot.
# Defaults to undef
#
# [*ipxe_timeout*]
# (optional) ipxe timeout in second. Should be an integer.
# Defaults to '0' for unlimited.
#
class ironic::inspector (
$package_ensure = 'present',
$enabled = true,
@ -179,6 +183,7 @@ class ironic::inspector (
$ramdisk_collectors = 'default',
$additional_processing_hooks = undef,
$ramdisk_kernel_args = undef,
$ipxe_timeout = 0,
) {
include ::ironic::params

View File

@ -44,7 +44,8 @@ describe 'ironic::inspector' do
:swift_tenant_name => 'services',
:swift_auth_url => 'http://127.0.0.1:5000/v2.0',
:dnsmasq_ip_range => '192.168.0.100,192.168.0.120',
:dnsmasq_local_ip => '192.168.0.1', }
:dnsmasq_local_ip => '192.168.0.1',
:ipxe_timeout => 0, }
end
let :params do
@ -181,7 +182,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.* foo=bar/
/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 || goto retry_boot/
)
end
it 'should contain iPXE chainload images' do
@ -196,6 +197,19 @@ describe 'ironic::inspector' do
'backup' => false,
)
end
context 'when ipxe_timeout is set' do
before :each do
params.merge!(
:ipxe_timeout => 30,
)
end
it 'should contain file /httpboot/inspector.ipxe' do
is_expected.to contain_file('/httpboot/inspector.ipxe').with_content(
/kernel --timeout 30000/)
end
end
end
end

View File

@ -1,7 +1,10 @@
#!ipxe
dhcp
:retry_dhcp
dhcp || goto retry_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} <%= @ramdisk_kernel_args %> initrd=agent.ramdisk
initrd http://<%= @dnsmasq_local_ip %>:8088/agent.ramdisk
:retry_boot
imgfree
kernel <% if @ipxe_timeout != "0" %>--timeout <%= Integer(@ipxe_timeout) * 1000 %> <% end %>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=agent.ramdisk || goto retry_boot
initrd <% if @ipxe_timeout != "0" %>--timeout <%= Integer(@ipxe_timeout) * 1000 %> <% end %>http://<%= @dnsmasq_local_ip %>:8088/agent.ramdisk || goto retry_boot
boot