Commit f9fa7979 authored by Nikos Skalkotos's avatar Nikos Skalkotos

Support EXCLUDE_FilesystemResize_TASKS property

This image property can be used to prevent all 3 FilesystemResize
tasks (FilesystemResizeUnmounted, FilesystemResizeMounted,
FilesystemResizeAfterUmount) from running without having to define
an EXCLUDE_TASK image property for each one of them.
parent 88dbf393
......@@ -229,16 +229,21 @@ All image formats properties
:ref:`Configuration Tasks Environment<configuration-tasks-environment>`.
* **EXCLUDE_ALL_TASKS=yes**
If this property is defined with a value other than null, then during the
deployment, the image will not be configured at all. This is really handy
because it gives the ability to deploy images hosting operating systems
whose configuration is not supported by *snf-image*.
If this property is defined with a yes value, the image will not be
configured at all, during the deployment. This is really handy because it
gives the ability to deploy images hosting operating systems whose
configuration is not supported by *snf-image*.
* **EXCLUDE_MOUNTED_TASKS=yes**
If this property is defined, then only the tasks that are meant to run
before the VM's disk gets mounted (namely *FixPartitionTable* and
*FilesystemResizeUmounted*) will be allowed to run during deployment.
* **EXCLUDE_FilesystemResize_TASKS=yes**
If this property is defined with a yes value, the 3 filesystem resize tasks
(*FilesystemResizeUnmounted*, *FilesystemResizeMounted*,
*FilesystemResizeAfterUmount*) will be prevented from running.
* **EXCLUDE_TASK_<task_name>=yes**
This family of properties gives the ability to exclude individual
configuration tasks from running. Hence, if the property
......
......@@ -1152,6 +1152,15 @@ check_if_mounted_excluded() {
return 0
}
check_if_filesystem_resize_excluded() {
if check_yes_no SNF_IMAGE_PROPERTY_EXCLUDE_FILESYSTEMRESIZE_TASKS; then
warn "Task ${PROGNAME:2} was excluded and will not run."
exit 0
fi
return 0
}
check_if_overwritten() {
local script ret
......
......@@ -29,8 +29,10 @@ set -e
trap task_cleanup EXIT
report_task_start
# Check if the task should be prevented from running.
check_if_excluded
check_if_filesystem_resize_excluded
if [ ! -b "$SNF_IMAGE_DEV" ]; then
log_error "Device file:\`${SNF_IMAGE_DEV}' is not a block device"
......
......@@ -33,6 +33,7 @@ report_task_start
# Check if the task should be prevented from running.
check_if_excluded
check_if_mounted_excluded
check_if_filesystem_resize_excluded
if [ ! -d "$SNF_IMAGE_TARGET" ]; then
log_error "Target directory \`$SNF_IMAGE_TARGET' is missing"
......
......@@ -31,6 +31,7 @@ trap task_cleanup EXIT
report_task_start
# Check if the task should be prevented from running.
check_if_excluded
check_if_filesystem_resize_excluded
if [ ! -b "$SNF_IMAGE_DEV" ]; then
log_error "Device file:\`${SNF_IMAGE_DEV}' is not a block device"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment