Merge "pxe: Support more flexible configurations of apache vhost"
This commit is contained in:
@@ -91,23 +91,38 @@
|
|||||||
# (optional) Set up Apache HTTP Server.
|
# (optional) Set up Apache HTTP Server.
|
||||||
# Defaults to true
|
# Defaults to true
|
||||||
#
|
#
|
||||||
|
# [*vhost_priority*]
|
||||||
|
# (Optional) The priority for the vhost.
|
||||||
|
# Defaults to 10
|
||||||
|
#
|
||||||
|
# [*vhost_options*]
|
||||||
|
# (Optional) Set the options for the spefieid virtual host.
|
||||||
|
# Defaults to ['-Indexes', '+FollowSymLinks']
|
||||||
|
#
|
||||||
|
# [*vhost_config*]
|
||||||
|
# (Optional) Additional parameters passed to the apache::vhost defined type.
|
||||||
|
# Defaults to {}
|
||||||
|
#
|
||||||
class ironic::pxe (
|
class ironic::pxe (
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
Boolean $manage_service = true,
|
Boolean $manage_service = true,
|
||||||
Boolean $enabled = true,
|
Boolean $enabled = true,
|
||||||
$tftp_root = '/tftpboot',
|
$tftp_root = '/tftpboot',
|
||||||
$http_root = '/httpboot',
|
$http_root = '/httpboot',
|
||||||
$http_port = 8088,
|
$http_port = 8088,
|
||||||
$pxelinux_path = $::ironic::params::pxelinux_path,
|
$pxelinux_path = $::ironic::params::pxelinux_path,
|
||||||
$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,
|
||||||
$ipxe_name_base = $::ironic::params::ipxe_name_base,
|
$ipxe_name_base = $::ironic::params::ipxe_name_base,
|
||||||
$uefi_ipxe_bootfile_name = $::ironic::params::uefi_ipxe_bootfile_name,
|
$uefi_ipxe_bootfile_name = $::ironic::params::uefi_ipxe_bootfile_name,
|
||||||
$uefi_pxe_bootfile_name = $::ironic::params::uefi_pxe_bootfile_name,
|
$uefi_pxe_bootfile_name = $::ironic::params::uefi_pxe_bootfile_name,
|
||||||
Boolean $tftp_use_xinetd = $::ironic::params::xinetd_available,
|
Boolean $tftp_use_xinetd = $::ironic::params::xinetd_available,
|
||||||
$dnsmasq_log_facility = undef,
|
$dnsmasq_log_facility = undef,
|
||||||
Boolean $manage_http_server = true,
|
Boolean $manage_http_server = true,
|
||||||
|
$vhost_priority = 10,
|
||||||
|
Array[String] $vhost_options = ['-Indexes', '+FollowSymLinks'],
|
||||||
|
Hash $vhost_config = {},
|
||||||
) inherits ironic::params {
|
) inherits ironic::params {
|
||||||
|
|
||||||
include ironic::deps
|
include ironic::deps
|
||||||
@@ -162,7 +177,7 @@ class ironic::pxe (
|
|||||||
tag => ['openstack', 'ironic-ipxe', 'ironic-support-package'],
|
tag => ['openstack', 'ironic-ipxe', 'ironic-support-package'],
|
||||||
}
|
}
|
||||||
|
|
||||||
$options = "--map-file ${tftp_root_real}/map-file"
|
$tftp_options = "--map-file ${tftp_root_real}/map-file"
|
||||||
|
|
||||||
include xinetd
|
include xinetd
|
||||||
|
|
||||||
@@ -170,7 +185,7 @@ class ironic::pxe (
|
|||||||
port => '69',
|
port => '69',
|
||||||
bind => $tftp_bind_host,
|
bind => $tftp_bind_host,
|
||||||
protocol => 'udp',
|
protocol => 'udp',
|
||||||
server_args => "${options} ${tftp_root_real}",
|
server_args => "${tftp_options} ${tftp_root_real}",
|
||||||
server => '/usr/sbin/in.tftpd',
|
server => '/usr/sbin/in.tftpd',
|
||||||
socket_type => 'dgram',
|
socket_type => 'dgram',
|
||||||
cps => '100 2',
|
cps => '100 2',
|
||||||
@@ -347,11 +362,13 @@ class ironic::pxe (
|
|||||||
|
|
||||||
include apache
|
include apache
|
||||||
|
|
||||||
apache::vhost { 'ipxe_vhost':
|
create_resources(apache::vhost, {
|
||||||
priority => 10,
|
'ipxe_vhost' => {
|
||||||
options => ['-Indexes', '+FollowSymLinks'],
|
'priority' => $vhost_priority,
|
||||||
docroot => $http_root_real,
|
'options' => $vhost_options,
|
||||||
port => $http_port_real,
|
'docroot' => $http_root_real,
|
||||||
}
|
'port' => $http_port_real,
|
||||||
|
}
|
||||||
|
}, $vhost_config)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The following parameters have been added to the ``ironic::pxe`` class, to
|
||||||
|
allow more flexible configurations of the virtual host serving image files.
|
||||||
|
|
||||||
|
- ``vhost_priority``
|
||||||
|
- ``vhost_options``
|
||||||
|
- ``vhost_config``
|
@@ -130,6 +130,11 @@ describe 'ironic::pxe' do
|
|||||||
:http_root => '/var/www/httpboot',
|
:http_root => '/var/www/httpboot',
|
||||||
:http_port => 3816,
|
:http_port => 3816,
|
||||||
:tftp_bind_host => '1.2.3.4',
|
:tftp_bind_host => '1.2.3.4',
|
||||||
|
:vhost_priority => 20,
|
||||||
|
:vhost_options => ['Indexes', '+FollowSymLinks'],
|
||||||
|
:vhost_config => {
|
||||||
|
'ssl' => true,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -202,10 +207,11 @@ describe 'ironic::pxe' do
|
|||||||
it 'should configure http server' do
|
it 'should configure http server' do
|
||||||
is_expected.to contain_class('apache')
|
is_expected.to contain_class('apache')
|
||||||
is_expected.to contain_apache__vhost('ipxe_vhost').with(
|
is_expected.to contain_apache__vhost('ipxe_vhost').with(
|
||||||
:priority => 10,
|
:priority => 20,
|
||||||
:options => ['-Indexes', '+FollowSymLinks'],
|
:options => ['Indexes', '+FollowSymLinks'],
|
||||||
:docroot => '/var/www/httpboot',
|
:docroot => '/var/www/httpboot',
|
||||||
:port => 3816,
|
:port => 3816,
|
||||||
|
:ssl => true,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user