使用 saltatack 在代理后面安装包
Install packages behind proxy using saltatack
完成 Saltstack 教程并 运行 遇到如何在代理后面的 linux 主机上安装软件包的问题。
例如,我有一个文件 nettools.sls:
install_network_packages:
pkg.installed:
- pkgs:
- rsync
- lftp
- curl
我怎样才能像 http_proxy
这样传递环境变量来安装软件包?
谢谢。
您将需要一个状态或将其添加到此状态以配置服务器以在 运行 这些包之前使用 HTTP_PROXY。有关此配置的信息,请参阅以下文档:
https://www.shellhacks.com/linux-proxy-server-settings-set-proxy-command-line
另见 Salt 的这篇文章:
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.proxy.html
这对我来说是这样的:
proxy:
environ.setenv:
- name: Proxy Settings
- value:
http_proxy: http://10.20.80.50:3128
https_proxy: https://10.20.80.50:3128
install_network_packages:
pkg.installed:
- pkgs:
- rsync
- lftp
- curl
完成 Saltstack 教程并 运行 遇到如何在代理后面的 linux 主机上安装软件包的问题。 例如,我有一个文件 nettools.sls:
install_network_packages:
pkg.installed:
- pkgs:
- rsync
- lftp
- curl
我怎样才能像 http_proxy
这样传递环境变量来安装软件包?
谢谢。
您将需要一个状态或将其添加到此状态以配置服务器以在 运行 这些包之前使用 HTTP_PROXY。有关此配置的信息,请参阅以下文档:
https://www.shellhacks.com/linux-proxy-server-settings-set-proxy-command-line
另见 Salt 的这篇文章: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.proxy.html
这对我来说是这样的:
proxy:
environ.setenv:
- name: Proxy Settings
- value:
http_proxy: http://10.20.80.50:3128
https_proxy: https://10.20.80.50:3128
install_network_packages:
pkg.installed:
- pkgs:
- rsync
- lftp
- curl