繁体   English   中英

如何在Ubuntu上安装带有salt-stack的Anaconda

[英]How do I install Anaconda with salt-stack on Ubuntu

由于没有Anaconda的软件包,我如何通过Salt安装和管理它?

对于“快速入门指南”中所述的安装,我必须下载安装程序(例如Anaconda-2.1.0-Linux-x86_64.sh),然后在shell中执行

bash <downloaded file>

我是否必须为盐写一个花哨的python安装程序,或者有更简单的方法让盐知道如何安装Anaconda?

我认为你最好的选择是使用这里记录的cmd.script状态: httpcmd.script .cmd.script

运行此操作的示例Salt状态看起来像这样。 假设您已将anaconda安装程序复制到Salt Master上的此位置: /srv/salt/Anaconda-2.1.0-Linux-x86_64.sh

/srv/salt/install_anaconda.sls内容:

run_anaconda_installer:
  cmd.script:
    - source: salt://Anaconda-2.1.0-Linux-x86_64.sh
    - creates: /usr/bin/anaconda     # This should be a path to a file or directory created by Anaconda-2.1.0-Linux-x86_64.sh. This will cause Salt not to rerun this install script if that file or directory already exist.
    - user: root
    - group: root

我想这个问题最初被提出后已经改变了,但现在你可以简单地将-b参数传递给脚本以批处理模式运行。 我的salt状态也在/opt下以root身份安装,如下所示:

/opt/Miniconda2-latest-Linux-x86_64.sh:
  cmd.run:
    - name: >
        wget --continue
        https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh
        -O /opt/Miniconda2-latest-Linux-x86_64.sh
    - creates: /opt/miniconda2

/opt/miniconda:
  cmd.script:
    - name: /opt/Miniconda2-latest-Linux-x86_64.sh
    - args: -b -p /opt/miniconda2
    - creates: /opt/miniconda2

两者都说他们创建/opt/miniconda2文件夹,这样我们就不会多次上网了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM