diff --git a/defaults/main.yml b/defaults/main.yml index 53cfd77..654e285 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -149,5 +149,10 @@ aiida_kernel_name: python3 # default port on which to start jupyter lab with aiida-jupyterlab exec aiida_jupyter_port: 8890 +# symlink executubles from the aiida environment into the jupyter one +aiida_jupyter_symlink: +- verdi +- reentry + root_user: root # add vm_headless=false to add a destop shortcut to start jupyter lab diff --git a/tasks/jupyter.yml b/tasks/jupyter.yml index 1edd6b6..f6a83e1 100644 --- a/tasks/jupyter.yml +++ b/tasks/jupyter.yml @@ -9,23 +9,18 @@ python_venv_packages: "{{ aiida_jupyter_packages }}" register: pip_install -- name: Symlink verdi to {{ aiida_jupyter_venv }}/bin +- name: "Symlink {{ item }} to {{ aiida_jupyter_venv }}/bin" file: - src: "{{ aiida_venv }}/bin/verdi" - dest: "{{ aiida_jupyter_venv }}/bin/verdi" + src: "{{ aiida_venv }}/bin/{{ item }}" + dest: "{{ aiida_jupyter_venv }}/bin/{{ item }}" state: link + loop: "{{ aiida_jupyter_symlink }}" - name: "Activate verdi TAB completion in jupyter virtualenv" lineinfile: path: "{{ aiida_jupyter_venv }}/bin/activate" line: 'eval "$(verdi completioncommand)"' -- name: Symlink reentry to {{ aiida_jupyter_venv }}/bin - file: - src: "{{ aiida_venv }}/bin/reentry" - dest: "{{ aiida_jupyter_venv }}/bin/reentry" - state: link - - name: Add {{ aiida_venv }} to jupyter kernels shell: "{{ aiida_venv }}/bin/python -m ipykernel install --name {{ aiida_kernel_name }} --user" args: