Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions local/tasks/conda-env-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@
become_user: "{{ vm_user }}"
when: bin_patterns is defined and bin_patterns | length > 0
block:
- name: "Create ~/.local/bin"
ansible.builtin.file:
path: "/home/{{ vm_user }}/.local/bin"
state: directory
mode: "0755"
- name: "Add ~/.local/bin to PATH in .bashrc"
ansible.builtin.blockinfile:
path: "/home/{{ vm_user }}/.bashrc"
marker: "## {mark} ANSIBLE MANAGED BLOCK (~/.local/bin)"
block: |
export PATH="$HOME/.local/bin:$PATH"
- name: "Find binaries matching patterns"
ansible.builtin.find:
paths: "/home/{{ vm_user }}/.conda/envs/{{ conda_env }}/bin"
Expand Down
23 changes: 23 additions & 0 deletions local/tasks/setup-local-bin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
# Create ~/.local/bin and prepend it to PATH in .bashrc.
# The export is inserted at BOF so conda init (appended later by the miniforge
# installer) ends up AFTER it in .bashrc, letting conda env activation prepend
# its own bin/ and win on PATH resolution.

- name: "Create ~/.local/bin"
become: true
become_user: "{{ vm_user }}"
ansible.builtin.file:
path: "/home/{{ vm_user }}/.local/bin"
state: directory
mode: "0755"

- name: "Add ~/.local/bin to PATH in .bashrc"
become: true
become_user: "{{ vm_user }}"
ansible.builtin.blockinfile:
path: "/home/{{ vm_user }}/.bashrc"
marker: "## {mark} ANSIBLE MANAGED BLOCK (~/.local/bin)"
insertbefore: BOF
block: |
export PATH="$HOME/.local/bin:$PATH"
4 changes: 4 additions & 0 deletions playbook-build-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@
ansible.builtin.import_role:
name: marvel-nccr.slurm

- name: "Setup ~/.local/bin on PATH"
tags: [local-bin]
ansible.builtin.import_tasks: local/tasks/setup-local-bin.yml

- name: Install conda+mamba
tags: [conda]
ansible.builtin.import_role:
Expand Down
Loading