[RHEL] Manual support of backend RHEL intergation.

Modify makefiles:
    * to create local mirror of RHEL repo;
    * to include RHEL repo to ISO.
Add support of RHEL packages download to master node via puppet.
Add RHEL profile to cobbler.
Add minimal RHEL support to deployment procedure.
This commit is contained in:
Andrey Danin 2013-06-26 20:03:15 +04:00 committed by default
parent 3cd642d2f1
commit 06fe3f1c43
32 changed files with 1107 additions and 27 deletions

View File

@ -8,6 +8,7 @@ help:
@echo ' LOCAL_MIRROR: $(LOCAL_MIRROR)' @echo ' LOCAL_MIRROR: $(LOCAL_MIRROR)'
@echo ' YUM_REPOS: $(YUM_REPOS)' @echo ' YUM_REPOS: $(YUM_REPOS)'
@echo ' MIRROR_CENTOS: $(MIRROR_CENTOS)' @echo ' MIRROR_CENTOS: $(MIRROR_CENTOS)'
@echo ' MIRROR_RHEL: $(MIRROR_RHEL)'
@echo ' MIRROR_EGGS: $(MIRROR_EGGS)' @echo ' MIRROR_EGGS: $(MIRROR_EGGS)'
@echo ' MIRROR_GEMS: $(MIRROR_GEMS)' @echo ' MIRROR_GEMS: $(MIRROR_GEMS)'
@echo ' MIRROR_SRC: $(MIRROR_SRC)' @echo ' MIRROR_SRC: $(MIRROR_SRC)'

View File

