如何组织全自动安装(FAI)课程主机?

发布于 2025-01-23 16:37:04 字数 336 浏览 4 评论 0原文

完全自动化的安装(FAI)在文件50主持级中具有主机。目前,我们有许多具有相似名称的主机(例如,ba-hostxx.subdomain)。子域是不同的,但不能指定host.subdomain在类文件中为'。无效。

是否可以在不同的文件中拥有不同的主机? 方式指定主机

hostname*)
    echo "BASEFILE FILE" ;;

还是以其他

cluster/hostname*)

    echo "BASEFILE FILE" ;;

该文档将所有主机都坐在50个文件中的意见中。

Fully Automated Install (FAI) has hosts in the file 50-host-classes. We currently have a bunch of hosts which have similar names (eg, ba-hostxx.subdomain). The sub-domains are different but one cannot specify host.subdomain in the class file as the '.' is invalid.

Is it possible to have different hosts in different files? Or to specify the host in some other fashion than just

hostname*)
    echo "BASEFILE FILE" ;;

such as

cluster/hostname*)

    echo "BASEFILE FILE" ;;

?

The documentation leads one to the opinion that all hosts sit in the 50- file.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

秋叶绚丽 2025-01-30 16:37:04

您可以在$ FAI/类/文件夹中创建任何数量的脚本来为主机生成类。他们只需要根据您的标准打印出正确的类名称即可。下面的示例。

class/51年级别

#!/bin/bash

# Check the domain name for the host
host_domain=`hostname -A|cut -f 2- -d .`
if [ -n "$host_domain" ] ; then
    [ $host_domain = domain-a.foo ] && echo DOMAIN_A 
    [ $host_domain = domain-b.foo ] && echo DOMAIN_B
fi

# just check the host name
[ $HOSTNAME = ba-host76 ] && echo BA_THING
[ $HOSTNAME = qf-host76 ] && echo QF_THING

# Check that the host matches a pattern
if echo $HOSTNAME | grep -q 'zz-host[0-9][0-9]' ; then
    echo CARROTS
    # Play the lottery
    [ $RANDOM -lt 16536 ] && echo WINNER
fi

You can create any number of scripts in the $FAI/class/ folder to generate classes for the hosts. They just need to print out the correct class name(s) based on your criteria. Example below.

class/51-more-classes

#!/bin/bash

# Check the domain name for the host
host_domain=`hostname -A|cut -f 2- -d .`
if [ -n "$host_domain" ] ; then
    [ $host_domain = domain-a.foo ] && echo DOMAIN_A 
    [ $host_domain = domain-b.foo ] && echo DOMAIN_B
fi

# just check the host name
[ $HOSTNAME = ba-host76 ] && echo BA_THING
[ $HOSTNAME = qf-host76 ] && echo QF_THING

# Check that the host matches a pattern
if echo $HOSTNAME | grep -q 'zz-host[0-9][0-9]' ; then
    echo CARROTS
    # Play the lottery
    [ $RANDOM -lt 16536 ] && echo WINNER
fi
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文