深入BDD规则实施(rule processing)(1)
预期分2-3次完成
Understanding BDD rule processing
To truly unleash the potential of BDD 2007 you must first understand the concept of rule processing.
A rule is used to define the variables that drive the entire imaging process. They are used to define properties such as the computer name, the local administrator password, or how user data should be saved during an p_w_picpath deployment.
There are a number of methods by which rules can be used to define variables. The following sections review these methods and how to best use them to customize BDD 2007.
要真正释放BDD 2007的潜力,你就必须明白规则实施的概念.
我们使用规则来定义驱动镜像过程中的变量。它们常常是定义为各种属性值,像计算机名称、本地管理员密码或者在部署过程中用户数据的存储地址
我们有许多方法来定义各种变量。我们的最佳选择是使用以下方法来定制我们的BDD2007
Rule processing overview
Before you look at how to define rules it is important to understand how BDD processes rules.
The values that BDD obtains from rules are called “properties”. Properties are similar to environment variables, and once defined can be used by all other scripts. There are two types of properties:
1. Standard properties – Default properties defined within BDD2. Custom properties – Properties you can define and assign as requiredNote: Properties can be single valued or lists在此之前,你需要先明白BDD如何实施各种规则的重要性。那些BDD从规则中获得的值称为“属性”。属性和环境变量类似,一旦定义就可以在所有脚本中使用。主要有两种属性1.标准属性-所有BDD默认的属性2.自定义属性 按照你需要定义并声明的属性注意:属性可以单独赋值,也可以列表赋值(大概是这个意思吧,请牛人指正)BDD uses a gathering mechanism to determine the values of the properties. It does this by running the script “ZTIGather.wsf”. The script performs the following steps:1. Determines the standard properties by referring to the standard properties definition file “ZTIGather.xml”.2. Parses the “CustomSettings.ini” file and determines what custom properties it should use.3. The “CustomSettings.ini” file is then processed to gather values for all of the properties required to deploy the operating system to the client.The rest of the post will explain how the rule gathering process works for each of the assignment methods.BDD使用一种收集机制:运行“ZTIGather.wsf”去获取属性的值。 这个脚本使用以下步骤:1.依靠"ZTIGather.xml"中的标准属性去取值2.读取"CustomSettings.ini",获取需要读取的自定义属性列表3.读取所有"CustomSettings.ini"中需要的属性值Assigning values through rules
Values can be assigned to properties through a number of different methods.1. You can use hard-coded values, for example you could statically define the logging share (SLShare) to point at the share “LOGS” on “SERVER”:SLShare=\\SERVER\LOGS有许多不同的方法把值分配给属性1.你可以使用hard-coded值,例如静态定义日志共享为“LOGS”和“SERVER”SLShare=\\SERVER\LOGS2. You can use variable substitution, for example you could statically define your logging share (SLShare) to point at the share “LOGS” on the SMS deployment point that you are currently connected to:SLShare=\\%SMSDP%\Logs2.你可以使用代替变量,例如使用SLShare=\\%SMSDP%\Logs3. Rules can call script functions, for example you may want to assign the ComputerName based on information gathered from the Asset Tag, functions are recognized as being enclosed in “#”’s:ComputerName=#MyFunction(‘%AssetTag%’)#(See the Userexit script section below for further information)3.规则可以使用脚本的函数ComputerName=#MyFunction(‘%AssetTag%’)#4. Rules can be selected based on the value of dynamic keys, the following example will return the computer name “Computer1” if the MAC Address is “00:01:AB:34:CD:02”[Settings]
Priority=MACAddress,…
[00:01:AB:34:CD:02]
ComputerName=”Computer1”4.动态值获取[Settings]
Priority=MACAddress,…
[00:01:AB:34:CD:02]
ComputerName=”Computer1”5. You can assign values based on database lookups. (See the database section below for further information)5.从数据库中获取0
收藏
推荐专栏更多
猜你喜欢
我的友情链接 Visual Studio 2010更改颜色背景的方法 iptables交互配置脚本【Linux运维之道之脚本案例】 Shell脚本中循环语句for,while,until用法 Shell脚本语法-- if/then/elif/else/fi 自动化运维工具Ansible实战(五)Playbooks剧本使用 实战Nginx与PHP(FastCGI)的安装、配置与优化 linux 自动执行 crontab学习笔记 Linux中变量$#,[email protected],$0,$1,$2,$*,$$,$?的含义 linux shell脚本快速提升的秘诀 101个shell脚本 windows通过bat脚本设置服务开机启动 API网关如何实现对服务下线实时感知 浅谈ACL(访问控制列表) Confluence 未授权 RCE (CVE-2019-3396) 漏洞分析 亿级日搜索量的美团如何构建高效的搜索系统? 玩转KVM:怎么追查KVM故障 mysql5.7.25主从同步图解(主:CentOS7.5,从win10) springboot2+exporter+prometheus+grafana搭建监控体系 使用Alpine Linux和Oracle jre6构建Tomcat6镜像及应用容器化![]()
扫一扫,领取大礼包
转载于:https://blog.51cto.com/xmuxsp/75328
Ctrl+Enter 发布
发布
取消