File tree Expand file tree Collapse file tree 9 files changed +40
-7
lines changed Expand file tree Collapse file tree 9 files changed +40
-7
lines changed Original file line number Diff line number Diff line change
1
+ tests/test.yml role-name[path]
Original file line number Diff line number Diff line change 31
31
- id : shell-lint
32
32
33
33
- repo : https://github.com/ansible-community/ansible-lint
34
- rev : v6.0.0
34
+ rev : v6.22.2
35
35
hooks :
36
36
- id : ansible-lint
37
37
Original file line number Diff line number Diff line change 14
14
| Variable | Required | Default | Choices | Comments |
15
15
| -----------------| ----------| ------------------| -----------------------------------| ---------------------------------------|
16
16
| python_versions | yes | [ 3.10.6, 3.9.13] | Array with Python versions >= 3.7 | Version have to be specified as 3.x.y |
17
+ | python_jupyter_kernel | no | true | Boolean: true, false | Makes Python available as a Jupyter Kernel |
17
18
18
19
## Dependencies
19
20
Original file line number Diff line number Diff line change 3
3
python_versions :
4
4
- 3.10.6
5
5
- 3.9.13
6
+ python_jupyter_kernel : true
Original file line number Diff line number Diff line change 6
6
gather_facts : false
7
7
pre_tasks :
8
8
- name : Include vars
9
- include_vars : " {{ playbook_dir }}/../../tests/vars/main.yml"
9
+ ansible.builtin. include_vars : " {{ playbook_dir }}/../../tests/vars/main.yml"
10
10
- name : Include tasks
11
- include : " {{ playbook_dir }}/../../tests/tasks/post.yml"
11
+ ansible.builtin.include_tasks : " {{ playbook_dir }}/../../tests/tasks/post.yml"
Original file line number Diff line number Diff line change 5
5
pre_tasks :
6
6
- name : Include vars
7
7
include_vars : " {{ playbook_dir }}/../../tests/vars/main.yml"
8
+ - name : debug
9
+ debug :
10
+ var : playbook_dir
8
11
roles :
9
- - .. /../../
12
+ - " {{ playbook_dir }} /../../"
Original file line number Diff line number Diff line change 4
4
become : true
5
5
pre_tasks :
6
6
- name : Include vars
7
- include_vars : " {{ playbook_dir }}/../../tests/vars/main.yml"
7
+ ansible.builtin. include_vars : " {{ playbook_dir }}/../../tests/vars/main.yml"
8
8
tasks :
9
9
- name : Include tasks
10
- include : " {{ playbook_dir }}/../../tests/tasks/post.yml"
10
+ ansible.builtin.include_tasks : " {{ playbook_dir }}/../../tests/tasks/post.yml"
Original file line number Diff line number Diff line change 30
30
changed_when : " 'Successfully installed' in command_result.stdout"
31
31
tags :
32
32
- python-install-upgrade-tools
33
+
34
+ - name : Install python | Make available as a Jupyter Kernel
35
+ when : python_jupyter_kernel
36
+ tags :
37
+ - python-install-jupyter-kernel
38
+ block :
39
+ - name : Install python | Install ipykernel
40
+ ansible.builtin.pip :
41
+ executable : " /opt/python/{{ item }}/bin/pip"
42
+ name : ipykernel
43
+ loop : " {{ python_versions }}"
44
+
45
+ - name : Install python | Check if kernel.json exists
46
+ ansible.builtin.stat :
47
+ path : " /usr/local/share/jupyter/kernels/py{{ item }}/kernel.json"
48
+ loop : " {{ python_versions }}"
49
+ register : kernel_json
50
+
51
+ - name : Install python | Make available as a Jupyter Kernel
52
+ ansible.builtin.command : >
53
+ /opt/python/{{ item }}/bin/python -m ipykernel install \
54
+ --name py{{ item }} --display-name "Python {{ item }}"
55
+ loop : " {{ python_versions }}"
56
+ loop_control :
57
+ index_var : index
58
+ register : command_result
59
+ changed_when : kernel_json.results[index].stat.exists == false
Original file line number Diff line number Diff line change 8
8
- name : Include vars
9
9
ansible.builtin.include_vars : " {{ playbook_dir }}/vars/main.yml"
10
10
roles :
11
- - .. /../
11
+ - " {{ playbook_dir }} /.."
12
12
post_tasks :
13
13
- name : Include tasks
14
14
ansible.builtin.include_tasks : " {{ playbook_dir }}/tasks/post.yml"
You can’t perform that action at this time.
0 commit comments