SDB:KIWI Cookbook WebYaST

Jump to: navigation, search


Include WebYaST in your image to support remote administration through a browser
Icon-checked.png
This procedure was tested on at least Kiwi version 3.74 ( kiwi --version )



Including WebYast in a Kiwi created image


This example provides a general guide on the inclusion of WebYast in an image created with Kiwi.

Kiwi image with WebYaST

WebYaST recipe

Prep Time:

  • 10 min

Cook Time:

  • 15-25 min depending on bandwidth (see this discussion) and hardware of host

Ingredients:

  • a running openSUSE 11.3 system (or greater)
  • an openSUSE 11.3 repository (or greater)
  • Internet access (alternative download the packages from the openSUSE build service repositories)
  • installed recent release of the KIWI toolset (at least version 3.74)
  • installed kiwi-doc package
  • about 2 GB free disk space


WebYaST

Detailed information about WebYast can be found on the WebYast portal. WebYaST is a system administration and configuration tool set that allows you to remotely administer a system through a web browser. WebYast is a modular toolset, the currently implemented modules for system administration tasks can be found here.

In this example we will build a VMware image that includes some WebYaST packages to demonstrate the basic use and configuration.

Kiwi Image Description

We start with the example image description for a VMware image provided by the kiwi-doc package. Copy the image description to a working directory of your choice; throughout this example we will work in the /tmp directory tree. Further it is assumed that you have previously worked through some or all of the basic Kiwi recipes and you are familiar with the basic Kiwi concepts.

cp -r /usr/share/doc/packages/kiwi/examples/suse-11.3/suse-vm-guest /tmp
cd /tmp/suse-vm-guest

With a copy of the VMware image description in place we can now edit the config.xml file to include the WebYaST modules we are interested in. Edit the config.xml file with your favorite editor and add a the new repositories shown below to the configuration file.

<repository type="rpm-md">
  <source path="opensuse://devel:/languages:/ruby:/extensions/openSUSE_11.3"/>
</repository>
<repository type="rpm-md">
  <source path="opensuse://YaST:/Web/openSUSE_11.3"/>
</repository>
 


With the repositories configured we can now add the WebYaST packages we want to install in the image. In addition to the basic functionality will add time and user administration modules to the image. In the image packages section of config.xml add the following packages:

<packages type="image">
.....
  <package name="webyast-base-ui"/>
  <package name="webyast-base-ui-branding-default"/>
  <package name="webyast-base-ws"/>
  <package name="webyast-reboot-ui"/>
  <package name="webyast-reboot-ws"/>
  <package name="webyast-status-ui"/>
  <package name="webyast-status-ws"/>
  <package name="webyast-time-ui"/>
  <package name="webyast-time-ws"/>
  <package name="webyast-user_en"/>
  <package name="webyast-users-ui"/>
  <package name="webyast-users-ws"/>
....
</packages>

This completes the changes to config.xml. Next we need to assure that the WebYast service is started when the appliance boots. This is accomplished with a change in config.sh Edit config.sh with your favorite editor and in the section marked with Activate services add the following commands:

insserv yastws
insserv yastwc

Save the file and build the image

kiwi --prepare /tmp/suse-vm-guest --root /tmp/vmWebY_unpacked
kiwi --create /tmp/vmWebY_unpacked -d /tmp/vmWebY_image -y

The next step is to fire up the virtual machine to checkout WebYast. In this example we use qemu-kvm for testing.

qemu-kvm /tmp/vmWebY_image/suse-11.3-vm-guest.x86_64-1.1.2.vmdk --net nic,vlan=1,macaddr=00:16:3e:7e:18:34,model=rtl8139 -net tap,vlan=1,script=/usr/share/qemu-kvm/qemu-ifup -m 1024

The network in the image is setup to receive an IP address from a DHCP server. If you do not have DHCP running on your network you will need to log into the machine and configure the network. Otherwise you will probably see the assigned IP address still on the screen when the login prompt is displayed. Use the IP address and connect to the machine in a browser on any other machine on the network by using ''https://IP-ADDRESS:54984''. Accept the certificate and you'll be able to login as root with the password linux.

For more information on configuring the WebYaST service see the Installation and Configuration page. You can modify the configuration by providing your own files in the overlay tree of your configuration directory or you can make modifications via config.sh.

That's it, your image is up and running and WebYaST can be used as the administration interface. The port 54984 is the default port for the web client that allows you to connect to the running service from any machine on your network.

Before we conclude this example a few words about the included WebYaST packages. You always need to include the webyast-base-* packages as they provide the basic infrastructure for the web service (package anding in ws) and the web based user interface (package ending in ui). The webyast-reboot package provides the functionality to reboot the image from the web based interface and you probably want to include it most, if not all the time. Another package that falls into this category is the webyast-status package. The status package provides functionality that lets you monitor your image with statistics such as CPU usage, network traffic etc.

Last but not least a word about users basing images on SUSE Linux Enterprise. Not all required packages for WebYaST on SLE are available from the openSUSE build service. You can configure your repository to point directly at the Novell Customer Center Web-Yast and SLE update repositories by using

<repository type="rpm-md" username="USERNAME" password="PASSWORD"
  <source path="https://nu.novell.com/..../>
</repository>

where the username and password are your credentials available from the NCC web site. The caveat is that you will need to use a Kiwi version greater than 4.82 to have access to this feature.