From 388f15988ae8087587f03c6e444ac366ad30e287 Mon Sep 17 00:00:00 2001 From: Jannik Beyerstedt Date: Thu, 17 Oct 2019 09:44:52 +0200 Subject: [PATCH] VS Code/ Languages: make it more universial --- README.md | 4 ++-- defaults/main.yml | 4 ++-- tasks/vscode-Archlinux.yml | 2 +- tasks/vscode-Darwin.yml | 2 +- tasks/vscode-Debian.yml | 2 +- tasks/vscode.yml | 19 +++++++++++++++---- 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 80d79a0..c1b2896 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ The User Setup will change the user shell and global gitconfig. This can be disa For a GUI/ Desktop machine, you can enable to install and configure VS Code: - `user_vscode`: Boolean to install and set the basic configuration of VS Code -- `user_vscode_cpp`: Boolean to install C/C++ dev tools and configure VS Code -- `user_vscode_python`: Boolean to install Python dev tools and configure VS Code +- `user_lang_cpp`: Boolean to install C/C++ dev tools and configure VS Code +- `user_lang_python`: Boolean to install Python dev tools and configure VS Code Dependencies diff --git a/defaults/main.yml b/defaults/main.yml index 195adb2..1e1783a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -9,5 +9,5 @@ usersetup_gitconfig: true # install VS Code and selectively activate different programming languages user_vscode: false -user_vscode_cpp: false -user_vscode_python: false +user_lang_cpp: false +user_lang_python: false diff --git a/tasks/vscode-Archlinux.yml b/tasks/vscode-Archlinux.yml index ca58fde..d9b69e5 100644 --- a/tasks/vscode-Archlinux.yml +++ b/tasks/vscode-Archlinux.yml @@ -28,7 +28,7 @@ vars: packages: - clang-format - when: user_vscode == true and user_vscode_cpp == true + when: user_lang_cpp == true # VS Code - Python Development Tools diff --git a/tasks/vscode-Darwin.yml b/tasks/vscode-Darwin.yml index 02c06dc..9d891ce 100644 --- a/tasks/vscode-Darwin.yml +++ b/tasks/vscode-Darwin.yml @@ -28,7 +28,7 @@ vars: packages: - clang-format - when: user_vscode == true and user_vscode_cpp == true + when: user_lang_cpp == true # VS Code - Python Development Tools diff --git a/tasks/vscode-Debian.yml b/tasks/vscode-Debian.yml index 8c5e0e4..0a0aaa1 100644 --- a/tasks/vscode-Debian.yml +++ b/tasks/vscode-Debian.yml @@ -30,7 +30,7 @@ vars: packages: - clang-format - when: user_vscode == true and user_vscode_cpp == true + when: user_lang_cpp == true # VS Code - Python Development Tools diff --git a/tasks/vscode.yml b/tasks/vscode.yml index 906ef3c..12f2d50 100644 --- a/tasks/vscode.yml +++ b/tasks/vscode.yml @@ -1,5 +1,15 @@ --- # Common/VSCode: Install and Configure VS Code +# - Installs VS Code, if user_vscode is set +# - Installs development tools, if the corresponding variable is set +# but will not try to configure VS Code, if user_vscode is not set. +# - Also configures VS Code, of user_vscode is set + +# Variables: +# - user_vscode: Boolean, if vscode should be installed and configured +# - user_lang_cpp: Boolean for C and C++ +# - user_lang_python: Boolean for Python + - name: vscode - Install and configure VS Code include_tasks: "{{ item }}" @@ -30,20 +40,21 @@ shell: | PATH=/usr/local/bin:$PATH code --install-extension ms-vscode.cpptools - when: user_vscode == true and user_vscode_cpp == true + when: user_vscode == true and user_lang_cpp == true # VS Code - Python Development Tools -- name: vscode - Python - block: - name: vscode - Python - Install python dev packages pip: name: - autopep8 - pylint executable: /usr/local/bin/pip3 + when: user_lang_python == true +- name: vscode - Python + block: - name: vscode - Python - Configure VS Code shell: | PATH=/usr/local/bin:$PATH code --install-extension ms-python.python - when: user_vscode == true and user_vscode_python == true + when: user_vscode == true and user_lang_python == true