标签:cobbler
#!/bin/bash
a=($(awk ‘{print $1}‘ /home/yanchao/ip.txt))
b=($(awk ‘{print $2}‘ /home/yanchao/ip.txt))
c=($(awk ‘{print $3}‘ /home/yanchao/ip.txt))
d=($(awk ‘{print $4}‘ /home/yanchao/ip.txt))
e=($(awk ‘{print $5}‘ /home/yanchao/ip.txt))
for (( i=0;i<${#a[@]};i++))
do
cobbler system add --name=${a[$i]} --hostname=${a[$i]} --mac=${b[$i]} --interface=eth1 --ip-address=${c[$i]} --subnet=255.255.255.0 --gateway=10.67.15.1 --stat
ic=1 --profile=centos6.3-x86_64 --interface-master=eth1
cobbler system edit --name=${a[$i]} --interface=eth0 --mac=${d[$i]} --ip-address=${e[$i]} --subnet=255.255.255.0 --static=1
cobbler sync
done
ip.txt
yq37 5C:F3:FC:B6:CB:88 10.67.15.37 5C:F3:FC:B6:CB:8A 220.181.136.26
yq38 5C:F3:FC:E3:23:CC 10.67.15.38 5C:F3:FC:E3:23:CE 220.181.136.27
本文出自 “expect批量同步数据” 博客,请务必保留此出处http://4249964.blog.51cto.com/4239964/1539766
标签:cobbler
原文地址:http://4249964.blog.51cto.com/4239964/1539766