Fix: cobbler: setup.sh: Re-add extra RPM repos. 97/13397/2
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 28 Apr 2016 13:04:40 +0000 (15:04 +0200)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 28 Apr 2016 13:19:19 +0000 (15:19 +0200)
Commit 69fd98a broke the cobbler yum config, because instead of
re-adding only mos and nailgun repos with file:/// handler, it
kept the docker-specific repo config from ISO build.

Change-Id: I910fe639116a7ea8cb768c0371af0a84b471d0a4

patches/fuel-main/0004-FIXME-cobbler-setup.sh-Keep-extra-RPM-repos.patch

index c16d05e..e3dceed 100644 (file)
@@ -15,48 +15,36 @@ which is not currently possible, as we remove the extra RPM repository
 entry from yum config at the end of container build.
 
 Hacky temporary workaround:
-Keep extra RPM yum config after container is set up, only for cobbler.
+Re-add extra RPM yum config after container is set up, only for cobbler.
 
 TODO: This patch should be dropped once cobbler-grub-aarch64 RPM
 package gets upstreamed.
 ---
- docker/cobbler/setup.sh | 26 +++++++++++++++-----------
- 1 file changed, 15 insertions(+), 11 deletions(-)
+ docker/cobbler/setup.sh | 14 ++++++++++++++
+ 1 file changed, 14 insertions(+)
 
 diff --git a/docker/cobbler/setup.sh b/docker/cobbler/setup.sh
-index 90627a8..1a0b0d2 100644
+index 90627a8..508eaa4 100644
 --- a/docker/cobbler/setup.sh
 +++ b/docker/cobbler/setup.sh
-@@ -68,17 +68,21 @@ puppet apply --debug --verbose --color false --detailed-exitcodes \
-   /etc/puppet/modules/nailgun/examples/cobbler-only.pp || [[ $? == 2 ]]
+@@ -80,6 +80,20 @@ baseurl=file:/var/www/nailgun/mos-centos/x86_64
+ gpgcheck=0
+ EOF
  
--cat << EOF > /etc/yum.repos.d/nailgun.repo
--[nailgun]
--name=Nailgun Local Repo
--baseurl=file:/var/www/nailgun/centos/x86_64
--gpgcheck=0
--
--[mos]
--name=MOS Local Repo
--baseurl=file:/var/www/nailgun/mos-centos/x86_64
--gpgcheck=0
--EOF
-+## FIXME(armband): Keep extra RPM repository in Cobbler container
-+# Normally, extra RPM repos are discarded post-build, but we
++## FIXME(armband): Add extra RPM repository in Cobbler container
++# Normally, extra RPM repos are not re-added post-build, but we
 +# need cobbler-grub-aarch64 during each container start.
 +
-+#  cat << EOF > /etc/yum.repos.d/nailgun.repo
-+#  [nailgun]
-+#  name=Nailgun Local Repo
-+#  baseurl=file:/var/www/nailgun/centos/x86_64
-+#  gpgcheck=0
++for repo in ${EXTRA_RPM_REPOS}; do
++  IFS=, read -a repo_args <<< "$repo"
++  cat << EOF >> /etc/yum.repos.d/nailgun.repo
 +
-+#  [mos]
-+#  name=MOS Local Repo
-+#  baseurl=file:/var/www/nailgun/mos-centos/x86_64
-+#  gpgcheck=0
-+#  EOF
++[extra-repo-${repo_args[0]}]
++name=MOS Extra Repo ${repo_args[0]}
++baseurl=file:/var/www/nailgun/extra-repos/${repo_args[0]}
++gpgcheck=0
++EOF
++done
  yum clean all