andrewrothstein / ansible-anaconda

Ansible role for installing Anaconda
MIT License
47 stars 42 forks source link

Allow multiple anaconda versions to be installed #21

Open bilsch opened 6 years ago

bilsch commented 6 years ago

It would be nice to have the link be optional. In my case I need both anaconda2 and 3 to be installed / maintained.

- hosts: all
  become: yes
  become_method: sudo
  gather_facts: true
  vars:
    python_versions:
      - 2
      - 3
(...)
  tasks:
(...)
    - name: "Install anaconda for python versions"
      with_items: "{{ python_versions }}"
      loop_control:
        loop_var: version
      include_role:
        name: andrewrothstein.anaconda
      vars:
        anaconda_parent_dir: /hadoop/anaconda
        anaconda_python_ver: "{{ version }}"

I can think of a few ways to tackle this - thoughts on what you would prefer? Simply making the link optional may work however I can see where you would want to have anaconda2 symlink to latest for 2, ditto for anaconda3.

Happy to submit a pr

andrewrothstein commented 6 years ago

Have you considered using docker to isolate the installs? Build one image that houses the v2 install and another than houses the v3 install?

bilsch commented 6 years ago

Thats an interesting idea though I'm not sure it will work for my use-case. This is on a hadoop cluster for pyspark. We have kerberos, ssl and other security goodies and docker does not play well.

andrewrothstein commented 6 years ago

I like the idea of having /usr/local/anaconda{2,3}. I really like the idea of having a single path to “the currently installed anaconda distribution”. I’m conflicted.

bilsch commented 6 years ago

Let me work up a pull request and see if we can have it both ways. Default to a single version with your current logic.

Give me a few days. I've got a few other things going on at the moment

bbaassssiiee commented 4 years ago

Maybe this helps: https://github.com/dockpack/base_miniconda