|
1 | 1 | --- |
2 | 2 | - name: Install pyenv |
3 | | - import_role: |
| 3 | + ansible.builtin.import_role: |
4 | 4 | name: staticdev.pyenv |
5 | 5 | vars: |
6 | 6 | pyenv_owner: "{{ ansible_env.USER }}" |
7 | 7 | pyenv_path: "{{ ansible_env.HOME }}/pyenv" |
8 | 8 | when: pyenv_python_versions |
9 | 9 |
|
10 | 10 | - name: Ensure dependencies are installed |
11 | | - package: |
| 11 | + ansible.builtin.package: |
12 | 12 | name: "{{ item }}" |
13 | 13 | state: present |
14 | 14 | become: true |
|
17 | 17 | - python3-venv # needed for nox |
18 | 18 |
|
19 | 19 | - name: Check if pipx is installed |
20 | | - command: "{{ ansible_env.HOME }}/.local/bin/pipx --version" |
| 20 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx --version" |
21 | 21 | register: pipx_version_cmd |
22 | 22 | changed_when: false |
23 | 23 | ignore_errors: true |
24 | 24 |
|
25 | 25 | - name: Install pipx |
26 | | - pip: |
| 26 | + ansible.builtin.pip: |
27 | 27 | name: pipx |
28 | 28 | extra_args: --user |
29 | 29 | when: pipx_version_cmd is failed |
30 | 30 |
|
31 | 31 | - name: Check if pre-commit is installed |
32 | | - command: "{{ ansible_env.HOME }}/.local/bin/pre-commit --version" |
| 32 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pre-commit --version" |
33 | 33 | register: pre_commit_check |
34 | 34 | changed_when: false |
35 | 35 | ignore_errors: true |
36 | 36 |
|
37 | 37 | - name: Install pre-commit |
38 | | - command: "{{ ansible_env.HOME }}/.local/bin/pipx install pre-commit" |
| 38 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx install pre-commit" |
39 | 39 | register: output |
40 | 40 | when: pre_commit_check is failed |
41 | 41 |
|
42 | 42 | - name: Check if cookiecutter is installed |
43 | | - stat: |
| 43 | + ansible.builtin.stat: |
44 | 44 | path: "{{ ansible_env.HOME }}/.local/pipx/venvs/cookiecutter" |
45 | 45 | register: cookiecutter_folder_check |
46 | 46 |
|
47 | 47 | - name: Install cookiecutter |
48 | | - command: "{{ ansible_env.HOME }}/.local/bin/pipx install cookiecutter" |
| 48 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx install cookiecutter" |
49 | 49 | register: output |
50 | 50 | when: cookiecutter_folder_check is failed |
51 | 51 |
|
52 | 52 | - name: Check if poetry is installed |
53 | | - command: "{{ ansible_env.HOME }}/.local/bin/poetry" |
| 53 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/poetry" |
54 | 54 | register: poetry_cmd |
55 | 55 | changed_when: false |
56 | 56 | ignore_errors: true |
57 | 57 |
|
58 | 58 | - name: Download poetry installer |
59 | | - get_url: |
| 59 | + ansible.builtin.get_url: |
60 | 60 | url: https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py |
61 | 61 | dest: "{{ ansible_env.HOME }}/install-poetry.py" |
62 | 62 | mode: "0400" |
|
65 | 65 | notify: delete poetry installer |
66 | 66 |
|
67 | 67 | - name: Install poetry |
68 | | - command: "python3 {{ ansible_env.HOME }}/install-poetry.py" |
| 68 | + ansible.builtin.command: "python3 {{ ansible_env.HOME }}/install-poetry.py" |
69 | 69 | when: poetry_cmd is failed |
70 | 70 |
|
71 | 71 | - name: Check if nox is installed |
72 | | - command: "{{ ansible_env.HOME }}/.local/bin/nox --version" |
| 72 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/nox --version" |
73 | 73 | register: nox_version_cmd |
74 | 74 | changed_when: false |
75 | 75 | ignore_errors: true |
76 | 76 |
|
77 | 77 | - name: Install nox |
78 | | - command: "{{ ansible_env.HOME }}/.local/bin/pipx install nox" |
| 78 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx install nox" |
79 | 79 | when: nox_version_cmd is failed |
80 | 80 |
|
81 | 81 | - name: Install nox-poetry |
82 | | - command: "{{ ansible_env.HOME }}/.local/bin/pipx inject nox nox-poetry" |
| 82 | + ansible.builtin.command: "{{ ansible_env.HOME }}/.local/bin/pipx inject nox nox-poetry" |
83 | 83 | when: nox_version_cmd is failed |
0 commit comments