Add support for configuring ppc64le nodes
The aim of this change to the enable puppet-ironic as used by tripleo to configure ironic and the tftp services in a way that "just works" with tripleo. It adds the ability to tweak ironic's command retry and spacing values as well as creating architecture specific config and bootfile mappings Blueprint: multiarch-support Change-Id: Ia64dd21b55474d402315ba7c05e28604fff3aea8
This commit is contained in:
@@ -24,8 +24,14 @@
|
|||||||
# Should be an interger value
|
# Should be an interger value
|
||||||
# Defaults to $::os_service_default
|
# Defaults to $::os_service_default
|
||||||
#
|
#
|
||||||
|
# [*min_command_interval*]
|
||||||
|
# (optional) Minimum time, in seconds, between IPMI operations.
|
||||||
|
# Should be an interger value
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
class ironic::drivers::ipmi (
|
class ironic::drivers::ipmi (
|
||||||
$command_retry_timeout = $::os_service_default,
|
$command_retry_timeout = $::os_service_default,
|
||||||
|
$min_command_interval = $::os_service_default,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::ironic::deps
|
include ::ironic::deps
|
||||||
@@ -33,6 +39,7 @@ class ironic::drivers::ipmi (
|
|||||||
# Configure ironic.conf
|
# Configure ironic.conf
|
||||||
ironic_config {
|
ironic_config {
|
||||||
'ipmi/command_retry_timeout': value => $command_retry_timeout;
|
'ipmi/command_retry_timeout': value => $command_retry_timeout;
|
||||||
|
'ipmi/min_command_interval': value => $min_command_interval;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,6 +77,10 @@
|
|||||||
# Should be an valid integer
|
# Should be an valid integer
|
||||||
# Defaults to $::os_service_default.
|
# Defaults to $::os_service_default.
|
||||||
#
|
#
|
||||||
|
# [*enable_ppc64le*]
|
||||||
|
# (optional) Boolean value to dtermine if ppc64le support should be enabled
|
||||||
|
# Defaults to false (no ppc64le support)
|
||||||
|
#
|
||||||
class ironic::drivers::pxe (
|
class ironic::drivers::pxe (
|
||||||
$ipxe_enabled = false,
|
$ipxe_enabled = false,
|
||||||
$pxe_append_params = $::os_service_default,
|
$pxe_append_params = $::os_service_default,
|
||||||
@@ -90,6 +94,7 @@ class ironic::drivers::pxe (
|
|||||||
$uefi_pxe_bootfile_name = $::os_service_default,
|
$uefi_pxe_bootfile_name = $::os_service_default,
|
||||||
$uefi_pxe_config_template = $::os_service_default,
|
$uefi_pxe_config_template = $::os_service_default,
|
||||||
$ipxe_timeout = $::os_service_default,
|
$ipxe_timeout = $::os_service_default,
|
||||||
|
$enable_ppc64le = false,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::ironic::deps
|
include ::ironic::deps
|
||||||
@@ -121,4 +126,15 @@ class ironic::drivers::pxe (
|
|||||||
'pxe/ipxe_timeout': value => $ipxe_timeout_real;
|
'pxe/ipxe_timeout': value => $ipxe_timeout_real;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $enable_ppc64le {
|
||||||
|
# FXIME(tonyb): As these are really hash values it would beter to model
|
||||||
|
# them that way. We can do that later, probably when we add another
|
||||||
|
# architecture
|
||||||
|
ironic_config {
|
||||||
|
# NOTE(tonyb): This first value shouldn't be needed but seems to be?
|
||||||
|
'pxe/pxe_config_template_by_arch': value => "ppc64le:${pxe_config_template_real}";
|
||||||
|
'pxe/pxe_bootfile_name_by_arch': value => 'ppc64le:config';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -221,6 +221,10 @@
|
|||||||
# Requires node_not_found_hook set to "enroll".
|
# Requires node_not_found_hook set to "enroll".
|
||||||
# Defaults to $::os_service_default
|
# Defaults to $::os_service_default
|
||||||
#
|
#
|
||||||
|
# [*enable_ppc64le*]
|
||||||
|
# (optional) Boolean value to dtermine if ppc64le support should be enabled
|
||||||
|
# Defaults to false (no ppc64le support)
|
||||||
|
#
|
||||||
class ironic::inspector (
|
class ironic::inspector (
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
$enabled = true,
|
$enabled = true,
|
||||||
@@ -268,6 +272,7 @@ class ironic::inspector (
|
|||||||
$http_root = '/httpboot',
|
$http_root = '/httpboot',
|
||||||
$node_not_found_hook = $::os_service_default,
|
$node_not_found_hook = $::os_service_default,
|
||||||
$discovery_default_driver = $::os_service_default,
|
$discovery_default_driver = $::os_service_default,
|
||||||
|
$enable_ppc64le = false,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::ironic::deps
|
include ::ironic::deps
|
||||||
@@ -310,6 +315,16 @@ class ironic::inspector (
|
|||||||
content => template('ironic/inspector_pxelinux_cfg.erb'),
|
content => template('ironic/inspector_pxelinux_cfg.erb'),
|
||||||
require => Anchor['ironic-inspector::config::begin'],
|
require => Anchor['ironic-inspector::config::begin'],
|
||||||
}
|
}
|
||||||
|
if $enable_ppc64le {
|
||||||
|
file { "${tftp_root_real}/ppc64le/default":
|
||||||
|
ensure => 'present',
|
||||||
|
seltype => 'tftpdir_t',
|
||||||
|
owner => 'ironic-inspector',
|
||||||
|
group => 'ironic-inspector',
|
||||||
|
content => template('ironic/inspector_pxelinux_cfg.erb'),
|
||||||
|
require => Anchor['ironic-inspector::config::begin'],
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if $pxe_transfer_protocol == 'http' {
|
if $pxe_transfer_protocol == 'http' {
|
||||||
|
|||||||
@@ -47,6 +47,10 @@
|
|||||||
# (optional) The IP address xinetd will listen on for TFTP.
|
# (optional) The IP address xinetd will listen on for TFTP.
|
||||||
# Defaults to undef (listen on all ip addresses).
|
# Defaults to undef (listen on all ip addresses).
|
||||||
#
|
#
|
||||||
|
# [*enable_ppc64le*]
|
||||||
|
# (optional) Boolean value to dtermine if ppc64le support should be enabled
|
||||||
|
# Defaults to false (no ppc64le support)
|
||||||
|
#
|
||||||
class ironic::pxe (
|
class ironic::pxe (
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
$tftp_root = '/tftpboot',
|
$tftp_root = '/tftpboot',
|
||||||
@@ -55,6 +59,7 @@ class ironic::pxe (
|
|||||||
$syslinux_path = $::ironic::params::syslinux_path,
|
$syslinux_path = $::ironic::params::syslinux_path,
|
||||||
$syslinux_files = $::ironic::params::syslinux_files,
|
$syslinux_files = $::ironic::params::syslinux_files,
|
||||||
$tftp_bind_host = undef,
|
$tftp_bind_host = undef,
|
||||||
|
$enable_ppc64le = false,
|
||||||
) inherits ::ironic::params {
|
) inherits ::ironic::params {
|
||||||
|
|
||||||
include ::ironic::deps
|
include ::ironic::deps
|
||||||
@@ -86,6 +91,16 @@ class ironic::pxe (
|
|||||||
require => Anchor['ironic::install::end'],
|
require => Anchor['ironic::install::end'],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $enable_ppc64le {
|
||||||
|
file { "${tftp_root_real}/ppc64le":
|
||||||
|
ensure => 'directory',
|
||||||
|
seltype => 'tftpdir_t',
|
||||||
|
owner => 'ironic',
|
||||||
|
group => 'ironic',
|
||||||
|
require => Anchor['ironic::install::end'],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
file { $http_root_real:
|
file { $http_root_real:
|
||||||
ensure => 'directory',
|
ensure => 'directory',
|
||||||
seltype => 'httpd_sys_content_t',
|
seltype => 'httpd_sys_content_t',
|
||||||
|
|||||||
@@ -37,14 +37,17 @@ describe 'ironic::drivers::ipmi' do
|
|||||||
|
|
||||||
it 'configures ironic.conf' do
|
it 'configures ironic.conf' do
|
||||||
is_expected.to contain_ironic_config('ipmi/command_retry_timeout').with_value('<SERVICE DEFAULT>')
|
is_expected.to contain_ironic_config('ipmi/command_retry_timeout').with_value('<SERVICE DEFAULT>')
|
||||||
|
is_expected.to contain_ironic_config('ipmi/min_command_interval').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when overriding parameters' do
|
context 'when overriding parameters' do
|
||||||
before do
|
before do
|
||||||
params.merge!(:command_retry_timeout => '50')
|
params.merge!(:command_retry_timeout => '50')
|
||||||
|
params.merge!(:min_command_interval => '5')
|
||||||
end
|
end
|
||||||
it 'should replace default parameter with new value' do
|
it 'should replace default parameter with new value' do
|
||||||
is_expected.to contain_ironic_config('ipmi/command_retry_timeout').with_value('50')
|
is_expected.to contain_ironic_config('ipmi/command_retry_timeout').with_value('50')
|
||||||
|
is_expected.to contain_ironic_config('ipmi/min_command_interval').with_value('5')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,19 @@ describe 'ironic::drivers::pxe' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when overriding only enable_ppc64le' do
|
||||||
|
before do
|
||||||
|
params.merge!(
|
||||||
|
:enable_ppc64le => true,
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'detects correct ppc64le parameters' do
|
||||||
|
is_expected.to contain_ironic_config('pxe/pxe_config_template_by_arch').with_value('ppc64le:$pybasedir/drivers/modules/pxe_config.template')
|
||||||
|
is_expected.to contain_ironic_config('pxe/pxe_bootfile_name_by_arch').with_value('ppc64le:config')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'when overriding parameters' do
|
context 'when overriding parameters' do
|
||||||
before do
|
before do
|
||||||
params.merge!(
|
params.merge!(
|
||||||
|
|||||||
@@ -264,6 +264,37 @@ describe 'ironic::inspector' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when enabling ppc64le support' do
|
||||||
|
let :pre_condition do
|
||||||
|
"class { 'ironic::inspector::authtoken': password => 'password', }
|
||||||
|
class { 'ironic::pxe': enable_ppc64le => true, }"
|
||||||
|
end
|
||||||
|
|
||||||
|
before do
|
||||||
|
params.merge!(
|
||||||
|
:enable_ppc64le => true,
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should contain file /etc/ironic-inspector/dnsmasq.conf' do
|
||||||
|
is_expected.to contain_file('/etc/ironic-inspector/dnsmasq.conf').with_content(
|
||||||
|
/dhcp-match=set:ppc64le,option:client-arch,14/)
|
||||||
|
end
|
||||||
|
it 'should contain file /tftpboot/ppc64le/default' do
|
||||||
|
is_expected.to contain_file('/tftpboot/ppc64le/default').with(
|
||||||
|
'owner' => 'ironic-inspector',
|
||||||
|
'group' => 'ironic-inspector',
|
||||||
|
'seltype' => 'tftpdir_t',
|
||||||
|
'ensure' => 'present',
|
||||||
|
'require' => 'Anchor[ironic-inspector::config::begin]',
|
||||||
|
'content' => /default/,
|
||||||
|
)
|
||||||
|
is_expected.to contain_file('/tftpboot/ppc64le/default').with_content(
|
||||||
|
/initrd=agent.ramdisk ipa-inspection-callback-url=http:\/\/192.168.0.1:5050\/v1\/continue ipa-inspection-collectors=default/
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
|
|||||||
@@ -139,6 +139,23 @@ describe 'ironic::pxe' do
|
|||||||
is_expected.not_to contain_file('/tftpboot/pxelinux.0')
|
is_expected.not_to contain_file('/tftpboot/pxelinux.0')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when enabling ppc64le support' do
|
||||||
|
before :each do
|
||||||
|
params.merge!(
|
||||||
|
:enable_ppc64le => true,
|
||||||
|
)
|
||||||
|
end
|
||||||
|
it 'should contain directory /tftpboot/ppc64le with selinux type tftpdir_t' do
|
||||||
|
is_expected.to contain_file('/tftpboot/ppc64le').with(
|
||||||
|
'owner' => 'ironic',
|
||||||
|
'group' => 'ironic',
|
||||||
|
'require' => 'Anchor[ironic::install::end]',
|
||||||
|
'ensure' => 'directory',
|
||||||
|
'seltype' => 'tftpdir_t',
|
||||||
|
)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
on_supported_os({
|
on_supported_os({
|
||||||
|
|||||||
@@ -26,3 +26,10 @@ dhcp-sequential-ip
|
|||||||
<% if @dnsmasq_dhcp_hostsdir %>
|
<% if @dnsmasq_dhcp_hostsdir %>
|
||||||
dhcp-hostsdir=<%= @dnsmasq_dhcp_hostsdir %>
|
dhcp-hostsdir=<%= @dnsmasq_dhcp_hostsdir %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<% if @enable_ppc64le -%>
|
||||||
|
# Client is ppc64le (OPAL) box and doesn't need a chain loader, but does need a custom config
|
||||||
|
dhcp-match=set:ppc64le,option:client-arch,14
|
||||||
|
dhcp-boot=tag:ppc64le,
|
||||||
|
dhcp-option=tag:ppc64le, 210,<%= @tftp_root_real %>/ppc64le/
|
||||||
|
dhcp-option=tag:ppc64le, 209,default
|
||||||
|
<% end -%>
|
||||||
|
|||||||
Reference in New Issue
Block a user