Ensure correct tftp directory ownership for Ironic

Ironic is currently unable to create tftp files due to tftp directory
being owned by the root user. Ironic is also unable to cache images
due to root ownership. This patch corrects both issues by setting the
proper ownership and moves /var/lib/ironic to /mnt/state/

Change-Id: Ia24b09cab88359de56ce4fa662f5f301835b91dd
This commit is contained in:
Chris Krelle 2014-01-24 13:03:39 -08:00
parent 0f3f64d0fd
commit d147980b8c
2 changed files with 9 additions and 1 deletions

View File

@ -13,9 +13,10 @@ else
exit 1 exit 1
fi fi
# create tftp directory # create tftpboot and cache directories
install -d -m 0744 -o ironic -g ironic /tftpboot/pxelinux.cfg/ install -d -m 0744 -o ironic -g ironic /tftpboot/pxelinux.cfg/
install -o ironic -g ironic -m 744 $pxe_zero /tftpboot/pxelinux.0 install -o ironic -g ironic -m 744 $pxe_zero /tftpboot/pxelinux.0
install -d -m 0744 -o ironic -g ironic /mnt/state/var/lib/ironic
# Disable the tftp-hpa upstart job, we're using xinetd # Disable the tftp-hpa upstart job, we're using xinetd
[ -f /etc/init/tftpd-hpa.conf ] && echo "manual" > /etc/init/tftpd-hpa.override [ -f /etc/init/tftpd-hpa.conf ] && echo "manual" > /etc/init/tftpd-hpa.override
@ -36,3 +37,6 @@ EOF
# Adds support for tftp requests that don't include the directory name. # Adds support for tftp requests that don't include the directory name.
echo 'r ^([^/]) /tftpboot/\1' > /tftpboot/map-file 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

@ -21,3 +21,7 @@ auth_uri = http://{{keystone.host}}:5000/v2.0
[glance] [glance]
host={{glance.host}} host={{glance.host}}
[pxe]
images_path=/mnt/state/var/lib/ironic/images/
instance_master_path=/mnt/state/var/lib/ironic/master_images