|
1 | 1 | # tasks file
|
2 | 2 | ---
|
3 |
| -- name: Include variables |
| 3 | +- name: Install Python | Include variables |
4 | 4 | ansible.builtin.include_vars: "{{ item }}"
|
5 | 5 | with_first_found:
|
6 | 6 | - "_{{ ansible_distribution_release }}.yml"
|
|
10 | 10 | tags:
|
11 | 11 | - configuration
|
12 | 12 |
|
13 |
| -- name: Create download directory |
| 13 | +- name: Install Python | Create download directory |
14 | 14 | ansible.builtin.file:
|
15 | 15 | path: "{{ downloads_path }}"
|
16 | 16 | state: directory
|
17 | 17 | owner: root
|
18 | 18 | group: root
|
19 | 19 | mode: 0755
|
20 | 20 |
|
21 |
| -- name: Include tasks |
| 21 | +- name: Install Python | Include installation tasks |
22 | 22 | ansible.builtin.include_tasks: '{{ ansible_os_family | lower }}/main.yml'
|
23 | 23 |
|
24 |
| -- name: Install python | Upgrade tools |
| 24 | +- name: Install Python | Upgrade tools |
25 | 25 | ansible.builtin.command: >
|
26 | 26 | /opt/python/{{ item }}/bin/pip install --upgrade \
|
27 | 27 | pip setuptools wheel
|
|
31 | 31 | tags:
|
32 | 32 | - python-install-upgrade-tools
|
33 | 33 |
|
34 |
| -- name: Install python | Make available as a Jupyter Kernel |
| 34 | +- name: Install Python | Make available as a Jupyter Kernel |
35 | 35 | when: python_jupyter_kernel
|
36 | 36 | tags:
|
37 | 37 | - python-install-jupyter-kernel
|
38 | 38 | block:
|
39 |
| - - name: Install python | Install ipykernel |
| 39 | + - name: Install Python | Install ipykernel |
40 | 40 | ansible.builtin.pip:
|
41 | 41 | executable: "/opt/python/{{ item }}/bin/pip"
|
42 | 42 | name: ipykernel
|
43 | 43 | loop: "{{ python_versions }}"
|
44 | 44 |
|
45 |
| - - name: Install python | Check if kernel.json exists |
| 45 | + - name: Install Python | Check if kernel.json exists |
46 | 46 | ansible.builtin.stat:
|
47 | 47 | path: "/usr/local/share/jupyter/kernels/py{{ item }}/kernel.json"
|
48 | 48 | loop: "{{ python_versions }}"
|
49 | 49 | register: kernel_json
|
50 | 50 |
|
51 |
| - - name: Install python | Make available as a Jupyter Kernel |
| 51 | + - name: Install Python | Run ipykernel install |
52 | 52 | ansible.builtin.command: >
|
53 | 53 | /opt/python/{{ item }}/bin/python -m ipykernel install \
|
54 | 54 | --name py{{ item }} --display-name "Python {{ item }}"
|
|
57 | 57 | index_var: index
|
58 | 58 | register: command_result
|
59 | 59 | changed_when: kernel_json.results[index].stat.exists == false
|
| 60 | + |
| 61 | +- name: Install Python | Include Jupyter installation tasks |
| 62 | + ansible.builtin.include_tasks: './install-jupyter.yml' |
0 commit comments