diff --git a/roles/ensure-twine/tasks/main.yaml b/roles/ensure-twine/tasks/main.yaml new file mode 100644 index 000000000..d5fed495b --- /dev/null +++ b/roles/ensure-twine/tasks/main.yaml @@ -0,0 +1,18 @@ +- name: Check for twine install + command: which twine + ignore_errors: yes + register: register_twine + +- name: Set pypi_twine_executable + set_fact: + pypi_twine_executable: "{{ register_twine.stdout }}" + when: register_twine|succeeded + +- name: Ensure twine is installed + command: pip install twine --user + when: pypi_twine_executable is not defined + +- name: Set pypi twine executable + set_fact: + pypi_twine_executable: ~/.local/bin/twine + when: pypi_twine_executable is not defined