summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Peck <bpeck@redhat.com>2012-02-23 17:17:31 -0500
committerGerrit Code Review <gerrit@beaker-project.org>2012-02-23 17:17:31 -0500
commit1a0e9915972e4064f0582fb53bd21cdc5e219058 (patch)
treed40e01118a88b2574ea5ea8df807e8be8c8362ad
parent8e4ae10350805d654697c23a9547127f02f6afc5 (diff)
parentad79e60323ef0ea80b99999adcaca6103dd51218 (diff)
Merge "move print_repos to rhts_post so that custom kickstarts pick this up." into release-0.8.0
-rw-r--r--LabController/kickstarts/RedHatEnterpriseLinux7.ks7
-rw-r--r--LabController/snippets/print_anaconda_repos24
-rw-r--r--LabController/snippets/print_repos5
-rw-r--r--LabController/snippets/rhts_post1
4 files changed, 31 insertions, 6 deletions
diff --git a/LabController/kickstarts/RedHatEnterpriseLinux7.ks b/LabController/kickstarts/RedHatEnterpriseLinux7.ks
index d2e7c29..c637603 100644
--- a/LabController/kickstarts/RedHatEnterpriseLinux7.ks
+++ b/LabController/kickstarts/RedHatEnterpriseLinux7.ks
@@ -24,8 +24,7 @@ bootloader --location=mbr #slurp
# Use text mode install
$getVar('mode', 'text')
$SNIPPET("network")
-$SNIPPET("print_repos")
-$print_repo("repos", anaconda=True)
+$SNIPPET("print_anaconda_repos")
## Firewall configuration
## firewall in kickstart metadata will enable the firewall
@@ -87,10 +86,6 @@ $SNIPPET("system_pre")
%post --log=/dev/console
-$SNIPPET("print_repos")
-cat >> /etc/yum.repos.d/beaker-additional.repo << EOF
-$print_repo("repos")
-EOF
$SNIPPET("rhts_post")
$SNIPPET("RedHatEnterpriseLinux7_post")
$SNIPPET("system_post")
diff --git a/LabController/snippets/print_anaconda_repos b/LabController/snippets/print_anaconda_repos
new file mode 100644
index 0000000..7cf4e32
--- /dev/null
+++ b/LabController/snippets/print_anaconda_repos
@@ -0,0 +1,24 @@
+#def print_repo($repo_string, $anaconda=False)
+ #if $getVar($repo_string, '') != ''
+ #set $repo = $getVar($repo_string)
+ #if type($repo) == list
+ #for $r in $repo
+$print_repo('%s_%s' % ($repo_string, $r), $anaconda)
+ #end for
+ #else
+ #if $anaconda
+repo --name=$repo_string --cost=100 --baseurl=$repo
+ #else
+[$repo_string]
+name=$repo_string
+baseurl=$repo
+enabled=1
+gpgcheck=0
+skip_if_unavailable=1
+ #end if
+ #end if
+ #end if
+#end def
+#if $getVar("repos",[]) != []
+$print_repo("repos", anaconda=True)
+#end if
diff --git a/LabController/snippets/print_repos b/LabController/snippets/print_repos
index 0b435d6..c462692 100644
--- a/LabController/snippets/print_repos
+++ b/LabController/snippets/print_repos
@@ -19,3 +19,8 @@ skip_if_unavailable=1
#end if
#end if
#end def
+#if $getVar("repos",[]) != []
+cat >> /etc/yum.repos.d/beaker-additional.repo <<EOF
+$print_repo("repos")
+EOF
+#end if
diff --git a/LabController/snippets/rhts_post b/LabController/snippets/rhts_post
index 2034844..c069ce6 100644
--- a/LabController/snippets/rhts_post
+++ b/LabController/snippets/rhts_post
@@ -60,6 +60,7 @@ popd
#end if
# Add Repos
+$SNIPPET('print_repos')
#set potential_repos = ['os_repos','debug_repos','optional_repos', 'customrepos']
#for potential_repo in $potential_repos
#if $getVar($potential_repo,'') != ''