如何让 MAAS 和 Juju 识别部署中的代理设置?

Ros*_*oss 5 juju maas

所以,我有 Ubuntu 12.04 LTS,从初始启动就安装了 MaaS,然后添加了 JUJU。我支持代理,因此,将代理添加到 /etc/apt/apt.conf 和 /etc/wgetrc。这样做我可以使用 maas-import-pxe-files。

设置我的环境,一切似乎都很好,但是当我启动节点时,它们无法解析 archive.ubuntu.com。是否需要在某处设置我的代理信息,以便将其传递到连接到 MaaS 服务器的节点上?我在任何鱿鱼日志中都没有看到任何操作,并且不确定我应该将我的代理放在哪里,以便将其传递给外部世界。

非常感谢任何帮助!

小智 6

恐怕这目前不是 MAAS 支持的配置(但我很乐意在这方面出错)。

我还必须在代理后面使用 MAAS,这是我的处理方式:

导入 pxe 图像:

sudo http_proxy=http://my.proxy:3128/ maas-import-pxe-files
Run Code Online (Sandbox Code Playgroud)

编辑 /usr/share/maas/preseeds/enlist_userdata

set apt_proxy
#we cannot use maas as a proxy as maas itself is behind a proxy
#if we try, when we bootstrap zookeeper, it is not able to download archive.ubuntu.com/ubuntu/dists/precsie/Release
apt_proxy: http://my.proxy:3128/
Run Code Online (Sandbox Code Playgroud)

更改 /usr/share/maas/preseeds/preseed_master 以便 {{self.proxy}} 是

d-i     mirror/country string manual
d-i     mirror/http/hostname string archive.ubuntu.com
d-i     mirror/http/directory string /ubuntu
d-i     mirror/http/proxy string http://my.proxy:3128/
Run Code Online (Sandbox Code Playgroud)

确保实际删除{{self.proxy}} 宏,否则如果您只是将其注释掉,它无论如何都会被扩展。

改变/usr/share/maas/preseeds/generic这样

d-i     preseed/late_command string true && \
    in-target sh -c 'f=$1; shift; echo $0 > $f && chmod 0440 $f $*' 'ubuntu ALL=(ALL) NOPASSWD: ALL' /etc/sudoers.d/maas && \
    in-target wget --no-proxy "{{node_disable_pxe_url|escape.shell}}" --post-data "{{node_disable_pxe_data|escape.shell}}" -O /dev/null && \
    true
is 
d-i     preseed/late_command string true && \
    in-target sh -c 'f=$1; shift; echo $0 > $f && chmod 0440 $f $*' 'ubuntu ALL=(ALL) NOPASSWD: ALL' /etc/sudoers.d/maas && \
    in-target wget --no-proxy "{{node_disable_pxe_url|escape.shell}}" --post-data "{{node_disable_pxe_data|escape.shell}}" -O /dev/null && \
    in-target apt-key adv --keyserver-options http-proxy=http://my.proxy:3128/ --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys "0x376a290ec8068b11" && \
    in-target sh -c 'http_proxy=http://my.proxy:3128/ https_proxy=http://my.proxy:3128/ apt-add-repository -m ppa:juju/pkgs --yes' && \
    in-target sh -c 'http_proxy=http://my.proxy:3128/ https_proxy=http://my.proxy:3128/ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5EDB1B62EC4926EA' && \
    true
Run Code Online (Sandbox Code Playgroud)

可能有更好的方法来做到这一点,它可能不会在所有地方都有效,但它对我有用。

请注意,当他们尝试从 Internet 获取内容或添加一些 ppa 时,还必须更改某些魅力以使用代理。