Add tftp configuration for ironic

Expose the tftp configuration to support tftp, disable by default.

Change-Id: I9175e420a3def4cf10e95701c235bbae999b6505
Closes-bug: #1446972
This commit is contained in:
wenchma 2015-04-23 10:38:50 +08:00
parent a2245c593a
commit a515f81feb
3 changed files with 30 additions and 3 deletions

View File

@ -69,6 +69,15 @@ default['openstack']['bare-metal']['service_role'] = 'service'
default['openstack']['bare-metal']['user'] = 'ironic'
default['openstack']['bare-metal']['group'] = 'ironic'
# Setup the tftp variables
default['openstack']['bare-metal']['tftp']['enabled'] = false
# IP address of Ironic compute node's tftp server
default['openstack']['bare-metal']['tftp']['server'] = '127.0.0.1'
# Ironic compute node's tftp root path
default['openstack']['bare-metal']['tftp']['root_path'] = '/var/lib/tftpboot'
# Directory where master tftp images are stored on disk
default['openstack']['bare-metal']['tftp']['master_path'] = "#{node['openstack']['bare-metal']['tftp']['root_path']}/master_images"
# rootwrap.conf
default['openstack']['bare-metal']['rootwrap']['filters_path'] = '/etc/ironic/rootwrap.d,/usr/share/ironic/rootwrap'
default['openstack']['bare-metal']['rootwrap']['exec_dirs'] = '/sbin,/usr/sbin,/bin,/usr/bin'

View File

@ -97,6 +97,22 @@ describe 'openstack-bare-metal::ironic-common' do
end
end
context 'tftp' do
before do
node.set['openstack']['bare-metal']['tftp']['enabled'] = true
end
it 'sets tftp attributes' do
[
/^tftp_server=127.0.0.1$/,
%r(^tftp_root=/var/lib/tftpboot$),
%r(^tftp_master_path=/var/lib/tftpboot/master_images$)
].each do |line|
expect(chef_run).to render_config_file(file.name).with_section_content('pxe', line)
end
end
end
context 'rabbit mq backend' do
before do
node.set['openstack']['mq']['bare-metal']['service_type'] = 'rabbitmq'

View File

@ -1229,16 +1229,18 @@ signing_dir=<%= node['openstack']['bare-metal']['api']['auth']['cache_dir'] %>
# (string value)
#uefi_pxe_config_template=$pybasedir/drivers/modules/elilo_efi_pxe_config.template
<% if node['openstack']['bare-metal']['tftp']['enabled'] %>
# IP address of Ironic compute node's tftp server. (string
# value)
#tftp_server=$my_ip
tftp_server=<%= node['openstack']['bare-metal']['tftp']['server'] %>
# Ironic compute node's tftp root path. (string value)
#tftp_root=/tftpboot
tftp_root=<%= node['openstack']['bare-metal']['tftp']['root_path'] %>
# Directory where master tftp images are stored on disk.
# (string value)
#tftp_master_path=/tftpboot/master_images
tftp_master_path=<%= node['openstack']['bare-metal']['tftp']['master_path'] %>
<% end %>
# Bootfile DHCP parameter. (string value)
#pxe_bootfile_name=pxelinux.0