|
35 | 35 | name: pipx |
36 | 36 | extra_args: --user |
37 | 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 |
43 | | - |
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 |
49 | | - |
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 |
54 | | - |
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 |
60 | | - |
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 |
105 | | - |
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 |
| 38 | + |
| 39 | +- name: Check if pre-commit is installed |
| 40 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pre-commit --version" |
| 41 | + register: pre_commit_check |
| 42 | + changed_when: false |
| 43 | + ignore_errors: true |
| 44 | + |
| 45 | +- name: Install pre-commit |
| 46 | + ansible.builtin.command: "{{ pipx_path }}/pipx install pre-commit" |
| 47 | + register: output |
| 48 | + changed_when: "output.rc == 0" |
| 49 | + when: pre_commit_check is failed |
| 50 | + |
| 51 | +- name: Check if cookiecutter is installed |
| 52 | + ansible.builtin.stat: |
| 53 | + path: "{{ ansible_env.HOME }}/.local/pipx/venvs/cookiecutter" |
| 54 | + register: cookiecutter_folder_check |
| 55 | + ignore_errors: true |
| 56 | + |
| 57 | +- name: Install cookiecutter |
| 58 | + ansible.builtin.command: "{{ pipx_path }}/pipx install cookiecutter" |
| 59 | + register: output |
| 60 | + changed_when: "output.rc == 0" |
| 61 | + when: cookiecutter_folder_check is failed |
| 62 | + |
| 63 | +- name: Check if poetry is installed |
| 64 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/poetry" |
| 65 | + register: poetry_cmd |
| 66 | + changed_when: false |
| 67 | + ignore_errors: true |
| 68 | + |
| 69 | +- name: Download poetry installer |
| 70 | + ansible.builtin.get_url: |
| 71 | + url: https://install.python-poetry.org |
| 72 | + dest: "{{ ansible_env.HOME }}/install-poetry.py" |
| 73 | + mode: "0400" |
| 74 | + timeout: 20 |
| 75 | + when: poetry_cmd is failed |
| 76 | + notify: Delete poetry installer |
| 77 | + |
| 78 | +- name: Install poetry |
| 79 | + ansible.builtin.command: "python3 {{ ansible_env.HOME }}/install-poetry.py" |
| 80 | + register: output |
| 81 | + changed_when: "output.rc == 0" |
| 82 | + when: poetry_cmd is failed |
| 83 | + |
| 84 | +- name: Check if nox is installed |
| 85 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/nox --version" |
| 86 | + register: nox_version_cmd |
| 87 | + changed_when: false |
| 88 | + ignore_errors: true |
| 89 | + |
| 90 | +- name: Install nox |
| 91 | + ansible.builtin.command: "{{ pipx_path }}/pipx install nox" |
| 92 | + register: output |
| 93 | + changed_when: "output.rc == 0" |
| 94 | + when: nox_version_cmd is failed |
| 95 | + |
| 96 | +- name: Install nox-poetry |
| 97 | + ansible.builtin.command: "{{ pipx_path }}/pipx inject nox nox-poetry" |
| 98 | + register: output |
| 99 | + changed_when: "output.rc == 0" |
| 100 | + when: nox_version_cmd is failed |
| 101 | + |
| 102 | +- name: Check if tox is installed |
| 103 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/tox --version" |
| 104 | + register: tox_version_cmd |
| 105 | + changed_when: false |
| 106 | + ignore_errors: true |
| 107 | + |
| 108 | +- name: Install tox |
| 109 | + ansible.builtin.command: "{{ pipx_path }}/pipx install tox" |
| 110 | + register: output |
| 111 | + changed_when: "output.rc == 0" |
| 112 | + when: tox_version_cmd is failed |
0 commit comments