cobbler安装自定义的rpm包

# create new repo
mkdir /packages-misc
cp *.rpm /packages-misc
 
# make this repo known to cobbler
cobbler repo add \
      --arch x86_64 \
      --comment "local copy of private RPMs." \
      --keep-updated Yes \
      --name misc-rpms \
      --mirror-locally Yes \
      --mirror /packages-misc
#同步repo.以后添加新的rpm包后需要再次运行此命令.
cobbler reposync
#将此repo和profile关联.
cobbler profile edit --name='CentOS-7.3-x86_64' --repos='misc-rpms'

自定义的rpm通过 %post yum install 实现,此刻cobbler无互联网连接,导致 yum install 失败;
故必须,仅启用misc-rpms repo, yum安装的日志可以在“program logs”窗口内看到.

# THIS SECTION MUST BE USED WITH "cobbler repo add"...
%post
# yum installing private packages
$yum_config_stanza
# MUST DISABLE OTHER REPO COZ OFFLINE!
yum --disablerepo=\* --enablerepo=misc-rpms install -y lsof iftop nethogs htop jdk1.8.0_112
mv /etc/yum.repos.d/cobbler-config.repo{,.bak}
%end

cobbler check
cobbler validateks
cobbler profile getks --name='CentOS-7.3-x86_64'
cobbler sync

now redeploy systems that are using the profile 'CentOS-7.3-x86_64'.


  • linux/os_provision/cobbler安装自定义的rpm包.txt
  • 最后更改: 2019/04/16 18:31
  • (外部编辑)