This commit is contained in:
RR 2024-09-13 15:33:19 +02:00
commit 2bb0441b44
37 changed files with 154 additions and 63 deletions

8
README.md Normal file
View file

@ -0,0 +1,8 @@
Ansible playbooks for deploying classroom computers. Run with something like:
ansible-playbook --user <AD admin> --ask-pass \
--become-user=<local admin>
--inventory hosts winsetup.yml
ansible-playbook --user <local admin> --ask-pass \
--inventory hosts linsetup.yml

View file

@ -3,8 +3,12 @@
become: true become: true
vars: vars:
ansible_port: 1001 ansible_port: 1001
ansible_become_pass: '{{ lookup("env", "ANSIBLE_PASSWORD") }}' # ansible_become_pass: '{{ lookup("env", "ANSIBLE_PASSWORD") }}'
ansible_password: '{{ lookup("env", "ANSIBLE_PASSWORD") }}' # ansible_password: '{{ lookup("env", "ANSIBLE_PASSWORD") }}'
ansible_connection: 'ssh' ansible_connection: 'ssh'
vars_files:
- vars/credentials.yml
- vars/software_keys.yml
roles: roles:
- all_classes # - all_classes
- fri_base

View file

@ -3,4 +3,4 @@
# Windows, VMware Workstation 16.2.4 Player, wireshark # Windows, VMware Workstation 16.2.4 Player, wireshark
dependencies: dependencies:
- role: wireshark - role: wireshark
- role: vmware_player - role: virtualbox

View file

@ -4,7 +4,7 @@
dependencies: dependencies:
- role: docker - role: docker
- role: vscode - role: vscode
- role: dotnet6 - role: dotnet
- role: git - role: git
- role: android_studio - role: android_studio

View file

@ -7,4 +7,4 @@
dependencies: dependencies:
- role: putty - role: putty
- role: vivado - role: vivado
- role: cp210x-vcp-drivers-win10 - role: cp2102_driver

View file

@ -2,4 +2,4 @@
# Nejc.Ilc@fri.uni-lj.si # Nejc.Ilc@fri.uni-lj.si
# Windows, VMware Workstation 16.2.4 Player # Windows, VMware Workstation 16.2.4 Player
dependencies: dependencies:
- role: vmware_player - role: twincat3

View file

@ -3,7 +3,7 @@
# Windows, Power designer 12.5, Java JDK, Python 3, dotnet6 SDK, Jupyter Notebook, Eclipse, MySql Workbench, MySQL ODBC Connector, Notepad++ # Windows, Power designer 12.5, Java JDK, Python 3, dotnet6 SDK, Jupyter Notebook, Eclipse, MySql Workbench, MySQL ODBC Connector, Notepad++
dependencies: dependencies:
- role: eclipse - role: eclipse
- role: dotnet6 - role: dotnet
- role: jupyter - role: jupyter
- role: jdk - role: jdk
- role: powerdesigner - role: powerdesigner

View file

@ -3,7 +3,7 @@
# Windows, Power designer 12.5, Java JDK, Python 3, dotnet6 SDK, Jupyter Notebook, Eclipse, MySql Workbench, MySQL ODBC Connector, Notepad++ # Windows, Power designer 12.5, Java JDK, Python 3, dotnet6 SDK, Jupyter Notebook, Eclipse, MySql Workbench, MySQL ODBC Connector, Notepad++
dependencies: dependencies:
- role: eclipse - role: eclipse
- role: dotnet6 - role: dotnet
- role: jupyter - role: jupyter
- role: jdk - role: jdk
- role: powerdesigner - role: powerdesigner

View file

@ -0,0 +1,4 @@
- name: Do not install AlgoBuilder
debug:
msg: "Do not install AlgoBuilder on Linux"

View file

@ -0,0 +1,30 @@
# TODO check install status
- name: Check AlgoBuilder install status
win_stat:
path: C:\Program Files (x86)\Thonny\thonny.exe
register: file
- when: not file.stat.exists
block:
- name: Download AlgoBuilder
win_command: wget "https://unilj-my.sharepoint.com/:u:/g/personal/rozman_fri1_uni-lj_si/EZhqHxJoAfdEjdlMu0uGWGcBOqrT0vTVv2_nhynWZ3fOwQ?e=rcskhq&download=1" -O C:\AlgoBuilderSuite.exe
args:
creates: C:\AlgoBuilderSuite.exe
#win_get_url:
# follow_redirects: all
# http_agent: Wget/1.21.3
# url: https://unilj-my.sharepoint.com/:u:/r/personal/rozman_fri1_uni-lj_si/Documents/Arhiv/ImportantFiles/AlgoBuilderSuite.exe?download=1
# dest: C:\AlgoBuilderSuite.exe
#register: download
- name: Install AlgoBuilder
win_package:
path: C:\AlgoBuilderSuite.exe
# path: "{{ download.dest }}"
arguments: /Verysilent /AllUsers
- name: Remove temporary files
win_file:
path: C:\AlgoBuilderSuite.exe
# path: "{{ download.dest }}"
state: absent

