【问题标题】:Saltstack install boto then use boto_* statesSaltstack 安装 boto 然后使用 boto_* 状态
【发布时间】:2016-03-02 21:25:59
【问题描述】:

我正在尝试在 Ubuntu 14.04 上使用 saltstack 构建一些 EC2 资源。问题是14.04自带的python-boto包太旧了,需要用pip来安装更新的东西。我有以下 SLS 来表达这种状态:

python-boto:
  pkg.purged

python-pip:
  pkg.installed

boto:
  pip.installed:
    - name: boto >= 2.6
    - require:
      - pkg: python-pip

default_lc:
  boto_lc.present:
    - require:
      - pip: boto
    - image_id: ami-3d2cce5d 
    - key_name: uberhaus
    - security_groups:
      - default
    - instance_type: m3.medium
    - volume_type: gp2

我第一次运行 highstate 时,boto_lc 资源失败。在随后的 highstate 运行中,它成功了。

我该如何处理?我是否需要使用 Reactor 或 Orchestrate 以某种方式确保 boto 资源仅在之前运行安装 boto 之后运行?

【问题讨论】:

  • 这令人困惑。你能写成点的形式吗?这就是我的理解。运行 highstate 从 AMI 启动 Ec2 实例,即。 boto_lc 会将 salt-minion 放入 EC2 实例中。 ii. salt master 将接受密钥 iii。此处未说明的一些神奇状态告诉 minion 将 boto 更新到最新版本。

标签: salt-stack


【解决方案1】:

我认为您需要在 pip.installed 状态下设置一个 'reload_modules: True',这将使 boto 模块可用于 salt 以在后续状态下使用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-04
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多