国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 操作系統 > 正文

puppet 配置 5 常見例子

2024-06-28 16:05:40
字體:
來源:轉載
供稿:網友

變量復用

說明:

變量定義后可以直接調用變量名稱使用

范例:

$etcd_controller1='10.100.84.22'$etcd_controller2='10.100.84.23'$etcd_controller3='10.100.84.24'$etcd_host1='gx-yun-084022.vclound.com'$etcd_host2='gx-yun-084023.vclound.com'$etcd_host3='gx-yun-084024.vclound.com'$etcd_connect="$etcd_host1=http://$etcd_host1:2380,$etcd_host2=http://$etcd_host2:2380,$etcd_host3=http://$etcd_host3:2380"$etcdcluster="$etcd_controller1:2379,$etcd_controller2:2379,$etcd_controller3:2379"

變量的判斷

說明:

可以利用 case , if 的方式進行判斷, 效果一樣針對不同的主機, 定義不同的變量使用

范例

$myipaddress=$ipaddress_vlanbr0if $myipaddress =~ /^10/.201/.//*/ { $ntpserver = '10.201.100.21'} elsif $myipaddress =~ /^10/.200/.//*/ { $ntpserver = '10.200.100.21'} elsif $myipaddress =~ /^10/.205/.//*/ { $ntpserver = '10.205.100.25'} elsif $myipaddress =~ /^192/.168/.//*/ { $ntpserver = [ '10.199.129.21', '10.199.129.22' ]} elsif $myipaddress =~ /^10/.100/.//*/ { $ntpserver = [ '10.199.129.21', '10.199.129.22' ]}

case 語法


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 洞口县| 浑源县| 聊城市| 武义县| 海伦市| 澄迈县| 河间市| 东源县| 余干县| 盈江县| 锦州市| 辽宁省| 武鸣县| 安顺市| 大姚县| 榆中县| 黄石市| 邵阳县| 松原市| 长岭县| 桂平市| 密云县| 田阳县| 乌苏市| 汝城县| 金寨县| 崇信县| 绩溪县| 波密县| 桐梓县| 乌拉特前旗| 察雅县| 循化| 常熟市| 桦川县| 沭阳县| 望都县| 铜鼓县| 宜宾县| 博乐市| 卓尼县|