Browse Source

anaconda env

master
parent
commit
b66fb7e59d
3 changed files with 22 additions and 4 deletions
  1. +2
    -0
      defaults/main.yml
  2. +19
    -3
      tasks/main.yml
  3. +1
    -1
      vars/main.yml

+ 2
- 0
defaults/main.yml View File

@@ -2,3 +2,5 @@
conda_directory: /opt/conda
conda_installer_url: https://repo.continuum.io/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh
conda_installer_checksum: sha256:ea4594241e13a2671c5b158b3b813f0794fe58d514795fbf72a1aad24db918cf

conda_anaconda_env: true

+ 19
- 3
tasks/main.yml View File

@@ -18,9 +18,9 @@
command: conda update --all --json --quiet
environment:
PATH: /opt/conda/bin:{{ ansible_env.PATH }}
register: _conda_update_command
failed_when: _conda_update_command.rc != 0 and not _conda_update.sucess
changed_when: _conda_update.actions is defined
register: _conda_command
failed_when: _conda_command.rc != 0 or not _conda.success
changed_when: _conda.actions is defined

- name: link conda fish
file:
@@ -28,3 +28,19 @@
dest: /etc/fish/conf.d/conda.fish
state: link
follow: false

- name: anaconda environment
command: conda create -n anaconda anaconda --json --quiet
environment:
PATH: /opt/conda/bin:{{ ansible_env.PATH }}
args:
creates: "{{ conda_directory }}/envs/anaconda"
when: conda_anaconda_env

- name: update anaconda environment
command: conda update -n anaconda --all --json --quiet
environment:
PATH: /opt/conda/bin:{{ ansible_env.PATH }}
register: _conda_command
changed_when: _conda.actions is defined
when: conda_anaconda_env

+ 1
- 1
vars/main.yml View File

@@ -1,4 +1,4 @@
---

_conda_installer_filename: "{{ conda_installer_url | urlsplit('path') | basename }}"
_conda_update: "{{ _conda_update_command.stdout | from_json }}"
_conda: "{{ _conda_command.stdout | from_json }}"

Loading…
Cancel
Save