feat(zsh): add poetry install

This commit is contained in:
Price Hiller 2022-08-01 16:07:57 -05:00
parent c5776e52f6
commit fcf9b75580
2 changed files with 34 additions and 0 deletions

View 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

View File

@ -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