Add Ironic iPXE support
Change-Id: Id9793e92ddf5b46e2913bf19f56df235c1f4bb87
This commit is contained in:
parent
1f555641d2
commit
7f0fa32c4e
|
@ -10,3 +10,4 @@ RUN useradd --user-group --create-home --home-dir /var/lib/ironic ironic \
|
|||
&& cp -r /ironic/etc/ironic/* /etc/ironic/ \
|
||||
&& chown -R ironic: /etc/ironic /var/lib/ironic /var/log/ironic
|
||||
|
||||
RUN usermod -a -G microservices ironic
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
FROM {{ image_spec("ironic-base") }}
|
||||
MAINTAINER {{ maintainer }}
|
||||
|
||||
RUN apt-get install -y --no-install-recommends \
|
||||
nginx-light \
|
||||
&& apt-get clean
|
||||
|
||||
RUN rm /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default \
|
||||
&& chown -R ironic: /etc/nginx /var/lib/nginx /var/log/nginx
|
||||
|
||||
USER ironic
|
|
@ -6,6 +6,7 @@ RUN apt-get install -y --no-install-recommends \
|
|||
syslinux-common \
|
||||
syslinux \
|
||||
pxelinux \
|
||||
ipxe \
|
||||
&& apt-get clean
|
||||
|
||||
COPY tftp-map-file /map-file
|
||||
|
|
|
@ -17,6 +17,11 @@ configs:
|
|||
enabled_drivers: "fake,agent_ssh,agent_ipmitool_socat"
|
||||
swift_temp_url_key: password
|
||||
|
||||
ipxe:
|
||||
enable: true
|
||||
external_port: 32480
|
||||
use_swift: false
|
||||
|
||||
sources:
|
||||
openstack/ironic:
|
||||
git_url: https://github.com/openstack/ironic.git
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p /var/lib/ironic/httpboot
|
||||
chown -R ironic: /var/lib/ironic
|
|
@ -76,3 +76,14 @@ temp_url_endpoint_type = radosgw
|
|||
pxe_append_params = nofb nomodeset vga=normal console=ttyS0 systemd.journald.forward_to_console=yes ipa-debug=1
|
||||
tftp_root = /var/lib/ironic/tftpboot
|
||||
tftp_master_path = /var/lib/ironic/tftpboot/master_images
|
||||
|
||||
{% if ironic.ipxe.enable %}
|
||||
ipxe_enabled = True
|
||||
ipxe_use_swift = {{ ironic.ipxe.use_swift }}
|
||||
pxe_bootfile_name=undionly.kpxe
|
||||
pxe_config_template=$pybasedir/drivers/modules/ipxe_config.template
|
||||
|
||||
[deploy]
|
||||
http_root=/var/lib/ironic/httpboot
|
||||
http_url=http://{{ network_topology["private"]["address"] }}:{{ ironic.ipxe.external_port }}
|
||||
{% endif %}
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
server {
|
||||
listen {{ network_topology["private"]["address"] }}:8080;
|
||||
root /var/lib/ironic/httpboot;
|
||||
}
|
|
@ -6,6 +6,7 @@ cp \
|
|||
/usr/lib/PXELINUX/pxelinux.0 \
|
||||
/usr/lib/syslinux/modules/bios/chain.c32 \
|
||||
/usr/lib/syslinux/modules/bios/ldlinux.c32 \
|
||||
/usr/lib/ipxe/undionly.kpxe \
|
||||
/var/lib/ironic/tftpboot
|
||||
|
||||
chown -R ironic:ironic /var/lib/ironic
|
||||
chown -R ironic: /var/lib/ironic
|
||||
|
|
|
@ -18,6 +18,9 @@ service:
|
|||
dependencies:
|
||||
- ironic-db-sync
|
||||
- ironic-pxe:local
|
||||
# {% if ironic.ipxe.enable %}
|
||||
- ironic-ipxe
|
||||
# {% endif %}
|
||||
files:
|
||||
ironic.conf:
|
||||
path: /etc/ironic/ironic.conf
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
service:
|
||||
name: ironic-ipxe
|
||||
ports:
|
||||
- "8080:{{ ironic.ipxe.external_port }}"
|
||||
containers:
|
||||
- name: ironic-ipxe
|
||||
image: ironic-ipxe
|
||||
probes:
|
||||
readiness: "true"
|
||||
liveness: "true"
|
||||
volumes:
|
||||
- name: ironic
|
||||
type: host
|
||||
path: /var/lib/ironic
|
||||
pre:
|
||||
- name: ipxe-bootstrap
|
||||
command: /opt/ccp/bin/ipxe-bootstrap.sh
|
||||
daemon:
|
||||
command: nginx -g 'daemon off; error_log stderr; pid /var/lib/nginx/nginx.pid;'
|
||||
files:
|
||||
- ipxe-bootstrap.sh
|
||||
- nginx-ipxe.conf
|
||||
files:
|
||||
ipxe-bootstrap.sh:
|
||||
path: /opt/ccp/bin/ipxe-bootstrap.sh
|
||||
content: ipxe-bootstrap.sh
|
||||
perm: "0755"
|
||||
nginx-ipxe.conf:
|
||||
path: /etc/nginx/sites-enabled/nginx-ipxe.conf
|
||||
content: nginx-ipxe.conf.j2
|
||||
perm: "0644"
|
Loading…
Reference in New Issue