diff options
author | 2015-08-04 22:21:43 -0400 | |
---|---|---|
committer | 2015-08-05 01:01:22 -0400 | |
commit | d05b5f04c92034eae1675dc8102247a3cc3315f7 (patch) | |
tree | 9721a1cfddc4b234ff302922da01cc3da0eb0fb9 /deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config | |
parent | 79b571dae951ba9bfe36440750c1a1408b19cd69 (diff) |
delete the windows newline character
JIRA: COMPASS-7
Change-Id: Iffd549877b8cc50a995bdc59adf1f05c0fcb1d5e
Signed-off-by: baigk <baiguoku@huawei.com>
Diffstat (limited to 'deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config')
-rw-r--r-- | deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config | 135 |
1 files changed, 67 insertions, 68 deletions
diff --git a/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config b/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config index 1d8a34be..6ea56c56 100644 --- a/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config +++ b/deploy/adapters/cobbler/snippets/preseed_post_apt_repo_config @@ -1,68 +1,67 @@ -#set profile_name = $getVar('profile_name','')
-#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";
-APT::Get::force-yes "true";
-#if $getVar('proxy', '') != ''
-Acquire::http::Proxy "$proxy";
-#end if
-Acquire::http::Proxy::$http_server DIRECT;
-#if $getVar("local_repo","") != ""
- #import urlparse
- #set $local_repo_url = $urlparse.urlparse($local_repo)
- #set $local_repo_server = $local_repo_url.hostname
- #if $http_server != $local_repo_server
-Acquire::http::Proxy::${local_repo_server} DIRECT;
- #end if
-#end if
-EOF
-
-
-#if $getVar("local_repo", "") == "" or $getVar("local_repo_only","1") == "0"
- #set repos_snippet = 'apt.repos.d/%s/%s/preseed_repos' % ($osname, $osversion)
-$SNIPPET($repos_snippet)
-#end if
-
-#if $arch == "x86_64"
- #set $rarch = "[arch=amd64]"
-#else
- #set $rarch = "[arch=%s]" % $arch
-#end if
-
-rm -f /etc/apt/sources.list
-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
- #for $dist in $repo.apt_dists
- #set $comps = " ".join($repo.apt_components)
- #if $repo.comment != ""
-# ${repo.comment}
- #end if
- #if $repo.mirror_locally
-deb ${rarch} http://$http_server/cblr/repo_mirror/${repo.name} $dist $comps
- #else
-deb ${rarch} ${repo.mirror} $dist $comps
- #end if
- #end for
- #end for
-EOF
-
-#if $getVar("local_repo","") != ""
-cat << EOF >> /etc/apt/sources.list
-#set compass_repo = 'apt.repos.d/%s/%s/ubuntu_repo' % ($osname, $osversion)
-deb ${rarch} $local_repo/$compass_repo/ local_repo main
-EOF
-
-
- #if $getVar("local_repo_only","1") != "0"
-apt-get -y update
- #end if
-#end if
+#set profile_name = $getVar('profile_name','') +#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"; +APT::Get::force-yes "true"; +#if $getVar('proxy', '') != '' +Acquire::http::Proxy "$proxy"; +#end if +Acquire::http::Proxy::$http_server DIRECT; +#if $getVar("local_repo","") != "" + #import urlparse + #set $local_repo_url = $urlparse.urlparse($local_repo) + #set $local_repo_server = $local_repo_url.hostname + #if $http_server != $local_repo_server +Acquire::http::Proxy::${local_repo_server} DIRECT; + #end if +#end if +EOF + + +#if $getVar("local_repo", "") == "" or $getVar("local_repo_only","1") == "0" + #set repos_snippet = 'apt.repos.d/%s/%s/preseed_repos' % ($osname, $osversion) +$SNIPPET($repos_snippet) +#end if + +#if $arch == "x86_64" + #set $rarch = "[arch=amd64]" +#else + #set $rarch = "[arch=%s]" % $arch +#end if + +rm -f /etc/apt/sources.list +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 + #for $dist in $repo.apt_dists + #set $comps = " ".join($repo.apt_components) + #if $repo.comment != "" +# ${repo.comment} + #end if + #if $repo.mirror_locally +deb ${rarch} http://$http_server/cblr/repo_mirror/${repo.name} $dist $comps + #else +deb ${rarch} ${repo.mirror} $dist $comps + #end if + #end for + #end for +EOF + +#if $getVar("local_repo","") != "" +cat << EOF >> /etc/apt/sources.list +#set compass_repo = 'apt.repos.d/%s/%s/ubuntu_repo' % ($osname, $osversion) +deb ${rarch} $local_repo/$compass_repo/ local_repo main +EOF + + #if $getVar("local_repo_only","1") != "0" +apt-get -y update + #end if +#end if |