View file

@ -6,8 +6,8 @@
state: directory state: directory
- name: Download and unpack Android Studio - name: Download and unpack Android Studio
unarchive: unarchive:
# src: https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2021.3.1.16/android-studio-2021.3.1.16-linux.tar.gz # src: https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2022.3.1.19/android-studio-2022.3.1.19-linux.tar.gz
src: https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2022.3.1.19/android-studio-2022.3.1.19-linux.tar.gz src: https://redirector.gvt1.com/edgedl/android/studio/ide-zips/2024.1.1.12/android-studio-2024.1.1.12-linux.tar.gz
creates: /opt/Android_Studio/android-studio/build.txt creates: /opt/Android_Studio/android-studio/build.txt
dest: /opt/Android_Studio dest: /opt/Android_Studio
remote_src: yes remote_src: yes

View file

@ -1,8 +1,8 @@
- name: Set Android Studio version - name: Set Android Studio version
set_fact: set_fact:
sdk_path: C:\android-sdk sdk_path: C:\android-sdk
studio_version: "2021.3.1.16" studio_version: "2024.1.1.12"
tools_version: "8512546_latest" tools_version: "11076708_latest"
- name: Check Android Studio tools - name: Check Android Studio tools
win_stat: win_stat:
@ -57,28 +57,28 @@
ANDROID_PREFS_ROOT: D:\ ANDROID_PREFS_ROOT: D:\
GRADLE_USER_HOME: D:\.gradle GRADLE_USER_HOME: D:\.gradle
- name: Check HAXM install status #- name: Check HAXM install status
win_stat: # win_stat:
path: "%ProgramFiles%\\Intel\\HAXM" # path: "%ProgramFiles%\\Intel\\HAXM"
register: file # register: file
- when: not file.stat.exists #- when: not file.stat.exists
block: # block:
- name: Download HAXM # - name: Download HAXM
win_get_url: # win_get_url:
url: https://github.com/intel/haxm/releases/download/v7.7.1/haxm-windows_v7_7_1.zip # url: https://github.com/intel/haxm/releases/download/v7.7.1/haxm-windows_v7_7_1.zip
dest: C:\ # dest: C:\
register: download # register: download
- name: Unzip HAXM # - name: Unzip HAXM
win_unzip: # win_unzip:
src: "{{ download.dest }}" # src: "{{ download.dest }}"
dest: C:\haxm # dest: C:\haxm
- name: Install HAXM # - name: Install HAXM
win_command: C:\haxm\silent_install.bat # win_command: C:\haxm\silent_install.bat
- name: Remove temporaries # - name: Remove temporaries
win_file: # win_file:
path: C:\haxm # path: C:\haxm
state: absent # state: absent

View file

@ -0,0 +1,4 @@
- import_tasks: main_win.yml
when: ansible_connection == 'winrm'
- import_tasks: main_lin.yml
when: ansible_connection == 'ssh'

View file

@ -0,0 +1,4 @@
- name: "Install Dotnet 8.0"
apt:
name: dotnet8
state: latest

View file

@ -0,0 +1,7 @@
- name: Install .NET 6 SDK
win_chocolatey:
name: dotnet-6.0-sdk
- name: Install .NET 8 SDK
win_chocolatey:
name: dotnet-8.0-sdk

View file

@ -1,4 +0,0 @@
- name: "Install Dotnet 6.0"
apt:
name: dotnet6
state: latest

View file

@ -1,3 +0,0 @@
- name: Install .NET 6 SDK
win_chocolatey:
name: dotnet-6.0-sdk

View file

@ -10,6 +10,8 @@
- name: Install PSCX - name: Install PSCX
community.windows.win_psmodule: community.windows.win_psmodule:
name: Pscx name: Pscx
accept_license: true
allow_clobber: true
state: present state: present
# TODO: turn on GPO to allow guest SMB logins # TODO: turn on GPO to allow guest SMB logins

