【问题标题】:How should one configure or install salt-cloud to use the Saltstack py3 repository to install the minion instead of the distribution (apt) repository?应该如何配置或安装 salt-cloud 以使用 Saltstack py3 存储库来安装 minion 而不是分发(a​​pt)存储库?
【发布时间】:2020-08-06 02:47:15
【问题描述】:

我希望 salt-cloud 使用与 saltmaster 服务器上相同的 sources.list.d/saltstack.list 文件安装 salt-minion,但它使用的是 Ubuntu APT 存储库。

我在/etc/apt/sources.list.d/saltstack.list 的新奴才身上得到了什么:

deb https://repo.saltstack.com/apt/ubuntu/18.04/amd64/latest bionic main

我想要什么:

deb https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main

我通过在我的 saltmaster 服务器上执行以下操作从 Saltstack 存储库安装了 salt-master 和 salt-cloud:

wget -O - https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest/SALTSTACK-GPG-KEY.pub | sudo apt-key add -
echo "deb https://repo.saltstack.com/py3/ubuntu/18.04/amd64/latest bionic main" > etc/apt/sources.list.d/saltstack.list
apt update
apt install python3-pip salt-master salt-minion salt-cloud

我使用 salt-cloud 启动服务器,/etc/apt/sources.list.d/saltstack.list 使用 apt 存储库,而不是 py3 存储库。

我可以在 saltmaster 配置文件中设置一个选项来定义 salt-cloud 应该使用哪个存储库吗? salt-cloud 配置文件中是否有类似的选项可以传递给 salt bootstrap 脚本?

我在 salt-cloud 运行的引导脚本中看到(可在 bootstrap.saltstack.com 找到)一个名为 _CUSTOM_REPO_URL 的命令行选项,但我不知道在使用以下命令创建服务器时如何将选项传递给该脚本salt-cloud -p

如果更合适,很高兴在别处询问(请说明在哪里)。

如果需要,我可以提供我的盐云配置文件的适用部分。

【问题讨论】:

  • askubuntu.com 更合适。
  • 谢谢。我也会在那里问,但我的问题/情况感觉比 Ubuntu 更与盐栈相关。 askubuntu.com 上甚至没有 salt-stack 的标签,所以对 Salt 感兴趣的人似乎更有可能在这里看到我的问题。
  • 很公平。我真的不知道 salt stack 是什么,但对我来说,这似乎是一堆 ubuntu 命令,这对于 SO 来说通常是题外话,这是关于编程问题和答案的。见on topic。 ubuntu 标签上写着“这个标签只能用于在 Ubuntu 18.04 中编写或运行程序”。最好不要交叉发帖,而且你有一个赞成票,所以可能暂时保留在这里。

标签: ubuntu-18.04 salt-stack salt-cloud


【解决方案1】:

我找到https://docs.saltstack.com/en/latest/topics/cloud/deploy.html#deploy-script-arguments

这导致我将以下内容添加到与salt-cloud -p 命令一起使用的云服务器配置文件中:

script: bootstrap-salt
script_args: -x python3

然后安装了正确的存储库。

【讨论】:

    猜你喜欢
    • 2018-04-06
    • 1970-01-01
    • 2017-08-03
    • 2013-01-07
    • 2019-03-21
    • 1970-01-01
    • 1970-01-01
    • 2018-11-29
    • 2021-05-09
    相关资源
    最近更新 更多