Skip to content

Commit

Permalink
role poetry: fix for ubuntu 20
Browse files Browse the repository at this point in the history
  • Loading branch information
dometto committed Nov 11, 2024
1 parent 6560204 commit cc56237
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 7 additions & 3 deletions playbooks/roles/poetry/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
---
- name: Install newer python to ensure compatibility with poetry
include_role:
name: system_python

- name: Install poetry system-wide
when: poetry_system_wide
include_tasks: system_wide.yml

- name: Install poetry per user through runonce.d
when: poetry_per_user
copy:
src: 10-poetry.sh
dest: /etc/runonce.d
template:
src: 10-poetry.sh.j2
dest: /etc/runonce.d/10-poetry.sh
mode: "0755"
8 changes: 2 additions & 6 deletions playbooks/roles/poetry/tasks/system_wide.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
get_url:
url: https://install.python-poetry.org
dest: /tmp/install-poetry.py
mode: "0777"
mode: "0755"
timeout: 20

- name: Install venv dependency
apt:
name: python3-venv

- name: Install poetry system-wide
command: python3 /tmp/install-poetry.py
command: "{{ system_python_path }} /tmp/install-poetry.py"
environment:
POETRY_HOME: /opt/poetry

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
echo "Installing Python poetry"
export POETRY_ROOT="~/.local/bin"
curl -sSL https://install.python-poetry.org | python3 -
curl -sSL https://install.python-poetry.org | {{ system_python_path }} -
export PATH="$POETRY_ROOT:$PATH"
#
cat >> ~/.bashrc <<'INPUTEND'
Expand Down

0 comments on commit cc56237

Please sign in to comment.