Add configurable option for Ironic master tftp images path

By design, Ironic will be making hardlinks from /var/lib/ironic/master_images
into /httpboot. On a machine where /var is on a separate partition, deployment
will succeed but operation will fail with some errors like:

OSError: [Errno 18] Invalid cross-device link

in ironic conductor logs. This patch adds an extra configuration
variable which allows the user to configure the path location
properly and to overcome this issue.

Change-Id: If90b49c75ff1a224d8d539036b89c1c7ee030bd0
This commit is contained in:
Olivier Bourdon 2018-06-20 11:32:39 +02:00
parent e43045e13a
commit d2fff1abe2
4 changed files with 5 additions and 4 deletions

View File

@ -5,6 +5,6 @@
become: yes
gather_facts: yes
tasks:
- file: path=/tftpboot/master_images state=absent
- file: path="{{ironic_tftp_master_path}}" state=absent
- file: path="{{ipa_kernel}}" state=absent
- file: path="{{ipa_ramdisk}}" state=absent

View File

@ -3,6 +3,7 @@
# which causes the nodes to be wiped after deletion.
cleaning: false
http_boot_folder: /httpboot
ironic_tftp_master_path: /var/lib/ironic/master_images
staging_drivers_include: false
file_url_port: "8080"
ironicclient_source_install: false

View File

@ -65,11 +65,11 @@
# 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
stat: path="{{ ironic_tftp_master_path }}"
register: test_master_images
- name: "Create master_images folder"
file: name=/tftpboot/master_images state=directory owner=ironic group=ironic
file: name="{{ ironic_tftp_master_path }}" 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/"

View File

@ -43,7 +43,7 @@ tftp_root = /tftpboot
pxe_bootfile_name = undionly.kpxe
ipxe_enabled = true
ipxe_boot_script = /etc/ironic/boot.ipxe
tftp_master_path = /var/lib/ironic/master_images
tftp_master_path = {{ ironic_tftp_master_path }}
[deploy]
http_url = http://{{ hostvars[inventory_hostname]['ansible_' + ans_network_interface]['ipv4']['address'] }}:{{ file_url_port }}/