Use ironic::pxe class to setup PXE

We should use puppet-ironic ironic::pxe class instead
of setting up PXE in ipxe element.

Depends-on: I8b83eff694316755e4dd2dbcde7b569472893bc5
Change-Id: I6c012f7d473c7c2433a6b03d9f8e06a76200458c
This commit is contained in:
Lukas Bezdicka 2016-07-22 12:59:22 +02:00 committed by Dmitry Tantsur
parent e24929102c
commit e0a5293c2a
8 changed files with 1 additions and 115 deletions

View File

@ -1,23 +0,0 @@
#!/bin/bash
set -eux
set -o pipefail
ironic_http_port=$(hiera ironic_ipxe_port)
# Create the apache vHOST for Ironic
mkdir -p /etc/httpd/conf.d
sed "s/IRONIC_HTTP_PORT/$ironic_http_port/" $(dirname $0)/ipxe-vhost.template \
> /etc/httpd/conf.d/10-ipxe_vhost.conf
systemctl restart httpd || :
[ -x /usr/sbin/semanage ] || exit 0
semanage fcontext -a -t httpd_sys_content_t "/httpboot(/.*)?"
restorecon -Rv /httpboot/
# Try to delete port if present
semanage port -d -t http_port_t -p tcp $ironic_http_port || true
# Add port
semanage port -a -t http_port_t -p tcp $ironic_http_port

View File

@ -1,10 +0,0 @@
#!/bin/bash
set -eux
set -o pipefail
mkdir -p /httpboot
chown ironic:ironic -R /httpboot
# Copy the iPXE binaries to the TFTP directory for chainloading
install -o ironic -g ironic -m 744 /usr/share/ipxe/undionly.kpxe /tftpboot/undionly.kpxe
install -o ironic -g ironic -m 744 /usr/share/ipxe/ipxe.efi /tftpboot/ipxe.efi

View File

@ -1,16 +0,0 @@
Listen IRONIC_HTTP_PORT
<VirtualHost *:IRONIC_HTTP_PORT>
DocumentRoot "/httpboot"
<Directory "/httpboot">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
Require all granted
</Directory>
## Logging
ErrorLog "/var/log/httpd/ironic_error.log"
ServerSignature Off
CustomLog "/var/log/httpd/ironic_access.log" combined
</VirtualHost>

View File

@ -1,3 +0,0 @@
apache2:
default: apache2
redhat: httpd

View File

@ -418,6 +418,7 @@ include ::ironic::drivers::ipmi
include ::ironic::drivers::pxe
include ::ironic::drivers::ssh
include ::ironic::inspector
include ::ironic::pxe
if str2bool(hiera('enable_tempest', true)) {
# tempest

View File

@ -1,61 +0,0 @@
#!/bin/bash
set -eux
set -o pipefail
# setup tftp directory structure
if [ -f /usr/lib/syslinux/pxelinux.0 ]; then
# Ubuntu
pxe_zero="/usr/lib/syslinux/pxelinux.0"
elif [ -f /usr/share/syslinux/pxelinux.0 ]; then
# Fedora/RHEL
pxe_zero="/usr/share/syslinux/pxelinux.0"
else
echo "Failed to find pxelinux.0."
exit 1
fi
# create tftpboot and cache directories
install -d -m 0755 -o ironic -g ironic /tftpboot/pxelinux.cfg/
install -o ironic -g ironic -m 744 $pxe_zero /tftpboot/pxelinux.0
# for newer syslinux versions we may need to copy in the library
# modules as well (Fedora 21 for example)
if [ -f /usr/share/syslinux/ldlinux.* ]; then
# Fedora/RHEL
cp /usr/share/syslinux/ldlinux.* /tftpboot
fi
# Copy in the chain loader for full disk image booting.
syslinux='/usr/share/syslinux'
for f in chain.c32 libcom32.c32 libutil.c32; do
if [ -f $syslinux/$f ]; then
cp $syslinux/$f /tftpboot
fi
done
# Disable the tftp-hpa upstart job, we're using xinetd
[ -f /etc/init/tftpd-hpa.conf ] && echo "manual" > /etc/init/tftpd-hpa.override
# Disable the tftpd-hpa SysV script for the same reason
[ -f /etc/init.d/tftpd-hpa ] && update-rc.d -f tftpd-hpa disable
cat > /etc/xinetd.d/tftp << EOF
service tftp
{
protocol = udp
port = 69
socket_type = dgram
wait = yes
user = root
server = /usr/sbin/in.tftpd
server_args = --map-file /tftpboot/map-file /tftpboot
disable = no
flags = IPv4
}
EOF
# Adds support for tftp requests that don't include the directory name.
echo 'r ^([^/]) /tftpboot/\1' > /tftpboot/map-file
# ensure tftpboot dir and all files in it are owned by ironic user
chown ironic:ironic -R /tftpboot

View File

@ -6,7 +6,6 @@
"undercloud-install",
"enable-packages-install",
"element-manifest",
"ipxe",
"puppet-stack-config"
],
"hook": [

View File

@ -6,7 +6,6 @@
"undercloud-install",
"enable-packages-install",
"element-manifest",
"ipxe",
"puppet-stack-config"
],
"hook": [