SUSE Support

Here When You Need Us

Unable to configure FQDN during AutoYaST install

This document (000020321) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 15 SP3
SUSE Linux Enterprise Server 15 SP2

Situation

Attempting to configure the fully qualified domain name (FQDN) for the server during AutoYaST installation fails.

The AutoYaST profile with either of the following fail.

Example 1:

  <networking>
    <dns>
      <domain>suse.com</domain>
      <hostname>server</hostname>
    </dns>
  </networking>


Example 2:

  <networking>
    <dns>
      <hostname>server.suse.com</hostname>
    </dns>
  </networking>


Installed using SLES15 SP2 installation media with a yast2-network package version earlier than yast2-network-4.2.94
 

Resolution

SLES15 SP3:
See Enabling the <domain> Tag in the Additional Information section below.

SLES15 SP2:
Fixed in: yast2-network-4.2.94 or higher
1. Update the AutoYaST profile to include the FQDN in the <hostname>, instead of the <domain> tag:

  <networking>
    <dns>
      <hostname>server.suse.com</hostname>
    </dns>
  </networking>

2. Go to https://www.suse.com/download/sles/ and select SLES15 SP2
3. Scroll to the bottom of the page and click login to SUSE Customer Center
4. Download SLE-15-SP2-Full-x86_64-QU3-Media1.iso or higher
5. Install using the updated installer media
 

Cause

The <domain> tag is largely ignored in SLES15, use the FQDN in the <hostname> tag. With SLES15 SP2, a switch to a new backend for yast2-network was done. A new compatibility layer was introduced, until everything is rewritten to use new backend directly. This change introduced some incompatibility, mainly, because old code was using side effects and ambiguous workflow(s). It was also caused by changes in the AutoYaST workflow for SLES15 SP2.

Status

Reported to Engineering

Additional Information

If  <domain> tag should be used instead of <hostname>, use a custom init script (see Enabling the <domain> Tag below).

Enabling the <domain> Tag

This is a work around that can programatically add <domain> tag functionality. Add an init script like the following to enable the <domain> tag. The follow script is very simplistic and expects only one instance of <domain> on a line by itself in the AutoYaST profile in the format:

  <networking>
    <dns>
      <domain>suse.com</domain>
    </dns>
  </networking>


The following init script runs after installation and extracts the <domain> tag value from the installedSystem.xml profile and adds an entry to the /etc/hosts file for FQDN support. Please modify it to suit your needs since custom scripts are not supported.

  <scripts>
    <init-scripts config:type="list">
      <script>
        <filename>configureFQDN.sh</filename>
        <interpreter>shell</interpreter>
        <source><![CDATA[#!/bin/bash
NIC='eth0'
SOURCE_PROFILE='/var/adm/autoinstall/cache/installedSystem.xml'
NIC_ADDR=''
UPDATE_FILE="/etc/hosts"

if [[ -s $SOURCE_PROFILE ]]; then
        DOMAIN=$(grep '<domain>' $SOURCE_PROFILE | grep -v SOURCE_PROFILE | cut -d\> -f2 | cut -d\< -f1)
        if [[ -n $DOMAIN ]]; then
                NIC_ADDR=$(ip address show $NIC | grep inet | cut -d' ' -f6 | cut -d\/ -f1)
                echo "Updating $UPDATE_FILE file"
                echo "${NIC_ADDR}  ${HOSTNAME}.${DOMAIN} ${HOSTNAME}" | tee -a $UPDATE_FILE
        else
                echo "ERROR: Missing DNS domain tag from profile - $SOURCE_PROFILE"
        fi
else
        echo "ERROR: Source profile not found - $SOURCE_PROFILE"
fi
]]>
        </source>
      </script>
    </init-scripts>
  </scripts>


Prompting for the FQDN hostname during installation

You can use the <ask> tag to prompt for the FQDN hostname. For example:

  <networking>
    <dns>
      <hostname>ASK</hostname>
    </dns>
  </networking>
  <general>
    <ask-list config:type="list">
      <ask>
        <pathlist config:type="list">
          <path>networking,dns,hostname</path>
        </pathlist>
        <question>Enter FQDN Hostname (Long Format)</question>
        <stage>initial</stage>
      </ask>
    </ask-list>
  </general>

 

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:000020321
  • Creation Date: 06-Jul-2021
  • Modified Date:07-Jul-2021
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.