Configuration Tasks

Version 13 (Nikos Skalkotos, 05/10/2012 05:23 pm)

1 1 Nikos Skalkotos
h1. Configuration Tasks
2 1 Nikos Skalkotos
3 7 Nikos Skalkotos
Configuration tasks are scripts called by snf-image-helper, to accomplish various configuration steps on the newly created instance. See below for a description of each one of them:
4 7 Nikos Skalkotos
5 8 Nikos Skalkotos
*FixPartitionTable*: Enlarges the last partition in the partition table of the instance, to consume all the available space. For now, only primary partitions are supported.
6 1 Nikos Skalkotos
7 8 Nikos Skalkotos
*FilesystemResizeUnmounted*: Extends the file system of the last partition to cover up the whole partition. This only works for ext{2,3,4} file systems. Any other file system type is ignored and a warning is triggered. The task will fail if @SNF_IMAGE_DEV@ environmental variable is missing.
8 8 Nikos Skalkotos
 
9 8 Nikos Skalkotos
*MountImage*: Mounts the nth partition of @SNF_IMAGE_DEV@, which is specified by @SNF_IMAGE_PROPERTY_ROOT_PARTITION@ variable under the directory specified by @SNF_IMAGE_TARGET@. The script will fail if any of those 3 variables has a non-sane value.
10 8 Nikos Skalkotos
11 9 Nikos Skalkotos
*DeleteSSHKeys*: For linux images, this script will clear out any ssh keys found in the image and for debian, it will recreate them too. In order to find the ssh keys, the script looks in default locations (@/etc/ssh/ssh_*_key@) and also parses @/etc/ssh/sshd_config@ file if present. The script will fail if @SNF_IMAGE_TARGET@ is not set.
12 1 Nikos Skalkotos
13 9 Nikos Skalkotos
*DisableRemoteDesktopConnections*: This script temporary disables RDP connections in windows instances by changing the value fDenyTSConnection registry key. RDP connections will be enabled back during the specialize pass of the Windows setup. The task will fail if @SNF_IMAGE_TARGET@ is not defined.
14 9 Nikos Skalkotos
15 9 Nikos Skalkotos
*InstallUnattend*: Installs the Unattend.xml files in windows images. This is needed by windows in order to perform an unattended setup. The @SNF_IMAGE_TARGET@ variables needs to be present for this task to run.
16 9 Nikos Skalkotos
17 12 Nikos Skalkotos
*SELinuxAutorelabel*: Creates .autorelabel file in RedHat images. This is needed if SELinux is enabled to enforce an automatic file system relabeling at the next boot. The only enviromental variable required by this task is @SNF_IMAGE_TARGET@.
18 10 Nikos Skalkotos
19 10 Nikos Skalkotos
*AssignHostname*: Assigns or changes the hostname in a Linux or Windows image. The task will fail if the Linux distribution is not supported. For now, we support debian, redhat, slackware, suse and gentoo derived distros. The hostname is read from @SNF_IMAGE_HOSTNAME@ variable. In addition to the latter, @SNF_IMAGE_TARGET@ is also required.
20 10 Nikos Skalkotos
21 11 Nikos Skalkotos
*ChangePassword*: Changes the password for a list of users. For Linux systems this is accomplished by directly altering the image's @/etc/shadow@ file. For Windows systems a script is injected into the VM's hard disk. This script will be executed during the specialize pass of the Windows setup. The list of users whose passwords will changed is determined by the @SNF_IMAGE_PROPERTY_USERS@ variable (see [[Image Format#Image-Properties|here]]). For this task to run @SNF_IMAGE_TARGET@ and @SNF_IMAGE_PASSWORD@ variables need to be present.
22 1 Nikos Skalkotos
23 13 Nikos Skalkotos
*EnforcePersonality*: Injects the files specified by the @SNF_IMAGE_PROPERTY_OSFAMILY@ variable into the file system. If the variable is missing a warning is produced. The only environmental variable required is @SNF_IMAGE_TARGET@.
24 12 Nikos Skalkotos
25 1 Nikos Skalkotos
*FilesystemResizeMounted*: Injects a script into a Windows image file system that will enlarge the last file system to cover up the whole partition. The script will run during the specialize pass of the Windows setup. If the @SNF_IMAGE_TARGET@ variable is missing, the task will fail.
26 13 Nikos Skalkotos
27 13 Nikos Skalkotos
*UmountImage*: Umounts the file system previously mounted by @MountImage@. The only environmental variable required is @SNF_IMAGE_TARGET@.
28 2 Nikos Skalkotos
29 6 Nikos Skalkotos
|_/2=.Name|_/2=.Pr.|_\2=.Dependencies|_\2=.Enviromental Variables ^1^|
30 1 Nikos Skalkotos
|_.Run-After|_.Run-Before|_.Required|_.Optional|
31 6 Nikos Skalkotos
|FixPartitionTable|10||FilesystemResizeUnmounted|@DEV@||
32 6 Nikos Skalkotos
|FilesystemResizeUnmounted|20|FixPartitionTable|MountImage|@DEV@||
33 6 Nikos Skalkotos
|MountImage|30||UmountImage|@DEV@
34 6 Nikos Skalkotos
@TARGET@
35 6 Nikos Skalkotos
@PROPERTY_ROOT_PARTITION@||
36 6 Nikos Skalkotos
|DeleteSSHKeys|40|MountImage|UmountImage|@TARGET@|@PROPERTY_OSFAMILY@|
37 6 Nikos Skalkotos
|DisableRemoteDesktopConnections|40|MountImage|UmountImage|@TARGET@|@PROPERTY_OSFAMILY@|
38 6 Nikos Skalkotos
|InstallUnattend|40|MountImage|UmountImage|@TARGET@|@PROPERTY_OSFAMILY@|
39 6 Nikos Skalkotos
|SELinuxAutorelabel|40|MountImage|UmountImage|@TARGET@|@PROPERTY_OSFAMILY@|
40 6 Nikos Skalkotos
|AssignHostname|50|InstallUnattend|UmountImage|@TARGET@
41 6 Nikos Skalkotos
@HOSTNAME@|@PROPERTY_OSFAMILY@|
42 6 Nikos Skalkotos
|ChangePassword|50|InstallUnattend|UmountImage|@TARGET@
43 6 Nikos Skalkotos
@PASSWORD@|@PROPERTY_USERS@
44 6 Nikos Skalkotos
@PROPERTY_OSFAMILY@|
45 6 Nikos Skalkotos
|EnforcePersonality|50|DeleteSSHKeys|UmountImage|@TARGET@|@PERSONALITY@
46 6 Nikos Skalkotos
@PROPERTY_OSFAMILY@|
47 6 Nikos Skalkotos
|FilesystemResizeMounted|50|InstallUnattend|UmountImage|@TARGET@|@PROPERTY_OSFAMILY@|
48 6 Nikos Skalkotos
|UmountImage|80|MountImage||@TARGET@||
49 6 Nikos Skalkotos
50 6 Nikos Skalkotos
^1: all enviromental variables are prefixed with SNF_IMAGE_^