cobbler get-loaders 通过代理下载

原创
2014/11/07 16:36
阅读数 735
  • cobbler 版本是2.6.3,可以通过系统环境变量设置proxy,支持 HTTP_PROXY、HTTPS_PROXY、FTP_PROXY 三个变量。
  • cobbler 版本是2.6.6时,需要从/etc/cobbler/settings 中增加proxy_url_ext,
     proxy_url_ext: http://10.10.10.100:3128
  • 注意:两种情况使生效,必须重启cobbler,/etc/init.d/cobblerd restart
  • cobbler get-loaders
    [root@cobbler ~]# cobbler get-loaders --force
    task started: 2014-11-07_162343_get_loaders
    task started (id=Download Bootloader Content, time=Fri Nov  7 16:23:43 2014)
    downloading http://www.cobblerd.org/loaders/README to /var/lib/cobbler/loaders/README
    downloading http://www.cobblerd.org/loaders/COPYING.elilo to /var/lib/cobbler/loaders/COPYING.elilo
    downloading http://www.cobblerd.org/loaders/COPYING.yaboot to /var/lib/cobbler/loaders/COPYING.yaboot
    downloading http://www.cobblerd.org/loaders/COPYING.syslinux to /var/lib/cobbler/loaders/COPYING.syslinux
    downloading http://www.cobblerd.org/loaders/elilo-3.8-ia64.efi to /var/lib/cobbler/loaders/elilo-ia64.efi
    downloading http://www.cobblerd.org/loaders/yaboot-1.3.14-12 to /var/lib/cobbler/loaders/yaboot
    downloading http://www.cobblerd.org/loaders/pxelinux.0-3.86 to /var/lib/cobbler/loaders/pxelinux.0
    downloading http://www.cobblerd.org/loaders/menu.c32-3.86 to /var/lib/cobbler/loaders/menu.c32
    downloading http://www.cobblerd.org/loaders/grub-0.97-x86.efi to /var/lib/cobbler/loaders/grub-x86.efi
    downloading http://www.cobblerd.org/loaders/grub-0.97-x86_64.efi to /var/lib/cobbler/loaders/grub-x86_64.efi
    *** TASK COMPLETE ***




  • 参考文档链接:https://github.com/jmaas/cobbler/commit/213625c6b1461a3006e63a70d34044db79a6f7ea
    )
     
             proxies = {}
    -        if os.environ.has_key("HTTP_PROXY"):
    -            proxies['http'] = os.environ["HTTP_PROXY"]
    -
    -        if os.environ.has_key("HTTPS_PROXY"):
    -            proxies['https'] = os.environ["HTTPS_PROXY"]
    -
    -        if os.environ.has_key("FTP_PROXY"):
    -            proxies['ftp'] = os.environ["FTP_PROXY"]
    -
    -        if len(proxies) == 0:
    -            proxies = None
    +        proxies['http'] = self.settings.proxy_url_ext
     
             for src,dst in files:
                 if os.path.exists(dst) and not force:



展开阅读全文
打赏
0
1 收藏
分享
加载中
更多评论
打赏
0 评论
1 收藏
0
分享
返回顶部
顶部