View file

@ -1,6 +1,6 @@
- name: Install Oracle JDK - name: Install Oracle JDK
win_package: win_package:
path: https://download.oracle.com/java/20/latest/jdk-20_windows-x64_bin.msi path: https://download.oracle.com/java/22/latest/jdk-22_windows-x64_bin.msi
arguments: INSTALLLEVEL=3 arguments: INSTALLLEVEL=3
- name: Find Java version - name: Find Java version
@ -35,16 +35,14 @@
type: dword type: dword
data: 0 data: 0
#- name: Download Java documentation
# TODO: download Java doc
- name: Download Java doc - name: Download Java doc
win_get_url: win_get_url:
path: "{{ reg['raw_value'] }}" dest: "{{ reg['raw_value'] }}"
url: https://download.oracle.com/otn_software/java/jdk/21+35/fd2272bbf8e04c3dbaee13770090416c/jdk-21_doc-all.zip url: https://download.oracle.com/otn_software/java/jdk/22.0.2+9/c9ecb94cd31b495da20a27d4581645e8/jdk-22.0.2_doc-all.zip
register: downloaded_docs register: downloaded_docs
- name: Unpack Java docs - name: Unpack Java docs
win_unzip: win_unzip:
path: "{{ downloaded_docs }}" src: "{{ downloaded_docs['dest'] }}"
dest: "{{ reg['raw_value'] }}\\docs" dest: "{{ reg['raw_value'] }}"
delete_archive: yes delete_archive: yes

View file

@ -4,9 +4,9 @@
file: file:
path: /opt/Julia path: /opt/Julia
state: directory state: directory
- name: Download and unpack Eclipse - name: Download and unpack Julia
unarchive: unarchive:
src: https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.3-linux-x86_64.tar.gz src: https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.4-linux-x86_64.tar.gz
dest: /opt/Julia dest: /opt/Julia
remote_src: yes remote_src: yes

View file

@ -1,4 +1,4 @@
- name: Install Julia - name: Install Julia
win_package: win_package:
path: https://julialang-s3.julialang.org/bin/winnt/x64/1.9/julia-1.9.3-win64.exe path: https://julialang-s3.julialang.org/bin/winnt/x64/1.10/julia-1.10.4-win64.exe
arguments: /VerySilent /AllUsers arguments: /VerySilent /AllUsers

View file

@ -4,9 +4,9 @@
file: file:
path: /opt/Julia path: /opt/Julia
state: directory state: directory
- name: Download and unpack Eclipse - name: Download and unpack Julia
unarchive: unarchive:
src: https://julialang-s3.julialang.org/bin/linux/x64/1.9/julia-1.9.3-linux-x86_64.tar.gz src: https://julialang-s3.julialang.org/bin/linux/x64/1.10/julia-1.10.4-linux-x86_64.tar.gz
dest: /opt/Julia dest: /opt/Julia
remote_src: yes remote_src: yes

View file

@ -1,6 +1,6 @@
- name: Set Matlab version and destination - name: Set Matlab version and destination
set_fact: set_fact:
target_version: "R2023b" target_version: "R2024a_Update_5"
install_dir: "/mnt/ucilnice_d/install/matlab/" install_dir: "/mnt/ucilnice_d/install/matlab/"
license_path: "/mnt/ucilnice_d/install/matlab/network.lic" license_path: "/mnt/ucilnice_d/install/matlab/network.lic"
dest_dir: /opt/matlab dest_dir: /opt/matlab

View file

@ -1,12 +1,12 @@
- name: Set Matlab version and destination - name: Set Matlab version and destination
set_fact: set_fact:
target_version: "r2023b" target_version: "R2024a_Update_5"
license_path: \\ucilnicesmb.fri1.uni-lj.si\ucilnice_d\install\matlab\network.lic license_path: \\ucilnicesmb.fri1.uni-lj.si\ucilnice_d\install\matlab\network.lic
dest_dir: D:\matlab dest_dir: D:\matlab
- name: Mount Matlab ISO - name: Mount Matlab ISO
win_disk_image: win_disk_image:
image_path: "{{ installers }}\\matlab\\matlab-{{ target_version }}_windows.iso" image_path: "{{ installers }}\\matlab\\{{ target_version }}_Windows.iso"
state: present state: present
register: disk_image register: disk_image

View file

