bifrost/playbooks/roles/bifrost-ironic-install/tasks/create_tftpboot.yml
Julia Kreger c1f9beac63 Initial support for installation of ironic-inspector
This review adds the ironic-inspector as a component that can be
opted to be installed by the user.  Note, this is moderately useless
without shade support and modules to assist the users to leverage
this workflow.

If a user wishes to utilize at this time before those items exist
then they will have to move nodes in available state back to
manageable state, and then invoke the inspect state which will
return them to manageable state once done.

Change-Id: I7b4ff92fa27578a9a7b0f25fc6e8658c3f2700aa
implements: blueprint bifrost-inspector-support
Depends-On: I27caa1122a72ac655958b7a6aa14b7566964f998
2015-12-01 16:08:55 -05:00

64 lines
2.8 KiB
YAML

# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
- name: "Set up PXE and iPXE folders"
file: name={{item}} owner=ironic group=ironic state=directory
with_items:
- /tftpboot
- /tftpboot/pxelinux.cfg
- "{{ http_boot_folder }}"
- "{{ http_boot_folder }}/pxelinux.cfg"
- name: "Place tftpd map-file"
copy: src=tftpboot-map-file dest=/tftpboot/map-file owner=ironic group=ironic
- name: "Disable service tftpd-hpa"
service: name=tftpd-hpa state=stopped enabled=no
- name: "Set pxelinux.0 source (for Ubuntu >=14.10)"
set_fact:
syslinux_tftp_dir: '/usr/lib/PXELINUX'
when: ansible_distribution == 'Ubuntu' and ansible_distribution_version|version_compare('14.10', '>=')
- name: "Determine if pxelinux.0 is in place"
stat: path=/tftpboot/pxelinux.0
register: test_pxelinux
- name: "Place pxelinux.0"
copy: src={{ syslinux_tftp_dir }}/pxelinux.0 dest=/tftpboot
when: test_pxelinux.stat.exists == false
- name: "Place boot.ipxe helper script /etc/ironic"
copy: src=boot.ipxe dest=/etc/ironic/boot.ipxe owner=ironic group=ironic mode=0744
- name: "Pre-stage boot.ipxe into /httpboot/"
copy: src=boot.ipxe dest=/httpboot/boot.ipxe owner=ironic group=ironic mode=0744
- name: "Place tftp config file"
copy: src=xinetd.tftp dest=/etc/xinetd.d/tftp
- name: "Copy iPXE image into place"
copy: src={{ ipxe_dir }}/undionly.kpxe dest=/tftpboot/
# NOTE(TheJulia): Copy full iPXE chain loader images in case they are required.
- name: "Copy full iPXE image into /httpboot"
copy: src={{ ipxe_dir }}/{{ ipxe_full_binary }} dest=/httpboot/
- name: "Copy full iPXE image into /tftpboot"
copy: src={{ ipxe_dir }}/{{ ipxe_full_binary }} dest=/tftpboot/
# Similar logic to below can be utilized to retrieve files
- name: "Determine if folder exists, else create and populate folder."
stat: path=/tftpboot/master_images
register: test_master_images
- name: "Create master_images folder"
file: name=/tftpboot/master_images state=directory owner=ironic group=ironic
when: test_master_images.stat.exists == false
- name: "Inspector - Place default tftp boot file in {{ http_boot_folder}}/pxelinux.cfg/"
template:
src=inspector-default-boot-ipxe.j2
dest="{{ http_boot_folder }}/pxelinux.cfg/default"
owner=ironic
group=ironic
when: enable_inspector | bool