Question: Since there is no package for [Anaconda](https://store.continuum.io/cshop/anaconda/ "Anaconda"), how do I install and manage it via [Salt](http://docs.saltstack.com/en/latest/index.html "salt")?

For the installation as described in the Quick Start Guide, I have to download an installer (e.g. Anaconda-2.1.0-Linux-x86\_64.sh) and then in the shell execute

```
bash <downloaded file>

```

Do I have to write a fancy python installer for salt or is there an easier way to let salt know how to install Anaconda?

Answer: 
I think your best bet would be to use the `cmd.script` state which is documented here: <http://docs.saltstack.com/en/latest/ref/states/all/salt.states.cmd.html#salt.states.cmd.script>

A sample Salt state that would run this would look something like this.
Assuming that you've copied the anaconda installer to this location on your Salt Master:
`/srv/salt/Anaconda-2.1.0-Linux-x86_64.sh`

Contents of `/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

```
I guess this has changed since the question was originally asked, but now you can simply pass the `-b` argument to the script to run in batch mode. My salt state also installs it as root under `/opt` and looks like this:

```
/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

```

Both say that they create the `/opt/miniconda2` folder so that we don't hit the internet more than once for this.