@ -7,7 +7,7 @@
block: block:
- name: Download msys2 - name: Download msys2
win_get_url: win_get_url:
url: "https://github.com/msys2/msys2-installer/releases/download/2023-07-18/msys2-x86_64-20230718.exe" url: "https://github.com/msys2/msys2-installer/releases/download/2024-05-07/msys2-x86_64-20240507.exe"
dest: 'C:\' dest: 'C:\'
register: download register: download

View file

@ -1,10 +1,11 @@
# chocolatey package is broken # chocolatey package is broken
- name: Set Octave version - name: Set Octave version
set_fact: set_fact:
target_version: "7.2.0" target_version: "9.2.0"
- name: Install Octave - name: Install Octave
win_package: win_package:
path: https://ftpmirror.gnu.org/octave/windows/octave-{{ target_version }}-w64-installer.exe # path: https://ftpmirror.gnu.org/octave/windows/octave-{{ target_version }}-w64-installer.exe
path: https://mirror.us-midwest-1.nexcess.net/gnu/octave/windows/octave-{{ target_version }}-w64-installer.exe
arguments: /S /AllUsers arguments: /S /AllUsers
creates_path: C:\Program Files\GNU Octave\Octave-{{ target_version }} creates_path: C:\Program Files\GNU Octave\Octave-{{ target_version }}

View file

@ -1,4 +1,4 @@
- name: Install PowerDesigner - name: Install PowerDesigner
win_package: win_package:
path: "{{ installers }}\\PowerDesigner 12.5\\cd1\\setup\\setup.exe" path: "{{ installers }}\\PowerDesigner 12.5\\cd1\\setup\\setup.exe"
arguments: "/s /f1\"{{ installers }}\\PowerDesigner 12.5\\setup.iss\" /f2\"C:\powerdesigner_log.iss\"" arguments: "/s /f1\"{{ installers }}\\PowerDesigner 12.5\\setup.iss\" /f2\"C:\\powerdesigner_log.iss\""

View file

@ -0,0 +1,4 @@
# dependencies:
# - role: fri_base
dependencies:
- role: visualstudio19

View file

@ -0,0 +1,4 @@
- import_tasks: main_win.yml
when: ansible_connection == 'winrm'
- import_tasks: main_lin.yml
when: ansible_connection == 'ssh'

View file

@ -0,0 +1,2 @@
- name: Do not install TwinCat 3 on Linux
debug: Do not install TwinCat 3 on Linux

View file

@ -0,0 +1,5 @@
- name: Install TwinCat 3
win_chocolatey:
name: visualstudio2019community
# Maybe sometime use https://learn.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2022 with the costlier version

View file

@ -0,0 +1,4 @@
- import_tasks: main_win.yml
when: ansible_connection == 'winrm'
- import_tasks: main_lin.yml
when: ansible_connection == 'ssh'

View file

@ -0,0 +1,2 @@
- name: Do not install VisualStudio on Linux
debug: Do not install VisualStudio on Linux

View file

@ -0,0 +1,5 @@
- name: Install Microsoft Visual Studio 2019
win_chocolatey:
name: visualstudio2019community
# Maybe sometime use https://learn.microsoft.com/en-us/visualstudio/install/use-command-line-parameters-to-install-visual-studio?view=vs-2022 with the costlier version

View file

@ -1,4 +1,4 @@
- name: Install Julia - name: Install Julia
win_package: win_package:
path: https://julialang-s3.julialang.org/bin/winnt/x64/1.9/julia-1.9.3-win64.exe path: https://julialang-s3.julialang.org/bin/winnt/x64/1.10/julia-1.10.4-win64.exe
arguments: /VerySilent /AllUsers arguments: /VerySilent /AllUsers

View file

@ -1,6 +1,7 @@
- hosts: classroom - hosts: classroom
become: true become: true
become_method: runas become_method: runas
debugger: on_failed
vars: vars:
ansible_connection: winrm ansible_connection: winrm
ansible_winrm_transport: ntlm ansible_winrm_transport: ntlm
@ -8,6 +9,15 @@
ansible_port: 5985 ansible_port: 5985
logon_type: interactive logon_type: interactive
installers: \\ucilnicesmb.fri1.uni-lj.si\ucilnice_d\install installers: \\ucilnicesmb.fri1.uni-lj.si\ucilnice_d\install
vars_files:
- vars/credentials.yml
- vars/software_keys.yml
roles: roles:
- all_classes # - fri_base
- matlab
# - all_classes
# - android_studio
# - octave
# - audacity
# - vmware_player