4.12. Adding complete configurations

For many applications and services you might have prepared a configuration file which should be copied in a complete form to some location in the installed system. This is for example if you are installing a web server and have a ready to go server configuration file (httpd.conf).

Using this resource, you can embed the file into the control file by specifying the final path on the installed system. YaST2 will copy this file to the specified location.

Example 4-36. Dumping files into the installed system


  <files config:type="list">
      <config_file>
        <file_path>/etc/httpd/httpd.conf</file_path>
        <file_contents>

<![CDATA[
some content
]]>

       </file_contents>
     </config_file>
  </files>

	

A more advanced example is shown below. This configuration will create a file using the content supplied in file_contents and will change the permissions and ownership of the file. After the file has been copied to the system, a script is executed which can be used to manipulate the file and prepare it for the environment of the client.

Example 4-37. Dumping files into the installed system


  <files config:type="list">
      <config_file>
        <file_path>/etc/someconf.conf</file_path>
        <file_contents>

<![CDATA[
some content
]]>

       </file_contents>
        <file_owner>nashif.users</file_owner>
        <file_permissions>444</file_permissions>
        <file_script>
          <interpreter>shell</interpreter>
          <source>

<![CDATA[
#!/bin/sh

echo "Testing file scripts" >> /etc/someconf.conf
df
cd /mnt
ls
]]>

          </source>
        </file_script>
     </config_file>
  </files>