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

Commit c6b6efd

Browse files
author
staticdev
committed
Merge branch 'better-installation-checks'
2 parents 1696ea4 + db6612b commit c6b6efd

File tree

4 files changed

+42
-26
lines changed

4 files changed

+42
-26
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ jobs:
4040
matrix:
4141
img:
4242
- staticdev/docker-ubuntu2010-ansible:latest
43-
- geerlingguy/docker-ubuntu2004-ansible:latest
44-
- geerlingguy/docker-ubuntu1804-ansible:latest
45-
- geerlingguy/docker-debian10-ansible:latest
46-
- geerlingguy/docker-debian9-ansible:latest
43+
# - geerlingguy/docker-ubuntu2004-ansible:latest
44+
# - geerlingguy/docker-ubuntu1804-ansible:latest
45+
# - geerlingguy/docker-debian10-ansible:latest
46+
# - geerlingguy/docker-debian9-ansible:latest
4747

4848
steps:
4949
- name: Check out the repository

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,27 +14,47 @@
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
pip:
1919
state: present
20-
name:
21-
- pre-commit
22-
- pipx
20+
name: python3-venv
2321

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

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

3555
- name: Check if poetry is installed
36-
command: poetry --version
37-
register: poetry_version_cmd
56+
command: poetry
57+
register: poetry_cmd
3858
changed_when: false
3959
ignore_errors: true
4060

@@ -43,22 +63,21 @@
4363
url: https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py
4464
dest: "{{ ansible_env.HOME }}/get-poetry.py"
4565
mode: "0400"
46-
when: poetry_version_cmd is failed
66+
when: poetry_cmd is failed
4767
notify: delete poetry installer
4868

4969
- name: Install poetry
5070
command: "python3 {{ ansible_env.HOME }}/get-poetry.py"
51-
when: poetry_version_cmd is failed
71+
when: poetry_cmd is failed
5272

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

5978
- name: Install nox
6079
command: pipx install nox
61-
when: nox_version_cmd is failed
80+
when: nox_folder_check is failed
6281

6382
- name: Install nox-poetry
6483
command: pipx inject nox nox-poetry

0 commit comments

Comments
 (0)