no message

master
Brie Bruns 2018-05-13 21:06:03 -06:00
parent bb27d1254e
commit c70599ffb8
2 changed files with 9 additions and 3 deletions

View File

@ -7,4 +7,4 @@ config:
subnets:
- type: dhcp
- type: nameserver
search: [%%DOMAIN%%]
search: [%DOMAIN%]

View File

@ -131,7 +131,9 @@ if [[ ${virt_netinfo_type} == "eni" ]]; then
echo " gateway ${virt_netinfo_gateway}" >> ${WORKING_DIR}/output/meta-data
fi
elif [[ $virt_netinfo_type == "1" ]]; then
echo "Not implemented yet!"
if [[ ${virt_netinfo_address} == "dhcp" ]]; then
sed -e "s/%DOMAIN%/${domain}/" ${WORKING_DIR}/network/network-config-dhcp-v1 > ${WORKING_DIR}/output/network-config
extra_iso_files=" -map $WORKING_DIR/output/network-config network-config"
elif [[ $virt_netinfo_type == "2" ]]; then
echo "Not implemented yet!"
fi
@ -156,12 +158,16 @@ fi
# write the two cloud-init files into an ISO
echo "Preparing ISO file required by cloud-init..."
#genisoimage -input-charset utf8 -output configuration.iso -volid cidata -joliet -rock user-data meta-data
xorriso -in_charset utf8 -outdev configuration.iso -volid cidata -joliet on -rockridge on -map output/user-data user-data -map output/meta-data meta-data
xorriso -in_charset utf8 -outdev configuration.iso -volid cidata -joliet on -rockridge on -map output/user-data user-data -map output/meta-data meta-data ${extra_iso_files}
# keep a backup of the files for future reference
if [[ "${BACKUP_ISO_FILES}" == "yes" ]]; then
cp -f ${WORKING_DIR}/output/user-data ${WORKING_DIR}/backups/${hostname}.${domain}.user-data
cp -f ${WORKING_DIR}/output/meta-data ${WORKING_DIR}/backups/${hostname}.${domain}.meta-data
if [[ -f ${WORKING_DIR}/output/network-config ]]; then
cp -f ${WORKING_DIR}/output/network-config ${WORKING_DIR}/backups/${hostname}.${domain}.network-config
chmod 640 ${WORKING_DIR}/backups/${hostname}.${domain}.network-config
fi
chmod 640 ${WORKING_DIR}/backups/${hostname}.${domain}.user-data ${WORKING_DIR}/backups/${hostname}.${domain}.meta-data
fi
# copy ISO into libvirt's directory