Skip to content
This repository was archived by the owner on Mar 30, 2025. It is now read-only.

Commit 1c0243e

Browse files
author
staticdev
committed
Fix installation checks
1 parent 1afe4c5 commit 1c0243e

File tree

3 files changed

+38
-22
lines changed

3 files changed

+38
-22
lines changed

meta/main.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,4 @@ galaxy_info:
3535

3636
dependencies:
3737
- name: staticdev.ansible_galaxy_pyenv
38-
version: 1.1.1
39-
# - name: gantsign.visual-studio-code
40-
# version: 6.6.0
41-
# when: "{{ install_vscode }}"
38+
version: 1.2.0

requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
roles:
33
- name: staticdev.ansible_galaxy_pyenv
4-
version: 1.1.1
4+
version: 1.2.0
55
- name: gantsign.visual-studio-code
66
version: 6.6.0
77
when: "{{ install_vscode }}"

tasks/main.yml

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,48 @@
1414
- "pypy3.6-7.3.1"
1515
pyenv_virtualenvs: []
1616

17-
- name: Ensure pre-commit and pipx are installed
17+
- name: Ensure python3-venv is installed
1818
package:
1919
state: present
20-
name:
21-
- pre-commit
22-
- pipx
20+
name: python3-venv
2321
become: true
2422

25-
- name: Check if cookiecutter is installed
26-
command: cookiecutter --version
27-
register: cookiecutter_version_cmd
23+
- name: Check if pipx is installed
24+
command: pipx --version
25+
register: pipx_version_cmd
2826
changed_when: false
2927
ignore_errors: true
3028

29+
- name: Install pipx
30+
package:
31+
state: present
32+
name: pipx
33+
become: true
34+
when: pipx_version_cmd is failed
35+
36+
- name: Check if pre-commit is installed
37+
stat:
38+
path: "{{ ansible_env.HOME }}/.local/pipx/venvs/pre-commit"
39+
register: pre_commit_folder_check
40+
41+
- name: Install pre-commit
42+
command: pipx install pre-commit
43+
register: output
44+
when: pre_commit_folder_check is failed
45+
46+
- name: Check if cookiecutter is installed
47+
stat:
48+
path: "{{ ansible_env.HOME }}/.local/pipx/venvs/cookiecutter"
49+
register: cookiecutter_folder_check
50+
3151
- name: Install cookiecutter
3252
command: pipx install cookiecutter
3353
register: output
34-
when: cookiecutter_version_cmd is failed
54+
when: cookiecutter_folder_check is failed
3555

3656
- name: Check if poetry is installed
37-
command: poetry --version
38-
register: poetry_version_cmd
57+
command: poetry
58+
register: poetry_cmd
3959
changed_when: false
4060
ignore_errors: true
4161

@@ -44,22 +64,21 @@
4464
url: https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
4565
dest: "{{ ansible_env.HOME }}/get-poetry.py"
4666
mode: "0400"
47-
when: poetry_version_cmd is failed
67+
when: poetry_cmd is failed
4868
notify: delete poetry installer
4969

5070
- name: Install poetry
5171
command: "python3 {{ ansible_env.HOME }}/get-poetry.py"
52-
when: poetry_version_cmd is failed
72+
when: poetry_cmd is failed
5373

5474
- name: Check if nox is installed
55-
command: nox --version
56-
register: nox_version_cmd
57-
changed_when: false
58-
ignore_errors: true
75+
stat:
76+
path: "{{ ansible_env.HOME }}/.local/pipx/venvs/nox"
77+
register: nox_folder_check
5978

6079
- name: Install nox
6180
command: pipx install nox
62-
when: nox_version_cmd is failed
81+
when: nox_folder_check is failed
6382

6483
- name: Install pycharm
6584
include_tasks: pycharm.yml

0 commit comments

Comments
 (0)