From 1a6e73aefb89cadbc0b5713a6e79a4c715e6ab46 Mon Sep 17 00:00:00 2001 From: polz Date: Fri, 8 Mar 2024 16:08:03 +0100 Subject: [PATCH] Add an untested method for installing VisualStudio --- roles/visualstudio/handlers/main.yml | 4 ++++ roles/visualstudio/tasks/main.yml | 4 ++++ roles/visualstudio/tasks/main_lin.yml | 2 ++ roles/visualstudio/tasks/main_win.yml | 5 +++++ 4 files changed, 15 insertions(+) create mode 100644 roles/visualstudio/handlers/main.yml create mode 100644 roles/visualstudio/tasks/main.yml create mode 100644 roles/visualstudio/tasks/main_lin.yml create mode 100644 roles/visualstudio/tasks/main_win.yml diff --git a/roles/visualstudio/handlers/main.yml b/roles/visualstudio/handlers/main.yml new file mode 100644 index 0000000..70c210e --- /dev/null +++ b/roles/visualstudio/handlers/main.yml @@ -0,0 +1,4 @@ +# Mark everything in bin/ directories executable. Some extensions do +# this on activation, but non-root users don’t have permission for it. +- name: fix VS code extensions + command: find /usr/share/code/resources/app -name bin -exec chmod -R +x '{}' ';' diff --git a/roles/visualstudio/tasks/main.yml b/roles/visualstudio/tasks/main.yml new file mode 100644 index 0000000..55203f6 --- /dev/null +++ b/roles/visualstudio/tasks/main.yml @@ -0,0 +1,4 @@ +- import_tasks: main_win.yml + when: ansible_connection == 'winrm' +- import_tasks: main_lin.yml + when: ansible_connection == 'ssh' diff --git a/roles/visualstudio/tasks/main_lin.yml b/roles/visualstudio/tasks/main_lin.yml new file mode 100644 index 0000000..54a5121 --- /dev/null +++ b/roles/visualstudio/tasks/main_lin.yml @@ -0,0 +1,2 @@ +- name: Do not install VisualStudio on Linux + debug: Do not install VisualStudio on Linux diff --git a/roles/visualstudio/tasks/main_win.yml b/roles/visualstudio/tasks/main_win.yml new file mode 100644 index 0000000..398a3a8 --- /dev/null +++ b/roles/visualstudio/tasks/main_win.yml @@ -0,0 +1,5 @@ +- name: Install Microsoft Visual Studio + win_chocolatey: + name: visualstudio2022community + +# 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