Add bootstrap task for ironic-pxe
PXE files should be copied after volume mount to avoid overwrite. Change-Id: I023cc316e6873abd658478dfa05be839e44a80c7 Closes-bug: #1538164
This commit is contained in:
parent
9da034dc0a
commit
5855a07212
@ -52,3 +52,20 @@
|
||||
run_once: True
|
||||
delegate_to: "{{ groups['ironic-api'][0] }}"
|
||||
when: database_created
|
||||
|
||||
- name: Running Ironic-PXE bootstrap container
|
||||
kolla_docker:
|
||||
action: "start_container"
|
||||
common_options: "{{ docker_common_options }}"
|
||||
detach: False
|
||||
environment:
|
||||
KOLLA_BOOTSTRAP:
|
||||
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
||||
image: "{{ ironic_pxe_image_full }}"
|
||||
name: "bootstrap_ironic_pxe"
|
||||
restart_policy: "never"
|
||||
volumes:
|
||||
- "{{ node_config_directory }}/ironic-pxe/:{{ container_config_directory }}/:ro"
|
||||
- "ironic-pxe:/tftpboot/"
|
||||
run_once: True
|
||||
delegate_to: "{{ groups['ironic-pxe'][0] }}"
|
||||
|
@ -6,9 +6,7 @@ MAINTAINER {{ maintainer }}
|
||||
RUN yum -y install \
|
||||
tftp-server \
|
||||
syslinux-tftpboot \
|
||||
&& yum clean all \
|
||||
&& mkdir -p /tftpboot \
|
||||
&& cp /var/lib/tftpboot/chain.c32 /tftpboot
|
||||
&& yum clean all
|
||||
|
||||
{% elif base_distro in ['ubuntu', 'debian'] %}
|
||||
|
||||
@ -16,13 +14,12 @@ RUN apt-get install -y --no-install-recommends \
|
||||
tftpd-hpa \
|
||||
syslinux-common \
|
||||
syslinux \
|
||||
&& apt-get clean \
|
||||
&& mkdir -p /tftpboot \
|
||||
&& chown -R ironic: /tftpboot \
|
||||
&& cp /usr/lib/syslinux/pxelinux.0 /usr/lib/syslinux/chain.c32 /tftpboot
|
||||
&& apt-get clean
|
||||
|
||||
{% endif %}
|
||||
|
||||
COPY tftp-map-file /map-file
|
||||
COPY extend_start.sh /usr/local/bin/kolla_extend_start
|
||||
RUN chmod 755 /usr/local/bin/kolla_extend_start
|
||||
|
||||
{{ include_footer }}
|
||||
|
14
docker/ironic/ironic-pxe/extend_start.sh
Normal file
14
docker/ironic/ironic-pxe/extend_start.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
|
||||
# of the KOLLA_BOOTSTRAP variable being set, including empty.
|
||||
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
|
||||
chown -R ironic: /tftpboot
|
||||
for pxe_file in /var/lib/tftpboot/chain.c32 /usr/lib/syslinux/pxelinux.0 /usr/lib/syslinux/chain.c32; do
|
||||
if [[ -e "$pxe_file" ]]; then
|
||||
cp "$pxe_file" /tftpboot
|
||||
fi
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user