cuda设置的saltstack状态 - 如何在salt pkg.installed中强制apt-get --force-yes

时间:2017-03-22 08:28:31

标签: salt-stack

我有一个状态,我尝试在gpu服务器上安装cuda。国家正确地调用apt-get install cuda等,但是无法回答第二个是进一步依赖的呼叫

这是输出

          ID: package_cuda
    Function: pkg.installed
        Name: cuda
      Result: False
     Comment: Problem encountered installing package(s). Additional info follows:
              
              errors:
                  - E: There are problems and -y was used without --force-yes
     Started: 16:55:24.408065
    Duration: 17031.708 ms

这是库达州

include:
  - repos.pkgs.{{ salt['grains.get']('os') ~ '.' ~ salt['grains.get']('oscodename') }}.cuda

package_cuda:
  pkg:
    - installed
    - name: cuda
    - require:
      - pkgrepo: pkgrepo_cuda

包回购状态

pkgrepo_cuda:
  pkgrepo:
    - managed
    - humanname: nvidia cuda repo
    - name: deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64 / 
    - file: /etc/apt/sources.list.d/cuda.list
    - key_url: http://developer.download.nvidia.com/compute/cuda/repos/GPGKE

所以像apt-get install --force-yes选项在docs中会很棒我很幸运能找到一个选项

1 个答案:

答案 0 :(得分:2)

必须使用“force_yes”键。它不在文档中,但可以从salt util文档中获取它。

package_cuda:
  pkg:
    - installed 
    - name: cuda-8-0
    # the installation may ask twice for driver
    - force_yes: True
    - require:
      - pkgrepo: pkgrepo_cuda