feat(zsh): add poetry install
This commit is contained in:
parent
c5776e52f6
commit
fcf9b75580
31
roles/zsh/tasks/install-poetry.yml
Normal file
31
roles/zsh/tasks/install-poetry.yml
Normal file
@ -0,0 +1,31 @@
|
||||
---
|
||||
- name: Check if poetry is installed
|
||||
ansible.builtin.stat:
|
||||
path: "{{ ansible_env.HOME }}/.local/share/pypoetry"
|
||||
register: poetry_installed
|
||||
changed_when: false
|
||||
|
||||
- name: Create poetry working directory
|
||||
ansible.builtin.tempfile:
|
||||
state: directory
|
||||
register: poetry_work_dir
|
||||
when: not poetry_installed.stat.exists
|
||||
|
||||
- name: Set poetry installer destination
|
||||
ansible.builtin.set_fact:
|
||||
poetry_install_dest: "{{ poetry_work_dir }}/poetry-install.py"
|
||||
when: not poetry_installed.stat.exists
|
||||
|
||||
- name: Download poetry installer
|
||||
ansible.builtin.get_url:
|
||||
url: https://install.python-poetry.org/
|
||||
dest: "{{ poetry_install_dest }}"
|
||||
mode: 0644
|
||||
when: not poetry_installed.stat.exists
|
||||
|
||||
- name: Install Poetry
|
||||
ansible.builtin.command:
|
||||
argv:
|
||||
- python3 "{{ poetry_install_dest }}"
|
||||
register: poetry_installer
|
||||
changed_when: not 'already installed' in poetry_installer.stdout
|
@ -16,6 +16,9 @@
|
||||
- name: Install Pyenv
|
||||
ansible.builtin.import_tasks: install-pyenv.yml
|
||||
|
||||
- name: Install Poetry
|
||||
ansible.builtin.import_tasks: install-poetry.yml
|
||||
|
||||
- name: Install Oh My ZSH
|
||||
ansible.builtin.import_tasks: install-omz.yml
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user