|
1 | 1 | --- |
| 2 | +- name: Load custom facts |
| 3 | + ansible.builtin.import_tasks: custom_facts.yml |
| 4 | + |
2 | 5 | - name: Install pyenv |
3 | 6 | ansible.builtin.import_role: |
4 | 7 | name: staticdev.pyenv |
|
17 | 20 | - python3-venv # needed for nox |
18 | 21 |
|
19 | 22 | - name: Check if pipx is installed |
20 | | - ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx --version" |
| 23 | + ansible.builtin.command: "{{ pipx_path }}/pipx --version" |
21 | 24 | register: pipx_version_cmd |
22 | 25 | changed_when: false |
23 | 26 | ignore_errors: true |
24 | 27 |
|
25 | | -- name: Install pipx |
| 28 | +- name: Install pipx on Debian Bookworm |
| 29 | + ansible.builtin.package: |
| 30 | + name: pipx |
| 31 | + when: pipx_version_cmd is failed and ansible_distribution_release == 'bookworm' |
| 32 | + |
| 33 | +- name: Install pipx on non-Bookworm OS |
26 | 34 | ansible.builtin.pip: |
27 | 35 | name: pipx |
28 | 36 | extra_args: --user |
29 | | - when: pipx_version_cmd is failed |
| 37 | + when: pipx_version_cmd is failed and ansible_distribution_release != 'bookworm' |
| 38 | +# - name: Check if pre-commit is installed |
| 39 | +# ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pre-commit --version" |
| 40 | +# register: pre_commit_check |
| 41 | +# changed_when: false |
| 42 | +# ignore_errors: true |
30 | 43 |
|
31 | | -- name: Check if pre-commit is installed |
32 | | - ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pre-commit --version" |
33 | | - register: pre_commit_check |
34 | | - changed_when: false |
35 | | - ignore_errors: true |
| 44 | +# - name: Install pre-commit |
| 45 | +# ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx install pre-commit" |
| 46 | +# register: output |
| 47 | +# changed_when: "output.rc == 0" |
| 48 | +# when: pre_commit_check is failed |
36 | 49 |
|
37 | | -- name: Install pre-commit |
38 | | - ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx install pre-commit" |
39 | | - register: output |
40 | | - changed_when: "output.rc == 0" |
41 | | - when: pre_commit_check is failed |
42 | | - |
43 | | -- name: Check if cookiecutter is installed |
44 | | - ansible.builtin.stat: |
45 | | - path: "{{ ansible_env.HOME }}/.local/pipx/venvs/cookiecutter" |
46 | | - register: cookiecutter_folder_check |
47 | | - |
48 | | -- name: Install cookiecutter |
49 | | - ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx install cookiecutter" |
50 | | - register: output |
51 | | - changed_when: "output.rc == 0" |
52 | | - when: cookiecutter_folder_check is failed |
53 | | - |
54 | | -- name: Check if poetry is installed |
55 | | - ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/poetry" |
56 | | - register: poetry_cmd |
57 | | - changed_when: false |
58 | | - ignore_errors: true |
| 50 | +# - name: Check if cookiecutter is installed |
| 51 | +# ansible.builtin.stat: |
| 52 | +# path: "{{ ansible_env.HOME }}/.local/pipx/venvs/cookiecutter" |
| 53 | +# register: cookiecutter_folder_check |
59 | 54 |
|
60 | | -- name: Download poetry installer |
61 | | - ansible.builtin.get_url: |
62 | | - url: https://install.python-poetry.org |
63 | | - dest: "{{ ansible_env.HOME }}/install-poetry.py" |
64 | | - mode: "0400" |
65 | | - timeout: 20 |
66 | | - when: poetry_cmd is failed |
67 | | - notify: Delete poetry installer |
68 | | - |
69 | | -- name: Install poetry |
70 | | - ansible.builtin.command: "python3 {{ ansible_env.HOME }}/install-poetry.py" |
71 | | - register: output |
72 | | - changed_when: "output.rc == 0" |
73 | | - when: poetry_cmd is failed |
74 | | - |
75 | | -- name: Check if nox is installed |
76 | | - ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/nox --version" |
77 | | - register: nox_version_cmd |
78 | | - changed_when: false |
79 | | - ignore_errors: true |
| 55 | +# - name: Install cookiecutter |
| 56 | +# ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx install cookiecutter" |
| 57 | +# register: output |
| 58 | +# changed_when: "output.rc == 0" |
| 59 | +# when: cookiecutter_folder_check is failed |
80 | 60 |
|
81 | | -- name: Install nox |
82 | | - ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx install nox" |
83 | | - register: output |
84 | | - changed_when: "output.rc == 0" |
85 | | - when: nox_version_cmd is failed |
86 | | - |
87 | | -- name: Install nox-poetry |
88 | | - ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx inject nox nox-poetry" |
89 | | - register: output |
90 | | - changed_when: "output.rc == 0" |
91 | | - when: nox_version_cmd is failed |
92 | | - |
93 | | -- name: Check if tox is installed |
94 | | - ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/tox --version" |
95 | | - register: tox_version_cmd |
96 | | - changed_when: false |
97 | | - ignore_errors: true |
| 61 | +# - name: Check if poetry is installed |
| 62 | +# ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/poetry" |
| 63 | +# register: poetry_cmd |
| 64 | +# changed_when: false |
| 65 | +# ignore_errors: true |
| 66 | + |
| 67 | +# - name: Download poetry installer |
| 68 | +# ansible.builtin.get_url: |
| 69 | +# url: https://install.python-poetry.org |
| 70 | +# dest: "{{ ansible_env.HOME }}/install-poetry.py" |
| 71 | +# mode: "0400" |
| 72 | +# timeout: 20 |
| 73 | +# when: poetry_cmd is failed |
| 74 | +# notify: Delete poetry installer |
| 75 | + |
| 76 | +# - name: Install poetry |
| 77 | +# ansible.builtin.command: "python3 {{ ansible_env.HOME }}/install-poetry.py" |
| 78 | +# register: output |
| 79 | +# changed_when: "output.rc == 0" |
| 80 | +# when: poetry_cmd is failed |
| 81 | + |
| 82 | +# - name: Check if nox is installed |
| 83 | +# ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/nox --version" |
| 84 | +# register: nox_version_cmd |
| 85 | +# changed_when: false |
| 86 | +# ignore_errors: true |
| 87 | + |
| 88 | +# - name: Install nox |
| 89 | +# ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx install nox" |
| 90 | +# register: output |
| 91 | +# changed_when: "output.rc == 0" |
| 92 | +# when: nox_version_cmd is failed |
| 93 | + |
| 94 | +# - name: Install nox-poetry |
| 95 | +# ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx inject nox nox-poetry" |
| 96 | +# register: output |
| 97 | +# changed_when: "output.rc == 0" |
| 98 | +# when: nox_version_cmd is failed |
| 99 | + |
| 100 | +# - name: Check if tox is installed |
| 101 | +# ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/tox --version" |
| 102 | +# register: tox_version_cmd |
| 103 | +# changed_when: false |
| 104 | +# ignore_errors: true |
98 | 105 |
|
99 | | -- name: Install tox |
100 | | - ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx install tox" |
101 | | - register: output |
102 | | - changed_when: "output.rc == 0" |
103 | | - when: tox_version_cmd is failed |
| 106 | +# - name: Install tox |
| 107 | +# ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx install tox" |
| 108 | +# register: output |
| 109 | +# changed_when: "output.rc == 0" |
| 110 | +# when: tox_version_cmd is failed |
0 commit comments