@ -31,11 +31,15 @@ IMG_PATH:=$(ISO_DIR)/$(ISO_NAME).img
# Do not compress javascript and css files # Do not compress javascript and css files
NO_UI_OPTIMIZE:=0 NO_UI_OPTIMIZE:=0
# Do not copy RHEL repo to the iso
CACHE_RHEL:=0
LOCAL_MIRROR_SRC:=$(LOCAL_MIRROR)/src LOCAL_MIRROR_SRC:=$(LOCAL_MIRROR)/src
LOCAL_MIRROR_EGGS:=$(LOCAL_MIRROR)/eggs LOCAL_MIRROR_EGGS:=$(LOCAL_MIRROR)/eggs
LOCAL_MIRROR_GEMS:=$(LOCAL_MIRROR)/gems LOCAL_MIRROR_GEMS:=$(LOCAL_MIRROR)/gems
LOCAL_MIRROR_CENTOS:=$(LOCAL_MIRROR)/centos LOCAL_MIRROR_CENTOS:=$(LOCAL_MIRROR)/centos
LOCAL_MIRROR_CENTOS_OS_BASEURL:=$(LOCAL_MIRROR_CENTOS)/os/$(CENTOS_ARCH) LOCAL_MIRROR_CENTOS_OS_BASEURL:=$(LOCAL_MIRROR_CENTOS)/os/$(CENTOS_ARCH)
LOCAL_MIRROR_RHEL:=$(LOCAL_MIRROR)/rhel
BUILD_MIRROR_GEMS:=$(BUILD_DIR)/packages/gems BUILD_MIRROR_GEMS:=$(BUILD_DIR)/packages/gems
@ -44,7 +48,7 @@ BUILD_MIRROR_GEMS:=$(BUILD_DIR)/packages/gems
# download of all the packages directly from internet # download of all the packages directly from internet
USE_MIRROR?=srt USE_MIRROR?=srt
ifeq ($(USE_MIRROR),srt) ifeq ($(USE_MIRROR),srt)
YUM_REPOS?=proprietary YUM_REPOS?=proprietary subscr_manager
MIRROR_BASE?=http://srv08-srt.srt.mirantis.net/fwm/$(PRODUCT_VERSION) MIRROR_BASE?=http://srv08-srt.srt.mirantis.net/fwm/$(PRODUCT_VERSION)
MIRROR_CENTOS?=$(MIRROR_BASE)/centos MIRROR_CENTOS?=$(MIRROR_BASE)/centos
MIRROR_EGGS?=$(MIRROR_BASE)/eggs MIRROR_EGGS?=$(MIRROR_BASE)/eggs
@ -52,7 +56,7 @@ MIRROR_GEMS?=$(MIRROR_BASE)/gems
MIRROR_SRC?=$(MIRROR_BASE)/src MIRROR_SRC?=$(MIRROR_BASE)/src
endif endif
ifeq ($(USE_MIRROR),msk) ifeq ($(USE_MIRROR),msk)
YUM_REPOS?=proprietary YUM_REPOS?=proprietary subscr_manager
MIRROR_BASE?=http://srv11-msk.msk.mirantis.net/fwm/$(PRODUCT_VERSION) MIRROR_BASE?=http://srv11-msk.msk.mirantis.net/fwm/$(PRODUCT_VERSION)
MIRROR_CENTOS?=$(MIRROR_BASE)/centos MIRROR_CENTOS?=$(MIRROR_BASE)/centos
MIRROR_EGGS?=$(MIRROR_BASE)/eggs MIRROR_EGGS?=$(MIRROR_BASE)/eggs
@ -60,7 +64,7 @@ MIRROR_GEMS?=$(MIRROR_BASE)/gems
MIRROR_SRC?=$(MIRROR_BASE)/src MIRROR_SRC?=$(MIRROR_BASE)/src
endif endif
ifeq ($(USE_MIRROR),usa) ifeq ($(USE_MIRROR),usa)
YUM_REPOS?=proprietary YUM_REPOS?=proprietary subscr_manager
MIRROR_BASE?=http://product-vm.vm.mirantis.net/fwm/$(PRODUCT_VERSION) MIRROR_BASE?=http://product-vm.vm.mirantis.net/fwm/$(PRODUCT_VERSION)
MIRROR_CENTOS?=$(MIRROR_BASE)/centos MIRROR_CENTOS?=$(MIRROR_BASE)/centos
MIRROR_EGGS?=$(MIRROR_BASE)/eggs MIRROR_EGGS?=$(MIRROR_BASE)/eggs
@ -70,6 +74,8 @@ endif
MIRROR_CENTOS?=http://mirror.yandex.ru/centos/$(CENTOS_RELEASE) MIRROR_CENTOS?=http://mirror.yandex.ru/centos/$(CENTOS_RELEASE)
MIRROR_CENTOS_OS_BASEURL:=$(MIRROR_CENTOS)/os/$(CENTOS_ARCH) MIRROR_CENTOS_OS_BASEURL:=$(MIRROR_CENTOS)/os/$(CENTOS_ARCH)
MIRROR_RHEL?=http://srv11-msk.msk.mirantis.net/rhel6/rhel-6-server-rpms
MIRROR_RHEL_BOOT?=http://srv11-msk.msk.mirantis.net/rhel6/rhel-server-6.4-x86_64
# It can be any a list of links (--find-links) or a pip index (--index-url). # It can be any a list of links (--find-links) or a pip index (--index-url).
MIRROR_EGGS?=http://pypi.python.org/simple MIRROR_EGGS?=http://pypi.python.org/simple
# NOTE(mihgen): removed gemcutter - it redirects to rubygems.org and has issues w/certificate now # NOTE(mihgen): removed gemcutter - it redirects to rubygems.org and has issues w/certificate now
@ -78,13 +84,18 @@ MIRROR_GEMS?=http://rubygems.org
REQUIRED_RPMS:=$(shell grep -v "^\\s*\#" $(SOURCE_DIR)/requirements-rpm.txt) REQUIRED_RPMS:=$(shell grep -v "^\\s*\#" $(SOURCE_DIR)/requirements-rpm.txt)
REQUIRED_EGGS:=$(shell grep -v "^\\s*\#" $(SOURCE_DIR)/requirements-eggs.txt) REQUIRED_EGGS:=$(shell grep -v "^\\s*\#" $(SOURCE_DIR)/requirements-eggs.txt)
REQUIRED_SRCS:=$(shell grep -v ^\\s*\# $(SOURCE_DIR)/requirements-src.txt) REQUIRED_SRCS:=$(shell grep -v ^\\s*\# $(SOURCE_DIR)/requirements-src.txt)
REQ_RHEL_RPMS:=$(shell grep -v "^\\s*\#" $(SOURCE_DIR)/puppet/rpmcache/files/required-rpms.txt)
REQ_FUEL_RHEL_RPMS:=$(shell grep -v "^\\s*\#" $(SOURCE_DIR)/puppet/rpmcache/files/req-fuel-rhel.txt)
# Which repositories to use for making local centos mirror. # Which repositories to use for making local centos mirror.
# Possible values you can find out from mirror/centos/yum_repos.mk file. # Possible values you can find out from mirror/centos/yum_repos.mk file.
# The actual name will be constracted wich prepending "yum_repo_" prefix. # The actual name will be constracted wich prepending "yum_repo_" prefix.
# Example: YUM_REPOS?=official epel => yum_repo_official and yum_repo_epel # Example: YUM_REPOS?=official epel => yum_repo_official and yum_repo_epel
# will be used. # will be used.
YUM_REPOS?=official fuel YUM_REPOS?=official fuel subscr_manager
ifeq ($(CACHE_RHEL),1)
YUM_REPOS:=$(YUM_REPOS) rhel
endif
# Mirror of source packages. Bareword 'internet' is used to download packages # Mirror of source packages. Bareword 'internet' is used to download packages
# directly from the internet # directly from the internet

View File

@ -21,6 +21,7 @@ EMPTY_SNAPSHOT = os.environ.get('EMPTY_SNAPSHOT', 'empty')
INTERFACE_ORDER = ('internal', 'public', 'private') INTERFACE_ORDER = ('internal', 'public', 'private')
PUBLIC_FORWARD = os.environ.get('PUBLIC_FORWARD', None) PUBLIC_FORWARD = os.environ.get('PUBLIC_FORWARD', None)
PUBLIC_FORWARD = 'nat'
FORWARDING = { FORWARDING = {
'public': PUBLIC_FORWARD, 'public': PUBLIC_FORWARD,

View File

@ -233,6 +233,7 @@ cp -r ${SOURCE}/isolinux ${repodir}/centos/fuelweb/x86_64
cp -r ${SOURCE}/repodata ${repodir}/centos/fuelweb/x86_64 cp -r ${SOURCE}/repodata ${repodir}/centos/fuelweb/x86_64
cp -r ${SOURCE}/Packages ${repodir}/centos/fuelweb/x86_64 cp -r ${SOURCE}/Packages ${repodir}/centos/fuelweb/x86_64
cp ${SOURCE}/.treeinfo ${repodir}/centos/fuelweb/x86_64 cp ${SOURCE}/.treeinfo ${repodir}/centos/fuelweb/x86_64
cp -r ${SOURCE}/rhel ${repodir}
# Copying eggs/gems to the nailgun directory # Copying eggs/gems to the nailgun directory
cp -r ${SOURCE}/eggs ${repodir} cp -r ${SOURCE}/eggs ${repodir}

View File

@ -12,10 +12,21 @@ $(BUILD_DIR)/iso/isoroot-centos.done: \
$(BUILD_DIR)/iso/isoroot-dotfiles.done $(BUILD_DIR)/iso/isoroot-dotfiles.done
mkdir -p $(ISOROOT) mkdir -p $(ISOROOT)
rsync -rp $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/ $(ISOROOT) rsync -rp $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/ $(ISOROOT)
createrepo -g $(ISOROOT)/repodata/comps.xml \ createrepo -g $(ISOROOT)/repodata/comps.xml -x 'rhel/*' \
-u media://`head -1 $(ISOROOT)/.discinfo` $(ISOROOT) -u media://`head -1 $(ISOROOT)/.discinfo` $(ISOROOT)
$(ACTION.TOUCH) $(ACTION.TOUCH)
$(BUILD_DIR)/iso/isoroot-rhel.done: $(call depv,CACHE_RHEL)
$(BUILD_DIR)/iso/isoroot-rhel.done: \
$(BUILD_DIR)/mirror/build.done \
$(BUILD_DIR)/packages/build.done \
$(BUILD_DIR)/iso/isoroot-dotfiles.done
ifeq ($(CACHE_RHEL),1)
mkdir -p $(ISOROOT)/rhel
rsync -rp $(LOCAL_MIRROR_RHEL)/ $(ISOROOT)/rhel
endif
$(ACTION.TOUCH)
$(BUILD_DIR)/iso/isoroot-eggs.done: \ $(BUILD_DIR)/iso/isoroot-eggs.done: \
$(BUILD_DIR)/mirror/build.done \ $(BUILD_DIR)/mirror/build.done \
$(BUILD_DIR)/packages/build.done $(BUILD_DIR)/packages/build.done
@ -110,6 +121,7 @@ $(BUILD_DIR)/iso/isoroot.done: \
$(BUILD_DIR)/mirror/build.done \ $(BUILD_DIR)/mirror/build.done \
$(BUILD_DIR)/packages/build.done \ $(BUILD_DIR)/packages/build.done \
$(BUILD_DIR)/iso/isoroot-centos.done \ $(BUILD_DIR)/iso/isoroot-centos.done \
$(BUILD_DIR)/iso/isoroot-rhel.done \
$(BUILD_DIR)/iso/isoroot-eggs.done \ $(BUILD_DIR)/iso/isoroot-eggs.done \
$(BUILD_DIR)/iso/isoroot-gems.done \ $(BUILD_DIR)/iso/isoroot-gems.done \
$(BUILD_DIR)/iso/isoroot-files.done \ $(BUILD_DIR)/iso/isoroot-files.done \

View File

@ -1,6 +1,6 @@
include $(SOURCE_DIR)/mirror/centos/yum_repos.mk include $(SOURCE_DIR)/mirror/centos/yum_repos.mk
.PHONY: show-yum-urls .PHONY: show-yum-urls-centos
$(BUILD_DIR)/mirror/centos/etc/yum.conf: $(call depv,yum_conf) $(BUILD_DIR)/mirror/centos/etc/yum.conf: $(call depv,yum_conf)
$(BUILD_DIR)/mirror/centos/etc/yum.conf: export contents:=$(yum_conf) $(BUILD_DIR)/mirror/centos/etc/yum.conf: export contents:=$(yum_conf)
@ -42,7 +42,7 @@ $(BUILD_DIR)/mirror/centos/yum.done: \
$(REQUIRED_RPMS) $(REQUIRED_RPMS)
$(ACTION.TOUCH) $(ACTION.TOUCH)
show-yum-urls: \ show-yum-urls-centos: \
$(BUILD_DIR)/mirror/centos/yum-config.done \ $(BUILD_DIR)/mirror/centos/yum-config.done \
$(SOURCE_DIR)/requirements-rpm.txt $(SOURCE_DIR)/requirements-rpm.txt
yum -c $(BUILD_DIR)/mirror/centos/etc/yum.conf clean all yum -c $(BUILD_DIR)/mirror/centos/etc/yum.conf clean all

View File

@ -136,6 +136,14 @@ enabled = 1
priority=95 priority=95
endef endef
define yum_repo_subscr_manager
[rh-subscr-manager]
name = RedHat subscription manager
baseurl=http://repos.fedorapeople.org/repos/candlepin/subscription-manager/epel-6Server/x86_64/
gpgcheck=0
enabled=1
endef
define yum_repo_proprietary define yum_repo_proprietary
[proprietary] [proprietary]
name = RHEL $(CENTOS_RELEASE) - Proprietary name = RHEL $(CENTOS_RELEASE) - Proprietary

View File

@ -9,12 +9,14 @@ clean-mirror: clean-mirror-eggs
include $(SOURCE_DIR)/mirror/src/module.mk include $(SOURCE_DIR)/mirror/src/module.mk
include $(SOURCE_DIR)/mirror/centos/module.mk include $(SOURCE_DIR)/mirror/centos/module.mk
include $(SOURCE_DIR)/mirror/rhel/module.mk
include $(SOURCE_DIR)/mirror/eggs/module.mk include $(SOURCE_DIR)/mirror/eggs/module.mk
include $(SOURCE_DIR)/mirror/gems/module.mk include $(SOURCE_DIR)/mirror/gems/module.mk
$(BUILD_DIR)/mirror/build.done: \ $(BUILD_DIR)/mirror/build.done: \
$(BUILD_DIR)/mirror/src/build.done \ $(BUILD_DIR)/mirror/src/build.done \
$(BUILD_DIR)/mirror/centos/build.done \ $(BUILD_DIR)/mirror/centos/build.done \
$(BUILD_DIR)/mirror/rhel/build.done \
$(BUILD_DIR)/mirror/eggs/build.done \ $(BUILD_DIR)/mirror/eggs/build.done \
$(BUILD_DIR)/mirror/gems/build.done $(BUILD_DIR)/mirror/gems/build.done
$(ACTION.TOUCH) $(ACTION.TOUCH)

24
mirror/rhel/boot.mk Normal file
View File

@ -0,0 +1,24 @@
ISOLINUX_FILES:=boot.msg grub.conf initrd.img isolinux.bin memtest splash.jpg vesamenu.c32 vmlinuz
IMAGES_FILES:=efiboot.img efidisk.img install.img
EFI_FILES:=BOOTX64.conf BOOTX64.efi splash.xpm.gz
# isolinux files
$(addprefix $(LOCAL_MIRROR_RHEL)/isolinux/,$(ISOLINUX_FILES)):
@mkdir -p $(@D)
wget -O $@ $(MIRROR_RHEL_BOOT)/isolinux/$(@F)
# EFI boot images
$(addprefix $(LOCAL_MIRROR_RHEL)/EFI/BOOT/,$(EFI_FILES)):
@mkdir -p $(@D)
wget -O $@ $(MIRROR_RHEL_BOOT)/EFI/BOOT/$(@F)
# boot images
$(addprefix $(LOCAL_MIRROR_RHEL)/images/,$(IMAGES_FILES)):
@mkdir -p $(@D)
wget -O $@ $(MIRROR_RHEL_BOOT)/images/$(@F)
$(BUILD_DIR)/mirror/rhel/boot.done: \
$(addprefix $(LOCAL_MIRROR_RHEL)/images/,$(IMAGES_FILES)) \
$(addprefix $(LOCAL_MIRROR_RHEL)/EFI/BOOT/,$(EFI_FILES)) \
$(addprefix $(LOCAL_MIRROR_RHEL)/isolinux/,$(ISOLINUX_FILES))
$(ACTION.TOUCH)

14
mirror/rhel/module.mk Normal file
View File

@ -0,0 +1,14 @@
ifeq ($(CACHE_RHEL),1)
# This module downloads required rpm packages and creates rpm repository.
include $(SOURCE_DIR)/mirror/rhel/repo.mk
# This module downloads installation images.
include $(SOURCE_DIR)/mirror/rhel/boot.mk
$(BUILD_DIR)/mirror/rhel/build.done: \
$(BUILD_DIR)/mirror/rhel/repo.done \
$(BUILD_DIR)/mirror/rhel/boot.done
$(ACTION.TOUCH)
else
$(BUILD_DIR)/mirror/rhel/build.done:
$(ACTION.TOUCH)
endif

87
mirror/rhel/repo.mk Normal file
View File

@ -0,0 +1,87 @@
include $(SOURCE_DIR)/mirror/rhel/yum_repos.mk
.PHONY: show-yum-urls-rhel
$(BUILD_DIR)/mirror/rhel/etc/yum.conf: $(call depv,rhel_yum_conf)
$(BUILD_DIR)/mirror/rhel/etc/yum.conf: export contents:=$(rhel_yum_conf)
$(BUILD_DIR)/mirror/rhel/etc/yum.conf:
mkdir -p $(@D)
/bin/echo -e "$${contents}" > $@
$(BUILD_DIR)/mirror/rhel/etc/yum-plugins/priorities.py: \
$(SOURCE_DIR)/mirror/rhel/yum-priorities-plugin.py
mkdir -p $(@D)
cp $(SOURCE_DIR)/mirror/rhel/yum-priorities-plugin.py $@
$(BUILD_DIR)/mirror/rhel/etc/yum/pluginconf.d/priorities.conf:
mkdir -p $(@D)
/bin/echo -e "[main]\nenabled=1\ncheck_obsoletes=1\nfull_match=1" > $@
$(BUILD_DIR)/mirror/rhel/etc/yum.repos.d/base.repo: $(call depv,YUM_REPOS)
$(BUILD_DIR)/mirror/rhel/etc/yum.repos.d/base.repo: \
export contents:=$(foreach repo,$(YUM_REPOS),\n$(rhel_yum_repo_$(repo))\n)
$(BUILD_DIR)/mirror/rhel/etc/yum.repos.d/base.repo:
@mkdir -p $(@D)
/bin/echo -e "$${contents}" > $@
$(BUILD_DIR)/mirror/rhel/yum-config.done: \
$(BUILD_DIR)/mirror/rhel/etc/yum.conf \
$(BUILD_DIR)/mirror/rhel/etc/yum.repos.d/base.repo \
$(BUILD_DIR)/mirror/rhel/etc/yum-plugins/priorities.py \
$(BUILD_DIR)/mirror/rhel/etc/yum/pluginconf.d/priorities.conf
$(ACTION.TOUCH)
$(BUILD_DIR)/mirror/rhel/yum.done: $(call depv,REQ_RHEL_RPMS)
$(BUILD_DIR)/mirror/rhel/yum.done: \
$(BUILD_DIR)/mirror/rhel/yum-config.done
yum -c $(BUILD_DIR)/mirror/rhel/etc/yum.conf clean all
rm -rf /var/tmp/yum-$$USER-*/
yumdownloader -q --resolve --archlist=$(CENTOS_ARCH) \
-c $(BUILD_DIR)/mirror/rhel/etc/yum.conf \
--destdir=$(LOCAL_MIRROR_RHEL)/Packages \
`echo $(REQ_RHEL_RPMS) | /bin/sed 's/-[0-9][0-9\.a-zA-Z_-]\+//g'`
$(ACTION.TOUCH)
show-yum-urls-rhel: $(call depv,REQ_RHEL_RPMS)
show-yum-urls-rhel: \
$(BUILD_DIR)/mirror/rhel/yum-config.done
yum -c $(BUILD_DIR)/mirror/rhel/etc/yum.conf clean all
rm -rf /var/tmp/yum-$$USER-*/
yumdownloader --urls -q --resolve --archlist=$(CENTOS_ARCH) \
-c $(BUILD_DIR)/mirror/rhel/etc/yum.conf \
--destdir=$(LOCAL_MIRROR_RHEL)/Packages \
`echo $(REQ_RHEL_RPMS) | /bin/sed 's/-[0-9][0-9\.a-zA-Z_-]\+//g'`
$(LOCAL_MIRROR_RHEL)/repodata/comps.xml: \
export COMPSXML=$(shell wget -qO- $(MIRROR_RHEL)/repodata/repomd.xml | grep -m 1 '$(@F)' | awk -F'"' '{ print $$2 }')
$(LOCAL_MIRROR_RHEL)/repodata/comps.xml:
@mkdir -p $(@D)
if ( echo $${COMPSXML} | grep -q '\.gz$$' ); then \
wget -O $@.gz $(MIRROR_RHEL)/$${COMPSXML}; \
gunzip $@.gz; \
else \
wget -O $@ $(MIRROR_RHEL)/$${COMPSXML}; \
fi
# These packages are used by FUEL but RHEL repo doesn't contain them. So we
# need to download them from some external repo and put into rhel/fuel repo.
HACK_PACKAGES:=xinetd-2.3.14-38.el6.x86_64.rpm xfsprogs-3.1.1-10.el6.x86_64.rpm qpid-cpp-server-cluster-0.14-22.el6_3.x86_64.rpm \
qpid-cpp-server-store-0.14-22.el6_3.x86_64.rpm qpid-tests-0.14-1.el6_2.noarch.rpm qpid-tools-0.14-6.el6_3.noarch.rpm \
qpid-cpp-server-ssl-0.14-22.el6_3.x86_64.rpm
HACK_URLS:=$(addprefix http://mirror.yandex.ru/centos/6.4/os/x86_64/Packages/,$(HACK_PACKAGES))
$(BUILD_DIR)/mirror/rhel/fuel.done:
mkdir -p $(LOCAL_MIRROR)/mirror/rhel/fuel/Packages
-wget -c -i $(SOURCE_DIR)/puppet/rpmcache/files/req-fuel-rhel.txt -B http://download.mirantis.com/epel-fuel-grizzly/x86_64/ -P $(LOCAL_MIRROR)/rhel/fuel/Packages
-wget -c -i $(SOURCE_DIR)/puppet/rpmcache/files/req-fuel-rhel.txt -B http://download.mirantis.com/epel-fuel-grizzly/noarch/ -P $(LOCAL_MIRROR)/rhel/fuel/Packages
-wget -c -i $(SOURCE_DIR)/puppet/rpmcache/files/req-fuel-rhel.txt -B http://srv11-msk.msk.mirantis.net/rhel6/fuel-rpms/x86_64/ -P $(LOCAL_MIRROR)/rhel/fuel/Packages
-wget -c -P $(LOCAL_MIRROR)/rhel/fuel/Packages $(HACK_URLS)
$(ACTION.TOUCH)
$(BUILD_DIR)/mirror/rhel/repo.done: \
$(BUILD_DIR)/mirror/rhel/yum.done \
$(BUILD_DIR)/mirror/rhel/fuel.done \
| $(LOCAL_MIRROR_RHEL)/repodata/comps.xml
createrepo -g $(LOCAL_MIRROR_RHEL)/repodata/comps.xml \
-o $(LOCAL_MIRROR_RHEL)/ $(LOCAL_MIRROR_RHEL)/
$(ACTION.TOUCH)

View File

@ -0,0 +1,209 @@
#!/usr/bin/python
#
# yum-plugin-priorities 0.0.7
#
# Copyright (c) 2006-2007 Daniel de Kok
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# This plugins is inspired by the protectbase plugin, and enables/disables
# packages based on a repository priority.
#
# You can install this plugin by copying it to /usr/lib/yum-plugins. To
# enable this plugin, make sure that you have 'plugins=1' in /etc/yum.conf,
# and create the file /etc/yum/pluginconf.d/priorities.conf with the
# following content:
#
# [main]
# enabled=1
#
# If you also want the plugin to protect high-priority repositories against
# obsoletes in low-priority repositories, enable the 'check_obsoletes' bool:
#
# check_obsoletes=1
#
# By default, this plugin excludes packages from lower priority repositories
# based on the package name. If you want to exclude packages based only the
# package name and architecture, enable the 'only_samearch' bool:
#
# only_samearch=1
#
# If you want to be able to set package as the fully qualified package name
# including architecture and package version, enable 'full_match' bool:
#
# full_match=1
#
# If full_match is enabled then check_obsoletes will be forced to disable
#
# You can add priorities to repositories, by adding the line:
#
# priority=N
#
# to the repository entry, where N is an integer number. The default
# priority for repositories is 99. The repositories with the lowest
# number have the highest priority.
#
# Please report errors to Daniel de Kok <danieldk@pobox.com>
from yum.constants import *
from yum.plugins import TYPE_CORE
from yum import config
import yum
check_obsoletes = False
only_samearch = False
full_match = False
requires_api_version = '2.1'
plugin_type = (TYPE_CORE,)
def config_hook(conduit):
global check_obsoletes
global only_samearch
global full_match
# Plugin configuration
check_obsoletes = conduit.confBool('main', 'check_obsoletes', default = False)
only_samearch = conduit.confBool('main', 'only_samearch', default = False)
full_match = conduit.confBool('main', 'full_match', default = False)
if full_match:
check_obsoletes = False
# Repo priorities
if yum.__version__ >= '2.5.0':
# New style : yum >= 2.5
config.RepoConf.priority = config.IntOption(99)
else:
# Old add extra options style
conduit.registerOpt('priority', PLUG_OPT_INT, PLUG_OPT_WHERE_REPO, 99)
# Command-line options.
parser = conduit.getOptParser()
if parser:
if hasattr(parser, 'plugin_option_group'):
parser = parser.plugin_option_group
parser.add_option('', '--samearch-priorities', dest='samearch',
action='store_true', default = False,
help="Priority-exclude packages based on name + arch")
def _all_repo_priorities_same(allrepos):
""" Are all repos at the same priority """
first = None
for repo in allrepos:
if first is None:
first = repo.priority
elif first != repo.priority:
return False
return True
def exclude_hook(conduit):
global only_samearch
global check_obsoletes
global full_match
allrepos = conduit.getRepos().listEnabled()
# If they haven't done anything, don't do any work
if _all_repo_priorities_same(allrepos):
return
# Check whether the user specified the --samearch option.
opts, commands = conduit.getCmdLine()
if opts and opts.samearch:
only_samearch = True
cnt = 0
if check_obsoletes and not conduit._base.conf.obsoletes:
check_obsoletes = False
if check_obsoletes:
obsoletes = conduit._base.up.rawobsoletes
# Build a dictionary with package priorities. Either with arch or
# archless, based on the user's settings.
if only_samearch:
pkg_priorities = dict()
if check_obsoletes or not only_samearch:
pkg_priorities_archless = dict()
for repo in allrepos:
if repo.enabled:
if only_samearch:
repopkgs = _pkglist_to_dict(conduit.getPackages(repo), repo.priority, True)
_mergeprioritydicts(pkg_priorities, repopkgs)
if check_obsoletes or not only_samearch:
repopkgs_archless = _pkglist_to_dict(conduit.getPackages(repo), repo.priority)
_mergeprioritydicts(pkg_priorities_archless, repopkgs_archless)
# Eliminate packages that have a low priority
for repo in allrepos:
if repo.enabled:
for po in conduit.getPackages(repo):
delPackage = False
if full_match:
pname = str(po)
else:
pname = po.name
if only_samearch:
key = "%s.%s" % (pname,po.arch)
if key in pkg_priorities and pkg_priorities[key] < repo.priority:
delPackage = True
else:
key = "%s" % pname
if key in pkg_priorities_archless and pkg_priorities_archless[key] < repo.priority:
delPackage = True
if delPackage:
conduit.delPackage(po)
cnt += 1
conduit.info(3," --> %s from %s excluded (priority)" % (po,po.repoid))
# If this packages obsoletes other packages, check whether
# one of the obsoleted packages is not available through
# a repo with a higher priority. If so, remove this package.
if check_obsoletes:
if po.pkgtup in obsoletes:
obsolete_pkgs = obsoletes[po.pkgtup]
for obsolete_pkg in obsolete_pkgs:
pkg_name = obsolete_pkg[0]
if pkg_name in pkg_priorities_archless and pkg_priorities_archless[pkg_name] < repo.priority:
conduit.delPackage(po)
cnt += 1
conduit.info(3," --> %s from %s excluded (priority)" % (po,po.repoid))
break
if cnt:
conduit.info(2, '%d packages excluded due to repository priority protections' % cnt)
if check_obsoletes:
# Atm. the update object doesn't get updated when we manually exclude
# things ... so delete it. This needs to be re-written.
conduit._base.up = None
def _pkglist_to_dict(pl, priority, addArch = False):
global full_match
out = dict()
for p in pl:
if full_match:
pname = str(p)
else:
pname = p.name
if addArch:
key = "%s.%s" % (pname,p.arch)
out[key] = priority
else:
out[pname] = priority
return out
def _mergeprioritydicts(dict1, dict2):
for package in dict2.keys():
if package not in dict1 or dict2[package] < dict1[package]:
dict1[package] = dict2[package]

72
mirror/rhel/yum_repos.mk Normal file
View File

@ -0,0 +1,72 @@
define rhel_yum_conf
[main]
cachedir=$(BUILD_DIR)/mirror/rhel/cache
keepcache=0
debuglevel=6
logfile=$(BUILD_DIR)/mirror/rhel/yum.log
exclude=*.i686.rpm
exactarch=1
obsoletes=1
gpgcheck=0
plugins=1
pluginpath=$(BUILD_DIR)/mirror/rhel/etc/yum-plugins
pluginconfpath=$(BUILD_DIR)/mirror/rhel/etc/yum/pluginconf.d
reposdir=$(BUILD_DIR)/mirror/rhel/etc/yum.repos.d
endef
define rhel_yum_repo_puppetlabs
[puppetlabs]
name=Puppet Labs Packages
baseurl=http://yum.puppetlabs.com/el/$(CENTOS_MAJOR)/products/$(CENTOS_ARCH)/
enabled=1
gpgcheck=1
gpgkey=http://yum.puppetlabs.com/RPM-GPG-KEY-puppetlabs
priority=1
endef
define rhel_yum_repo_proprietary
[proprietary]
name = RHEL $(CENTOS_RELEASE) - Proprietary
baseurl = $(MIRROR_RHEL)
gpgcheck = 0
enabled = 1
priority=1
endef
define rhel_yum_repo_rhel
[rhel-os-30-puddle]
name=OpenStack-3.0-Puddle
baseurl=http://srv11-msk.msk.mirantis.net/rhel6/OpenStack-3.0-Puddle
gpgcheck=0
enabled=1
[rhel-server-rpms]
name=rhel-6-server-rpms
baseurl=http://srv11-msk.msk.mirantis.net/rhel6/rhel-6-server-rpms
gpgcheck=0
enabled=1
[rhel-server-optional-rpms]
name=rhel-6-server-optional-rpms
baseurl=http://srv11-msk.msk.mirantis.net/rhel6/rhel-6-server-optional-rpms
gpgcheck=0
enabled=1
[rhel-ha-rpms]
name=rhel-ha-for-rhel-6-server-rpms
baseurl=http://srv11-msk.msk.mirantis.net/rhel6/rhel-ha-for-rhel-6-server-rpms
gpgcheck=0
enabled=1
[rhel-lb-rpms]
name=rhel-lb-for-rhel-6-server-rpms
baseurl=http://srv11-msk.msk.mirantis.net/rhel6/rhel-lb-for-rhel-6-server-rpms
gpgcheck=0
enabled=1
[rhel-rs-rpms]
name=rhel-rs-for-rhel-6-server-rpms
baseurl=http://srv11-msk.msk.mirantis.net/rhel6/rhel-rs-for-rhel-6-server-rpms
gpgcheck=0
enabled=1
endef

View File

@ -98,6 +98,33 @@
}, },
"attributes_metadata": { "attributes_metadata": {
"editable": { "editable": {
"os": {
"distro": {
"value": "centos",
"values": [
{
"data": "centos",
"display_name": "CentOS",
"description": "CentOS"
},
{
"data": "rhel",
"display_name": "RHEL",
"description": "RHEL"
}
],
"label": "Operation System",
"weight": 10
},
"rh_username": {
"label": "Red Hat user",
"weight": 20
},
"rh_password": {
"label": "Red Hat password",
"weight": 30
}
},
"access": { "access": {
"user": { "user": {
"value": "admin", "value": "admin",

View File

@ -65,7 +65,8 @@ MASTER_IP: "127.0.0.1"
COBBLER_URL: "http://localhost/cobbler_api" COBBLER_URL: "http://localhost/cobbler_api"
COBBLER_USER: "cobbler" COBBLER_USER: "cobbler"
COBBLER_PASSWORD: "cobbler" COBBLER_PASSWORD: "cobbler"
COBBLER_PROFILE: "centos-x86_64" COBBLER_CENTOS_PROFILE: "centos-x86_64"
COBBLER_RHEL_PROFILE: "rhel-x86_64"
TRUNCATE_LOG_ENTRIES: 100 TRUNCATE_LOG_ENTRIES: 100
UI_LOG_DATE_FORMAT: '%Y-%m-%d %H:%M:%S' UI_LOG_DATE_FORMAT: '%Y-%m-%d %H:%M:%S'

View File

@ -273,8 +273,13 @@ class ProvisionTask(object):
(node.name, node.id) (node.name, node.id)
) )
if cluster_attrs.get('os', dict()).get('distro', '') == 'rhel':
cobbler_profile = settings.COBBLER_RHEL_PROFILE
else:
cobbler_profile = settings.COBBLER_CENTOS_PROFILE
node_data = { node_data = {
'profile': settings.COBBLER_PROFILE, 'profile': cobbler_profile,
'power_type': 'ssh', 'power_type': 'ssh',
'power_user': 'root', 'power_user': 'root',
'power_address': node.ip, 'power_address': node.ip,

View File

@ -93,6 +93,11 @@ $(BUILD_DIR)/packages/rpm/repo.done: \
find $(BUILD_DIR)/packages/rpm/RPMS -name '*.rpm' -exec cp -u {} $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/Packages \; find $(BUILD_DIR)/packages/rpm/RPMS -name '*.rpm' -exec cp -u {} $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/Packages \;
createrepo -g $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/repodata/comps.xml \ createrepo -g $(LOCAL_MIRROR_CENTOS_OS_BASEURL)/repodata/comps.xml \
-o $(LOCAL_MIRROR_CENTOS_OS_BASEURL) $(LOCAL_MIRROR_CENTOS_OS_BASEURL) -o $(LOCAL_MIRROR_CENTOS_OS_BASEURL) $(LOCAL_MIRROR_CENTOS_OS_BASEURL)
ifeq ($(CACHE_RHEL),1)
find $(BUILD_DIR)/packages/rpm/RPMS -name '*.rpm' -exec cp -u {} $(LOCAL_MIRROR_RHEL)/Packages \;
createrepo -g $(LOCAL_MIRROR_RHEL)/repodata/comps.xml \
-o $(LOCAL_MIRROR_RHEL) $(LOCAL_MIRROR_RHEL)
endif
$(ACTION.TOUCH) $(ACTION.TOUCH)
$(BUILD_DIR)/packages/rpm/build.done: $(BUILD_DIR)/packages/rpm/repo.done $(BUILD_DIR)/packages/rpm/build.done: $(BUILD_DIR)/packages/rpm/repo.done

View File

@ -10,6 +10,14 @@ node default {
"url" => "http://${ipaddress}:8080/centos/fuelweb/x86_64" "url" => "http://${ipaddress}:8080/centos/fuelweb/x86_64"
}, },
] ]
$rhel_repos =
[
{
"id" => "nailgun",
"name" => "Nailgun",
"url" => "http://${ipaddress}:8080/rhel"
},
]
$cobbler_user = "cobbler" $cobbler_user = "cobbler"
$cobbler_password = "cobbler" $cobbler_password = "cobbler"

View File

@ -1,15 +1,10 @@
class nailgun::cobbler( class nailgun::cobbler(
$cobbler_user = "cobbler", $cobbler_user = "cobbler",
$cobbler_password = "cobbler", $cobbler_password = "cobbler",
$centos_repos,
$gem_source, $gem_source,
$ks_system_timezone = "Etc/UTC", $ks_system_timezone = "Etc/UTC",
# default password is 'r00tme' # default password is 'r00tme'
$ks_encrypted_root_password = "\$6\$tCD3X7ji\$1urw6qEMDkVxOkD33b4TpQAjRiCeDZx0jmgMhDYhfB9KuGfqO9OcMaKyUxnGGWslEDQ4HxTw7vcAMP85NxQe61", $ks_encrypted_root_password = "\$6\$tCD3X7ji\$1urw6qEMDkVxOkD33b4TpQAjRiCeDZx0jmgMhDYhfB9KuGfqO9OcMaKyUxnGGWslEDQ4HxTw7vcAMP85NxQe61",
){ ){
anchor { "nailgun-cobbler-begin": } anchor { "nailgun-cobbler-begin": }

View File

@ -137,7 +137,6 @@ class nailgun(
class { "nailgun::cobbler": class { "nailgun::cobbler":
cobbler_user => "cobbler", cobbler_user => "cobbler",
cobbler_password => "cobbler", cobbler_password => "cobbler",
centos_repos => $centos_repos,
gem_source => $gem_source, gem_source => $gem_source,
} }

View File

@ -4,11 +4,6 @@ install
# INSTALLATION SOURCE (centos repository) # INSTALLATION SOURCE (centos repository)
url --url=$tree url --url=$tree
# ALTERNATIVE REPOSITORIES
<% ks_repo.each do |repo| %>
repo --name=<%= repo['name'] %> --baseurl=<%= repo['url'] %>
<% end %>
# KEYBOARD AND LANGUAGE CUSTOMIZATION # KEYBOARD AND LANGUAGE CUSTOMIZATION
lang en_US.UTF-8 lang en_US.UTF-8
keyboard us keyboard us
@ -120,6 +115,9 @@ ruby-devel
system-config-firewall-base system-config-firewall-base
wget wget
yum yum
#if $getVar("profile_name","") == "rhel-x86_64"
subscription-manager
#end if
# COBBLER EMBEDDED SNIPPET: 'puppet_install_if_enabled' # COBBLER EMBEDDED SNIPPET: 'puppet_install_if_enabled'
# LISTS puppet PACKAGE IF puppet_auto_setup VARIABLE IS SET TO 1 # LISTS puppet PACKAGE IF puppet_auto_setup VARIABLE IS SET TO 1
@ -210,6 +208,10 @@ $SNIPPET('target_logs_to_master')
# Dhclient should ignore option 'routers' on all interfaces. # Dhclient should ignore option 'routers' on all interfaces.
$SNIPPET('dhclient_ignore_routers_opt') $SNIPPET('dhclient_ignore_routers_opt')
# COBBLER EMBEDDED SNIPPETS AROUND RHEL REGISTRATION
$SNIPPET('redhat_register')
$SNIPPET('rhn_certificate_based_register')
# COBBLER EMBEDDED SNIPPET: 'kickstart_done' # COBBLER EMBEDDED SNIPPET: 'kickstart_done'
# DISABLES PXE BOOTING # DISABLES PXE BOOTING
$SNIPPET('kickstart_done') $SNIPPET('kickstart_done')

View File

@ -1,9 +1,7 @@
rm /etc/yum.repos.d/*.repo rm /etc/yum.repos.d/*.repo
cat > /etc/yum.repos.d/nailgun.repo << EOF cat > /etc/yum.repos.d/nailgun.repo << EOF
<% ks_repo.each do |repo| %> [fuelweb]
[<%= repo['id'] %>] name=Fuelweb
name=<%= repo['name'] %> baseurl=$tree
baseurl=<%= repo['url'] %>
gpgcheck=0 gpgcheck=0
<% end %>
EOF EOF

View File

@ -54,7 +54,8 @@ MASTER_IP: "<%= ipaddress %>"
COBBLER_URL: "<%= scope.lookupvar('nailgun::cobbler_url') %>" COBBLER_URL: "<%= scope.lookupvar('nailgun::cobbler_url') %>"
COBBLER_USER: "<%= cobbler_user %>" COBBLER_USER: "<%= cobbler_user %>"
COBBLER_PASSWORD: "<%= cobbler_password %>" COBBLER_PASSWORD: "<%= cobbler_password %>"
COBBLER_PROFILE: "centos-x86_64" COBBLER_CENTOS_PROFILE: "centos-x86_64"
COBBLER_RHEL_PROFILE: "rhel-x86_64"
MCO_PSKEY: "<%= mco_pskey %>" MCO_PSKEY: "<%= mco_pskey %>"
MCO_VHOST: "<%= mco_vhost %>" MCO_VHOST: "<%= mco_vhost %>"

View File

@ -0,0 +1,14 @@
node default {
class { "rpmcache":
releasever => "6Server",
pkgdir => "/var/www/nailgun/rhel",
rh_username => "your_rh_username",
rh_password => "your_rh_password",
rh_base_channels => "rhel-6-server-rpms rhel-6-server-optional-rpms rhel-lb-for-rhel-6-server-rpms rhel-rs-for-rhel-6-server-rpms rhel-ha-for-rhel-6-server-rpms rhel-server-ost-6-folsom-rpms",
#rh_openstack_channel => "rhel-server-ost-6-folsom-rpms",
rh_openstack_channel => "rhel-server-ost-6-3-rpms",
use_satellite => false,
sat_hostname => undef,
activation_key => undef
}
}

View File

@ -0,0 +1,34 @@
-----BEGIN CERTIFICATE-----
MIIF9DCCA9ygAwIBAgIJALDxRLt/tUrTMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD
VQQGEwJVUzEXMBUGA1UECAwOTm9ydGggQ2F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su7NiOo0eGoARdraw3V8yuy4p5zrUuXY1+8mOQsoO+B
UiHuQztqyU1hU4/oFN8L8knv+5/PdRmbJWIf9YOX4Bh2CTcmoIg7nDmvKsL0jIHN
i/abQephtZ+mFje4fDm6fed0sly7z4EY/kX441AQaX4NEfnwiX0mncfBtFrt2+Q+
ASF8VH7WEj4G21rYLsTT/Y0rMLFnDsvHc8FFxT3ZgrJoSKF/L9pApkIC7J8qIy+y
bOz7imghfsj01AImnIQgZ8g2hntXGofBGf93mbDYxlMmNvNJ/5Sb1gnIDSIQTIPq
qOuJZBFu7GlBeaUAluHyiRniBtUW/UXwzMr7hHxW9YnRfGC2KRKjvZ8ePCFrswCO
oWc6rp6jp8QL/vmDc0saG3lV2ka4eTS9t0Q0cwLzBL317mpcY0O553eGVNq8MyUQ
AeXfirYf2dqRMZEXkqIlR82HcNVEaGDxwwi2LbWeOJGHuDIUjY5xwBNjtsFKvv0m
G43B6Ue7EusIWljtXbk4WS2XXmNklozG5AGph0GBJrLYbRToPX7tWxa5+nN38BvH
X9zeiL1lom9bbaQCCCp3N0DbtRRiNa/HjbD2Z6cnCH/SN5BxN5whR3R3SsVzD9zW
m+AwyX9DvfLMqApj
=SsXO
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -0,0 +1,114 @@
GeoIP-1.4.8-1.el6.x86_64.rpm
MySQL-client-5.5.28-6.x86_64.rpm
MySQL-client-wsrep-5.5.28_wsrep_23.7-12.x86_64.rpm
MySQL-python-1.2.3-0.3.c1.2.el6.x86_64.rpm
MySQL-server-5.5.28-6.x86_64.rpm
MySQL-server-wsrep-5.5.28_wsrep_23.7-12.x86_64.rpm
MySQL-shared-5.5.28-6.x86_64.rpm
MySQL-shared-wsrep-5.5.28_wsrep_23.7-12.x86_64.rpm
cirros-testvm-0.3.0-3.x86_64.rpm
cobbler-2.2.3-2.el6.noarch.rpm
cobbler-web-2.2.3-2.el6.noarch.rpm
crmsh-1.2.5-55.2.x86_64.rpm
erlang-R14B-04.8.el6.x86_64.rpm
erlang-appmon-R14B-04.8.el6.x86_64.rpm
erlang-asn1-R14B-04.8.el6.x86_64.rpm
erlang-common_test-R14B-04.8.el6.x86_64.rpm
erlang-compiler-R14B-04.8.el6.x86_64.rpm
erlang-cosEvent-R14B-04.8.el6.x86_64.rpm
erlang-cosEventDomain-R14B-04.8.el6.x86_64.rpm
erlang-cosFileTransfer-R14B-04.8.el6.x86_64.rpm
erlang-cosNotification-R14B-04.8.el6.x86_64.rpm
erlang-cosProperty-R14B-04.8.el6.x86_64.rpm
erlang-cosTime-R14B-04.8.el6.x86_64.rpm
erlang-cosTransactions-R14B-04.8.el6.x86_64.rpm
erlang-crypto-R14B-04.8.el6.x86_64.rpm
erlang-debugger-R14B-04.8.el6.x86_64.rpm
erlang-dialyzer-R14B-04.8.el6.x86_64.rpm
erlang-diameter-R14B-04.8.el6.x86_64.rpm
erlang-docbuilder-R14B-04.8.el6.x86_64.rpm
erlang-edoc-R14B-04.8.el6.x86_64.rpm
erlang-erl_docgen-R14B-04.8.el6.x86_64.rpm
erlang-erl_interface-R14B-04.8.el6.x86_64.rpm
erlang-erts-R14B-04.8.el6.x86_64.rpm
erlang-et-R14B-04.8.el6.x86_64.rpm
erlang-eunit-R14B-04.8.el6.x86_64.rpm
erlang-examples-R14B-04.8.el6.x86_64.rpm
erlang-gs-R14B-04.8.el6.x86_64.rpm
erlang-hipe-R14B-04.8.el6.x86_64.rpm
erlang-ic-R14B-04.8.el6.x86_64.rpm
erlang-inets-R14B-04.8.el6.x86_64.rpm
erlang-inviso-R14B-04.8.el6.x86_64.rpm
erlang-jinterface-R14B-04.8.el6.x86_64.rpm
erlang-kernel-R14B-04.8.el6.x86_64.rpm
erlang-megaco-R14B-04.8.el6.x86_64.rpm
erlang-mnesia-R14B-04.8.el6.x86_64.rpm
erlang-observer-R14B-04.8.el6.x86_64.rpm
erlang-odbc-R14B-04.8.el6.x86_64.rpm
erlang-orber-R14B-04.8.el6.x86_64.rpm
erlang-os_mon-R14B-04.8.el6.x86_64.rpm
erlang-otp_mibs-R14B-04.8.el6.x86_64.rpm
erlang-parsetools-R14B-04.8.el6.x86_64.rpm
erlang-percept-R14B-04.8.el6.x86_64.rpm
erlang-pman-R14B-04.8.el6.x86_64.rpm
erlang-public_key-R14B-04.8.el6.x86_64.rpm
erlang-reltool-R14B-04.8.el6.x86_64.rpm
erlang-runtime_tools-R14B-04.8.el6.x86_64.rpm
erlang-sasl-R14B-04.8.el6.x86_64.rpm
erlang-snmp-R14B-04.8.el6.x86_64.rpm
erlang-ssh-R14B-04.8.el6.x86_64.rpm
erlang-ssl-R14B-04.8.el6.x86_64.rpm
erlang-stdlib-R14B-04.8.el6.x86_64.rpm
erlang-syntax_tools-R14B-04.8.el6.x86_64.rpm
erlang-test_server-R14B-04.8.el6.x86_64.rpm
erlang-toolbar-R14B-04.8.el6.x86_64.rpm
erlang-tools-R14B-04.8.el6.x86_64.rpm
erlang-tv-R14B-04.8.el6.x86_64.rpm
erlang-typer-R14B-04.8.el6.x86_64.rpm
erlang-webtool-R14B-04.8.el6.x86_64.rpm
erlang-wx-R14B-04.8.el6.x86_64.rpm
erlang-xmerl-R14B-04.8.el6.x86_64.rpm
euca2ools-2.1.1-2.el6.noarch.rpm
fence-agents-3.1.5-25.el6_4.2.x86_64.rpm
fence-virt-0.2.3-13.el6.x86_64.rpm
galera-23.2.2-1.rhel5.x86_64.rpm
keepalived-1.2.7-3.el6.x86_64.rpm
mcollective-2.3.1-2.el6.noarch.rpm
mcollective-2.3.1-2.el6.src.rpm
mcollective-client-2.3.1-2.el6.noarch.rpm
mcollective-common-2.3.1-2.el6.noarch.rpm
nailgun-agent-0.1.0-1.x86_64.rpm
nailgun-mcagents-0.1.0-1.x86_64.rpm
nailgun-net-check-0.0.2-1.x86_64.rpm
nginx-1.0.15-4.el6.x86_64.rpm
pssh-2.3.1-15.2.x86_64.rpm
puppet-2.7.19-1.el6.noarch.rpm
puppet-server-2.7.19-1.el6.noarch.rpm
puppetdb-1.2.0-1.el6.noarch.rpm
puppetdb-terminus-1.2.0-1.el6.noarch.rpm
python-amqp-1.2.0-6.el6.noarch.rpm
python-amqplib-1.0.2-1.el6.noarch.rpm
python-anyjson-0.3.3-2.el6.noarch.rpm
python-importlib-1.0.2-1.el6.noarch.rpm
python-kombu-2.4.7-2.el6.noarch.rpm
python-meld3-0.6.7-1.el6.x86_64.rpm
python-ordereddict-1.1-2.el6.noarch.rpm
python-pip-0.8-1.el6.noarch.rpm
python-virtualenv-1.7.2-1.el6.noarch.rpm
rabbitmq-server-2.8.7-2.el6.noarch.rpm
ruby-ri-1.8.7.352-10.el6_4.x86_64.rpm
rubygem-daemons-1.0.10-2.el6.noarch.rpm
rubygem-fastthread-1.0.7-2.el6.x86_64.rpm
rubygem-gem_plugin-0.2.3-3.el6.noarch.rpm
rubygem-mongrel-1.1.5-3.el6.x86_64.rpm
rubygem-rake-0.8.7-2.1.el6.noarch.rpm
rubygem-stomp-1.2.8-1.el6.noarch.rpm
rubygems-1.3.7-1.el6.noarch.rpm
scapy-2.0.0.10-5.el6.noarch.rpm
socat-1.7.2.1-1.el6.x86_64.rpm
supervisor-3.0a12-0.12.el6.noarch.rpm
wxBase-2.8.12-2.el6.x86_64.rpm
wxGTK-2.8.12-2.el6.x86_64.rpm
wxGTK-gl-2.8.12-2.el6.x86_64.rpm
xfsprogs-3.1.1-10.el6.i686.rpm
xfsprogs-3.1.1-10.el6.x86_64.rpm

View File

@ -0,0 +1,147 @@
Django14
MySQL-python
SDL
atk
authconfig
avahi
bind-utils
bridge-utils
btrfs-progs
cairo
cifs-utils
cluster-glue-libs
clusterlib
cman
cobbler
cobbler-web
corosync
cpp
crmsh
cronie
cronie-noanacron
crontabs
cups-libs
curl
device-mapper
device-mapper-libs
dhclient
dmidecode
dnsmasq-utils
e2fsprogs
euca2ools
fence-agents
fontconfig
freetype
gcc
gcc-c++
gtk2
haproxy
hicolor-icon-theme
httpd
iproute
iproute-doc
jasper-libs
keepalived
kernel-devel
kernel-headers
libXcomposite
libXcursor
libXdamage
libXfixes
libXft
libXinerama
libXrandr
libXrender
libXxf86vm
libpng
librelp
libthai
libtiff
lokkit
make
man
memcached
mesa-libGL
mesa-libGLU
mlocate
mpfr
mysql
mysql-libs
mysql-server
novnc
ntp
numpy
openais
openaislib
openssh-clients
openssh-server
openssl-devel
openssl098e
openstack-cinder
openstack-dashboard
openstack-glance
openstack-keystone
openstack-nova
openstack-nova-novncproxy
openstack-quantum
openstack-quantum-openvswitch
openstack-selinux
openstack-swift
openstack-swift-account
openstack-swift-container
openstack-swift-object
openstack-swift-proxy
openstack-utils
openvswitch
openvswitch-controller
pacemaker
pango
patch
policycoreutils
postgresql
postgresql-devel
postgresql-libs
postgresql-server
puppet
python-amqp
python-anyjson
python-argparse
python-cinder
python-devel
python-keystone
python-novaclient
python-oslo-config
python-quantumclient
python-rhsm
python-setuptools
python-six
python-stevedore
python-webob
python-webob1.0
python-webob1.2
qpid-cpp-client
qpid-cpp-server
qpid-cpp-server-cluster
redhat-release-server
redhat-rpm-config
resource-agents
rhel-boot-image
rhn_register
rsyslog-relp
ruby
ruby-devel
ruby-irb
ruby-rdoc
rubygems
screen
subscription-manager
system-config-firewall-base
tk
unixODBC
unzip
usermode
wget
wxBase
wxGTK
wxGTK-gl
yum-utils

View File

@ -0,0 +1,125 @@
class rpmcache ( $releasever, $pkgdir,
$rh_username, $rh_password, $rh_base_channels, $rh_openstack_channel,
$use_satellite = false, $sat_hostname = false, $activation_key = false) {
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}
package { "yum-utils":
ensure => "latest"
} ->
package { "subscription-manager":
ensure => "latest"
} ->
file { '/etc/pki/product':
ensure => directory,
} ->
file { '/etc/pki/product/69.pem':
ensure => present,
source => 'puppet:///modules/rpmcache/69.pem',
owner => 'root',
group => 'root',
mode => 0644,
} ->
file { '/etc/pki/product/191.pem':
ensure => present,
source => 'puppet:///modules/rpmcache/191.pem',
owner => 'root',
group => 'root',
mode => 0644,
} ->
file { '/etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release':
ensure => present,
source => 'puppet:///modules/rpmcache/RPM-GPG-KEY-redhat-release',
owner => 'root',
group => 'root',
mode => 0644,
} ->
file { '/etc/nailgun/':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755'
} ->
file { '/etc/nailgun/required-rpms.txt':
ensure => present,
source => 'puppet:///modules/rpmcache/required-rpms.txt',
owner => 'root',
group => 'root',
mode => 0644,
require => File['/etc/nailgun/']
} ->
file { '/usr/sbin/build_rpm_cache':
content => template('rpmcache/build_rpm_cache.erb'),
owner => 'root',
group => 'root',
mode => 0755,
} ->
exec { 'build_rpm_cache':
command => '/usr/sbin/build_rpm_cache',
require => File['/usr/sbin/build_rpm_cache'],
logoutput => true,
timeout => 0
} ->
cobbler_distro { "rhel-x86_64":
kernel => "${pkgdir}/isolinux/vmlinuz",
initrd => "${pkgdir}/isolinux/initrd.img",
arch => "x86_64",
breed => "redhat",
osversion => "rhel6",
ksmeta => "tree=http://@@server@@:8080/rhel",
} ->
cobbler_profile { "rhel-x86_64":
kickstart => "/var/lib/cobbler/kickstarts/centos-x86_64.ks",
kopts => "",
distro => "rhel-x86_64",
ksmeta => "redhat_register_user=${rh_username} redhat_register_password=${rh_password} redhat_management_type=cert",
menu => true,
require => Cobbler_distro["rhel-x86_64"],
} ->
exec {'rebuild-fuel-repo':
command => "/bin/cp /var/www/nailgun/centos/fuelweb/x86_64/repodata/comps.xml ${pkgdir}/repodata/comps.xml; /usr/bin/createrepo -g ${pkgdir}/repodata/comps.xml ${pkgdir}",
}->
exec {'check-rpm':
command => "/bin/find ${pkgdir} -name '*.rpm' | /usr/bin/xargs /bin/rpm --checksig | grep 'MD5 NOT OK'",
logoutput => true,
returns => 1,
}
$hack_packages = [
'xinetd-2.3.14-38.el6.x86_64.rpm',
'xfsprogs-3.1.1-10.el6.x86_64.rpm',
'qpid-cpp-server-cluster-0.14-22.el6_3.x86_64.rpm',
'qpid-cpp-server-store-0.14-22.el6_3.x86_64.rpm',
'qpid-tests-0.14-1.el6_2.noarch.rpm',
'qpid-tools-0.14-6.el6_3.noarch.rpm',
'qpid-cpp-server-ssl-0.14-22.el6_3.x86_64.rpm',
]
define get_hack_package (
$base_url="http://mirror.yandex.ru/centos/6.4/os/x86_64/Packages/",
$pkgdir=$pkgdir,
) {
exec {"Download_${name}":
command => "/bin/mkdir -p ${pkgdir}/fuel/Packages; /usr/bin/wget -c -P ${pkgdir}/fuel/Packages ${base_url}/${name}",
logoutput => true,
before => Exec['rebuild-fuel-repo'],
}
}
get_hack_package{$hack_packages:}
file { '/etc/nailgun/req-fuel-rhel.txt':
ensure => present,
source => 'puppet:///modules/rpmcache/req-fuel-rhel.txt',
owner => 'root',
group => 'root',
mode => 0644,
require => File['/etc/nailgun/']
} ->
exec {'fuel-rpms':
command => "/bin/mkdir -p ${pkgdir}/fuel/Packages; /bin/cat /etc/nailgun/req-fuel-rhel.txt | /usr/bin/xargs -n 1 -I xxx /bin/cp /var/www/nailgun/centos/fuelweb/x86_64/Packages/xxx /var/www/nailgun/rhel/fuel/Packages/",
logoutput => true,
before => Exec['rebuild-fuel-repo'],
}
}

View File

@ -0,0 +1,85 @@
#!/bin/bash -x
#Register
subscription-manager register "--username=<%= rh_username %>" "--password=<%= rh_password %>" --autosubscribe --force
#Attach to RHOS product
poolid="$(subscription-manager list --available | grep -A2 "Red Hat OpenStack" | tail -1 | cut -c15-)"
subscription-manager attach "--pool=$poolid"
#Enable channels
for channel in <%= rh_base_channels %> <%= rh_openstack_channel %>; do
yum-config-manager --enable "$channel"
done
#Tell RHSM to let CentOS accept packages from Red Hat
#Generate /etc/yum.repos.d/redhat.repo
yum --releasever=<%= releasever %> repolist || :
<% if use_satellite %>
#Save centos-release RPM so it can be reinstalled later
mkdir -p /root/centos-release
yumdownloader --destdir /root/centos-release --disablerepo='*rhel*' /root/centos-release/
if ! [ -f /root/centos-release/centos-release*.rpm ];then
echo "Unable to download centos-release RPM. Aborting."
exit 1
fi
#Download RHN packages needed for RHN Satellite registration
rhnpackages="m2crypto rhn-check rhn-client-tools rhnlib rhnsd rhn-setup yum-rhn-plugin redhat-release-sever"
mkdir -p /root/rhnpackages
yum-config-manager --enable rhel-6-server-rpms
yumdownloader --releasever=<%= releasever %> --disablerepo='*' --enablerepo='*rhel*' --resolve --destdir /root/rhnpackages $rhnpackages
rpm -ivh --force /root/rhnpackages/*.rpm
#Download RHN Satellite GPG key
mkdir -p /etc/sysconfig/rhn
wget "<%= sat_hostname %>/pub/RHN-ORG-TRUSTED-SSL-CERT" -O /etc/sysconfig/rhn/RHNS-CA-CERT
if [ "$(file -b /etc/sysconfig/rhn/RHNS-CA-CERT)" != "PGP public key block" ];then
echo "GPG Key download failed. Looking for URL <%= sat_hostname %>/pub/RHN-ORG-TRUSTED-SSL-CERT. Cannot proceed"
exit 1
fi
#Disable subscription-manager
subscription-manager unregister
rm -rf /etc/yum.repos.d/redhat.repo
#Run registration
rhnreg_ks "--serverUrl=http://<%= sat_hostname %>/XMLRPC" --profilename=fuelweb "--activation-key=<%= activation_key %>" --sslCACert=/etc/sysconfig/rhn/RHNS-CA-CERT --nopackages --nohardware --novirtinfo --norhnsd --force
if [ $? -ne 0 ];then
echo "Registration failed. Aborting."
exit 1
fi
<% end %>
#Download packages
mkdir -p <%= pkgdir %>/repodata <%= pkgdir %>/Packages
#yumdownloader --releasever=<%= releasever %> --disablerepo='*' --enablerepo='rhel*' --resolve --destdir "<%= pkgdir %>/Packages" $(cat /etc/nailgun/required-rpms.txt | xargs echo -en)
yum-config-manager --disable 'nailgun' &> /dev/null
yum-config-manager --disable 'centos' &> /dev/null
echo 6Server > /etc/yum/vars/releasever
yum --releasever=<%= releasever %> makecache
repotrack -a x86_64 -p "<%= pkgdir %>/Packages" $(cat /etc/nailgun/required-rpms.txt | xargs echo -en)
rm -f /etc/yum/vars/releasever
yum-config-manager --enable 'nailgun' &> /dev/null
yum-config-manager --enable 'centos' &> /dev/null
#Run again just for good measure
#yumdownloader --releasever=<%= releasever %> --disablerepo='*' --enablerepo='rhel*' --resolve --destdir "<%= pkgdir %>/Packages" $(cat /etc/nailgun/required-rpms.txt | xargs echo -en)
#Disable all RHEL repos so you don't accidentally update and break master node
yum-config-manager --disable '*rhel*' &> /dev/null
#Purge Django 1.3 RPM
rm -f <%= pkgdir %>/Packages/Django-1.3*
rpm -i /var/www/nailgun/rhel/Packages/rhel-boot-image-6.4-20130130.0.el6ost.noarch.rpm
mkdir -p /mnt/rhel_iso
mount -o loop /usr/share/rhel-boot-image/rhel-boot-image-6.4-20130130.0.el6ost.iso /mnt/rhel_iso
cp -R /mnt/rhel_iso/* <%= pkgdir %>
umount /mnt/rhel_iso
rpm -e rhel-boot-image-6.4-20130130.0.el6ost.noarch

View File

@ -111,3 +111,13 @@ xfsprogs-3.1.1-10.el6
xinetd-2.3.14-38.el6 xinetd-2.3.14-38.el6
yum-3.2.29-40.el6.centos yum-3.2.29-40.el6.centos
zlib-devel-1.2.3-29.el6 zlib-devel-1.2.3-29.el6
python-dmidecode
dbus-python
pygobject2
usermode
virt-what
python-ethtool
libuser
passwd
subscription-manager-1.8.9-1.el6
qpid-cpp-server-cluster-0.14-22.el6_3