splitting roles
This commit is contained in:
40
roles/python/tasks/main.yml
Normal file
40
roles/python/tasks/main.yml
Normal file
@@ -0,0 +1,40 @@
|
||||
- name: Install and configure Python + tools
|
||||
tags: python
|
||||
become: true
|
||||
become_user: "{{ default_user }}"
|
||||
block:
|
||||
- name: Install Pyenv
|
||||
shell: curl https://pyenv.run | zsh
|
||||
args:
|
||||
creates: "{{ default_user_home }}/.pyenv/bin/pyenv"
|
||||
environment:
|
||||
PYENV_ROOT: "{{ default_user_home }}/.pyenv"
|
||||
|
||||
- name: Install Pyenv version of Python
|
||||
shell: "{{ default_user_home }}/.pyenv/bin/pyenv install {{ pyenv_python_version }}"
|
||||
args:
|
||||
creates: "{{ default_user_home }}/.pyenv/versions/{{ pyenv_python_version }}/bin/python"
|
||||
|
||||
- name: Install pipx
|
||||
command: python3 -m pip install pipx --user
|
||||
args:
|
||||
creates: "{{ default_user_home }}/.local/bin/pipx"
|
||||
|
||||
- name: Install pipx packages
|
||||
shell: "{{ default_user_home }}/.local/bin/pipx install {{ item }}"
|
||||
loop: "{{ pipx_packages }}"
|
||||
|
||||
- name: Install Poetry
|
||||
shell: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
|
||||
args:
|
||||
creates: "{{ default_user_home }}/.poetry/bin/poetry"
|
||||
|
||||
- name: Install Poetry plugin for oh-my-zsh
|
||||
shell: |
|
||||
mkdir {{ default_user_home }}/.oh-my-zsh/custom/plugins/poetry
|
||||
{{ default_user_home }}/.poetry/bin/poetry completions zsh > {{ default_user_home }}/.oh-my-zsh/custom/plugins/poetry/_poetry
|
||||
args:
|
||||
creates: "{{ default_user_home }}/.oh-my-zsh/custom/plugins/poetry"
|
||||
|
||||
- name: Configure Poetry
|
||||
command: "{{ default_user_home }}/.poetry/bin/poetry config virtualenvs.in-project true"
|
||||
Reference in New Issue
Block a user