Izveden refactor iz taskov v role
This commit is contained in:
parent
747438dedf
commit
a35460a57b
317 changed files with 2761 additions and 50 deletions
4
roles/thonny/tasks/main.yml
Normal file
4
roles/thonny/tasks/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- import_tasks: main_win.yml
|
||||
when: ansible_connection == 'winrm'
|
||||
- import_tasks: main_lin.yml
|
||||
when: ansible_connection == 'ssh'
|
4
roles/thonny/tasks/main_lin.yml
Normal file
4
roles/thonny/tasks/main_lin.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
- name: Install cmake
|
||||
apt:
|
||||
name: thonny
|
||||
state: latest
|
27
roles/thonny/tasks/main_win.yml
Normal file
27
roles/thonny/tasks/main_win.yml
Normal file
|
@ -0,0 +1,27 @@
|
|||
- name: Set Thonny version
|
||||
set_fact:
|
||||
target_version: 4.0.1
|
||||
|
||||
- name: Check Thonny install status
|
||||
win_stat:
|
||||
path: C:\Program Files (x86)\Thonny\thonny.exe
|
||||
register: file
|
||||
|
||||
- when: not file.stat.exists
|
||||
block:
|
||||
# win_package fails to download for some reason
|
||||
- name: Download Thonny
|
||||
win_get_url:
|
||||
url: https://github.com/thonny/thonny/releases/download/v{{ target_version }}/thonny-{{ target_version }}.exe
|
||||
dest: 'C:\'
|
||||
register: download
|
||||
|
||||
- name: Install Thonny
|
||||
win_package:
|
||||
path: "{{ download.dest }}"
|
||||
arguments: /Verysilent /AllUsers
|
||||
|
||||
- name: Remove temporary files
|
||||
win_file:
|
||||
path: "{{ download.dest }}"
|
||||
state: absent
|
Loading…
Add table
Add a link
Reference in a new issue