Merge "Add an option to specify the tftp bind host IP"

This commit is contained in:
Zuul 2017-12-15 17:43:40 +00:00 committed by Gerrit Code Review
commit 3d1bea1800
3 changed files with 16 additions and 0 deletions

View File

@ -43,6 +43,10 @@
# (optional) Array of PXE boot files to copy from $syslinux_path to $tftp_root.
# Defaults to '$::ironic::params::syslinux_files'
#
# [*tftp_bind_host*]
# (optional) The IP address xinetd will listen on for TFTP.
# Defaults to undef (listen on all ip addresses).
#
class ironic::pxe (
$package_ensure = 'present',
$tftp_root = '/tftpboot',
@ -50,6 +54,7 @@ class ironic::pxe (
$http_port = '8088',
$syslinux_path = $::ironic::params::syslinux_path,
$syslinux_files = $::ironic::params::syslinux_files,
$tftp_bind_host = undef,
) inherits ::ironic::params {
include ::ironic::deps
@ -101,6 +106,7 @@ class ironic::pxe (
xinetd::service { 'tftp':
port => '69',
bind => $tftp_bind_host,
protocol => 'udp',
server_args => "${options} ${tftp_root_real}",
server => '/usr/sbin/in.tftpd',

View File

@ -0,0 +1,4 @@
---
features:
- New option "tftp_bind_host" added to specify
IP address TFTP will bind too

View File

@ -76,6 +76,7 @@ describe 'ironic::pxe' do
:tftp_root => '/var/lib/tftpboot',
:http_root => '/var/www/httpboot',
:http_port => 3816,
:tftp_bind_host => '1.2.3.4',
)
end
@ -119,6 +120,11 @@ describe 'ironic::pxe' do
'backup' => false,
)
end
it 'should setup tftp xinetd service' do
is_expected.to contain_xinetd__service('tftp').with(
'bind' => '1.2.3.4',
)
end
end
context 'when excluding syslinux' do
before :each do