Merge "pxe: Allow disabling http server"
This commit is contained in:
commit
6f50d93cf8
|
@ -87,6 +87,10 @@
|
||||||
# (optional) Log facility of the dnsmasq process to server tftp server.
|
# (optional) Log facility of the dnsmasq process to server tftp server.
|
||||||
# Defaults to undef
|
# Defaults to undef
|
||||||
#
|
#
|
||||||
|
# [*manage_http_server*]
|
||||||
|
# (optional) Set up Apache HTTP Server.
|
||||||
|
# Defaults to true
|
||||||
|
#
|
||||||
class ironic::pxe (
|
class ironic::pxe (
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
$manage_service = true,
|
$manage_service = true,
|
||||||
|
@ -103,6 +107,7 @@ class ironic::pxe (
|
||||||
$uefi_pxe_bootfile_name = 'bootx64.efi',
|
$uefi_pxe_bootfile_name = 'bootx64.efi',
|
||||||
$tftp_use_xinetd = $::ironic::params::xinetd_available,
|
$tftp_use_xinetd = $::ironic::params::xinetd_available,
|
||||||
$dnsmasq_log_facility = undef,
|
$dnsmasq_log_facility = undef,
|
||||||
|
$manage_http_server = true,
|
||||||
) inherits ironic::params {
|
) inherits ironic::params {
|
||||||
|
|
||||||
include ironic::deps
|
include ironic::deps
|
||||||
|
@ -146,15 +151,6 @@ class ironic::pxe (
|
||||||
tag => 'ironic-tftp-file',
|
tag => 'ironic-tftp-file',
|
||||||
}
|
}
|
||||||
|
|
||||||
file { $http_root_real:
|
|
||||||
ensure => 'directory',
|
|
||||||
seltype => 'httpd_sys_content_t',
|
|
||||||
owner => $::ironic::params::user,
|
|
||||||
group => $::ironic::params::group,
|
|
||||||
require => Anchor['ironic::config::begin'],
|
|
||||||
before => Anchor['ironic::config::end'],
|
|
||||||
}
|
|
||||||
|
|
||||||
if $tftp_use_xinetd {
|
if $tftp_use_xinetd {
|
||||||
if ! $::ironic::params::xinetd_available {
|
if ! $::ironic::params::xinetd_available {
|
||||||
fail('xinetd is not available in this distro. Please use tftp_use_xinetd=false')
|
fail('xinetd is not available in this distro. Please use tftp_use_xinetd=false')
|
||||||
|
@ -338,12 +334,24 @@ class ironic::pxe (
|
||||||
|
|
||||||
File["${tftp_root_real}"] -> File<| tag == 'ironic-tftp-file' |>
|
File["${tftp_root_real}"] -> File<| tag == 'ironic-tftp-file' |>
|
||||||
|
|
||||||
include apache
|
# HTTP server
|
||||||
|
if $manage_http_server {
|
||||||
|
file { $http_root_real:
|
||||||
|
ensure => 'directory',
|
||||||
|
seltype => 'httpd_sys_content_t',
|
||||||
|
owner => $::ironic::params::user,
|
||||||
|
group => $::ironic::params::group,
|
||||||
|
require => Anchor['ironic::config::begin'],
|
||||||
|
before => Anchor['ironic::config::end'],
|
||||||
|
}
|
||||||
|
|
||||||
apache::vhost { 'ipxe_vhost':
|
include apache
|
||||||
priority => 10,
|
|
||||||
options => ['Indexes','FollowSymLinks'],
|
apache::vhost { 'ipxe_vhost':
|
||||||
docroot => $http_root_real,
|
priority => 10,
|
||||||
port => $http_port_real,
|
options => ['Indexes','FollowSymLinks'],
|
||||||
|
docroot => $http_root_real,
|
||||||
|
port => $http_port_real,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The ``ironic::pxe::manage_http_server`` parameter has been added. When
|
||||||
|
this parameter is set to ``false``, the ``ironic::pxe`` class does not
|
||||||
|
manage the Apache HTTP Server.
|
|
@ -223,6 +223,18 @@ describe 'ironic::pxe' do
|
||||||
is_expected.not_to contain_file('/var/lib/ironic/tftpboot/chain.c32')
|
is_expected.not_to contain_file('/var/lib/ironic/tftpboot/chain.c32')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'when http server disabled' do
|
||||||
|
before :each do
|
||||||
|
params.merge!(
|
||||||
|
:manage_http_server => false,
|
||||||
|
)
|
||||||
|
end
|
||||||
|
it 'should not configure http server' do
|
||||||
|
is_expected.not_to contain_class('apache')
|
||||||
|
is_expected.not_to contain_apache__vhost('ipxe_vhost')
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
shared_examples_for 'ironic pxe with xinetd' do
|
shared_examples_for 'ironic pxe with xinetd' do
|
||||||
|
|
Loading…
Reference in New Issue