add ks_mirror into the default repos

Change-Id: Ic68caef0a9369772835784525a75b788cb20595b
This commit is contained in:
xiaodongwang 2015-04-06 15:15:34 -07:00
parent 410a9c480d
commit c79f9d4e9d
7 changed files with 40 additions and 5 deletions

View File

@ -14,6 +14,7 @@ service ntp stop 2>&1 >> /tmp/ntp.log
ntpdate $ntp_server 2>&1 >> /tmp/ntp.log
service ntp start 2>&1 >> /tmp/ntp.log
echo "new date is: `date`" 2>&1 >> /tmp/ntp.log
yum -y update 2>&1 >> /tmp/yum_update.log
crontab -l > /tmp/mycron
echo "*/30 * * * * /etc/chef/chef_client_run.sh" >> /tmp/mycron

View File

@ -13,6 +13,20 @@ rm -f /etc/sysconfig/network
mv -f /etc/sysconfig/network.cobbler /etc/sysconfig/network
#end if
cat << EOF > /sbin/ifup-local
#raw
#!/bin/bash
RC=0
PROM=\$(egrep -i 'promisc' /etc/sysconfig/network-scripts/ifcfg-\$1 | awk -F"=" '{ print \$2 }')
if [[ "\$PROM" == "yes" ]]; then
ip link set dev \$1 promisc on
RC=\$?
fi
exit \$RC
#end raw
EOF
chmod +x /sbin/ifup-local
#if $hostname != ""
# set the hostname in the network configuration file
grep -v HOSTNAME /etc/sysconfig/network > /etc/sysconfig/network.cobbler

View File

@ -36,12 +36,23 @@ mv -f /etc/yum.repos.d/* /root/repo_backup/
#set os_info = $profile_name.split('-')
#set osname = $os_info[0].lower()
#set osversion = $os_info[1]
#set osversion_flat = $osversion.replace('.', '_')
cat << EOF > /etc/yum.repos.d/${osname}_${osversion_flat}_os_repo.repo
[${osname}_${osversion_flat}_os_repo]
name=${osname} - ${osname}_${osversion_flat}_os_repo
proxy=_none_
baseurl=$tree
enabled=1
gpgcheck=0
skip_if_unavailable=1
EOF
#set $repo_data = $getVar("repo_data",[])
#for $repo in $repo_data
cat << EOF > /etc/yum.repos.d/${repo.name}.repo
[$repo.name]
name=CentOS - $repo.name
name=${osname} - $repo.name
#if $repo.mirror_locally
baseurl=http://$http_server/cblr/repo_mirror/${repo.name}
proxy=_none_

View File

@ -14,6 +14,7 @@ service ntpd stop 2>&1 >> /tmp/ntp.log
ntpdate $ntp_server 2>&1 >> /tmp/ntp.log
service ntpd start 2>&1 >> /tmp/ntp.log
echo "new date is: `date`" 2>&1 >> /tmp/ntp.log
apt-get -y update 2>&1 >> /tmp/apt_update
crontab -l > /tmp/mycron
echo "*/30 * * * * /etc/chef/chef_client_run.sh" >> /tmp/mycron

View File

@ -2,6 +2,7 @@
#set os_info = $profile_name.split('-')
#set osname = $os_info[0].lower()
#set osversion = $os_info[1]
#set osversion_flat = $osversion.replace('.', '_')
cat << EOF > /etc/apt/apt.conf
APT::Get::Assume-Yes "true";
@ -33,6 +34,10 @@ $SNIPPET($repos_snippet)
#set $rarch = "[arch=%s]" % $arch
#end if
cat << EOF >> /etc/apt/sources.list
deb ${rarch} $tree $os_version main restricted
EOF
cat << EOF >> /etc/apt/sources.list
#set $repo_data = $getVar("repo_data",[])
#for $repo in $repo_data
@ -56,7 +61,8 @@ cat << EOF >> /etc/apt/sources.list
deb ${rarch} $local_repo/$compass_repo/ local_repo main
EOF
#if $getVar("local_repo_only","1") != "0"
apt-get -y update
#if $getVar("local_repo_only","1") != "0"
apt-get -y update
#end if
#end if

View File

@ -16,6 +16,7 @@ service ntp stop 2>&1 >> /tmp/ntp.log
ntpdate $ntp_server 2>&1 >> /tmp/ntp.log
service ntp start 2>&1 >> /tmp/ntp.log
echo "new date is: `date`" 2>&1 >> /tmp/ntp.log
zypper -n update 2>&1 >> /tmp/zypp_update
crontab -l > /tmp/mycron
echo "*/30 * * * * /etc/chef/chef_client_run.sh" >> /tmp/mycron

View File

@ -2,6 +2,7 @@
#set os_info = $profile_name.split('-')
#set osname = $os_info[0].lower()
#set osversion = $os_info[1]
#set osversion_flat = $osversion.replace('.', '_')
#if $getVar("local_repo", "") == "" or $getVar("local_repo_only","1") == "0"
#set repos_snippet = 'zypp.repos.d/%s/%s/autoyast_repos' % ($osname, $osversion)
@ -21,7 +22,7 @@ type=rpm-md
keeppackages=1
EOF
#if $getVar("local_repo_only","1") != "0"
zypper -n update
#if $getVar("local_repo_only","1") != "0"
zypper -n update
#end if
#end if