diff --git a/manifests/pxe.pp b/manifests/pxe.pp index 797391f4..0f1cd5b7 100644 --- a/manifests/pxe.pp +++ b/manifests/pxe.pp @@ -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', diff --git a/releasenotes/notes/tftp-bind-ip-0a042cd836dd53f9.yaml b/releasenotes/notes/tftp-bind-ip-0a042cd836dd53f9.yaml new file mode 100644 index 00000000..ce80b2ac --- /dev/null +++ b/releasenotes/notes/tftp-bind-ip-0a042cd836dd53f9.yaml @@ -0,0 +1,4 @@ +--- +features: + - New option "tftp_bind_host" added to specify + IP address TFTP will bind too diff --git a/spec/classes/ironic_pxe_spec.rb b/spec/classes/ironic_pxe_spec.rb index 936577eb..3ce617ac 100644 --- a/spec/classes/ironic_pxe_spec.rb +++ b/spec/classes/ironic_pxe_spec.rb @@ -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