The Stacki XML framework is called Wire. To explain how wire is structured, we first have to understand the process of installation of a backend node.
When the anaconda installer performs the OS installation, it does it in the following order:
Network setup – The installer then configures the network with IP address, netmask, and gateway information
Kickstart Retrieval – The installer retrieves a kickstart file from the frontend that provides it with instructions on how to proceed with the installation.
Main section – The installer configures timezones, root passwords, etc. This section typically includes Kickstart directives.
Pre section – This section consists of instructions to be run before the partitioning, and package installation. This typically is used to setup the installer environment so that partitioning may be changed. This section is typically coded in shell, or python.
Disk setup and partitioning – Next, the installer configures the disks attached to the system, partitions them, formats them and makes them available to the installer.
Package Installation – This section contains a list of packages to be installed on the system.
Post Section – This section consists of instructions to be run after package installation. This section may be coded in any interpreted language that is available on the installed system.
Pre-boot Section – This section is run on first-boot before any services or daemons are started.
Post-Boot Section – This section is a collection of shell scripts that are run on first-boot after all services and daemons have started. This is typically used to run scripts that interact with system daemons, or to finish and clean-up the installation process.
To extend backend node functionality, the sections most likely to require modifications are the package section and the post sections.
The Stacki Wire XML framework supports the following tags.
This tag allows the admin to run scripts in the installer before the package installation, and disk configuration is done. Internally, Stacki uses this section to configure disk controllers, and partitions.
<pre> cat /proc/partitions > /tmp/partitions.state </pre>
<package>httpd</package> <package meta="1">gnome-desktop</package>
meta="1" attribute informs the installer that the package is a group package.
This tag allows the admin to run scripts after the package installation is done. The scripts can be in any interpreted language present on the installed system.
chkconfigto enable the Apache web server:
<post> /sbin/chkconfig --enable httpd </post>
<post interpreter="/opt/rocks/bin/python"> import os, sys import subprocess p = subprocess.Popen(['/sbin/chkconfig','--enable','httpd']) rc = p.wait() if rc != 0: sys.stderr.write('Chkconfig Failed\n') </post>
--nochrootargument causes the execution of the post section in a non-chrooted environment. Typically, after the package installation starts the post sections are run in a chrooted environment running under
/mnt/sysimage– ie.- In the installer
/filesystem on the installed machine:
<post arg="--nochroot"> cp /tmp/anaconda.log /mnt/sysimage/tmp/anaconda.log </post>
This tag allows the admin to create files on the filesystem of the installing machine. This tag is a resides inside a
/tmp/hello.logthat contains the word “HELLO” in it:
<post> <file name="/tmp/hello.log"> HELLO </file> </post>
<post> <file name="/tmp/hello.log" mode="append"> WORLD </file> </post>
chmodpermissions of 0400:
<post> <file name="/tmp/hello.log" perms="0400"> HELLO </file> </post>
/tmp/hello.logowned by user root and group apache:
<post> <file name="/tmp/hello.log" owner="root:apache"> HELLO </file> </post>
This tag controls both the Pre-boot section and the Post-boot section of the installation.
<boot order="pre"> rm -rf /tmp/hello.log </boot>
/etc/hostsfile by running a Stacki report:
<boot order="post"> /opt/stack/bin/stack report host > /etc/hosts </boot>