2019-10-14 07:18:29 +00:00
|
|
|
---
|
2020-01-16 12:40:01 +00:00
|
|
|
# Common/Devel: Install and Configure Dev Environment (optionally VS Code)
|
2019-10-17 07:44:52 +00:00
|
|
|
# - 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
|
2019-10-17 08:25:49 +00:00
|
|
|
# - user_lang_golang: Boolean for Golang
|
|
|
|
# - user_lang_golang_gopath: Go workspace directory
|
2020-05-23 20:30:37 +00:00
|
|
|
# - user_lang_latex: Boolean for LaTeX
|
2019-10-17 07:44:52 +00:00
|
|
|
|
2019-10-14 07:18:29 +00:00
|
|
|
- name: vscode - Install and configure VS Code
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.include_tasks: "{{ item }}"
|
2019-10-14 07:18:29 +00:00
|
|
|
with_first_found:
|
2020-02-28 07:51:48 +00:00
|
|
|
- "devel-{{ ansible_distribution }}.yml"
|
|
|
|
- "devel-{{ (override_os_family is defined) | ternary(override_os_family,ansible_os_family) }}.yml"
|
2019-10-14 07:18:29 +00:00
|
|
|
|
|
|
|
# Install Visual Studio Code and Set Basic Configuration
|
|
|
|
- name: vscode - Basics
|
2022-02-13 19:52:22 +00:00
|
|
|
when: user_vscode == true
|
2019-10-14 07:18:29 +00:00
|
|
|
block:
|
|
|
|
- name: vscode - Basics - Configure
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.shell: |
|
2019-10-14 07:18:29 +00:00
|
|
|
PATH=/usr/local/bin:$PATH
|
|
|
|
code --install-extension chiehyu.vscode-astyle
|
|
|
|
code --install-extension editorconfig
|
2020-02-28 08:39:56 +00:00
|
|
|
code --install-extension mhutchie.git-graph
|
2019-10-14 07:18:29 +00:00
|
|
|
|
|
|
|
code --install-extension yzane.markdown-pdf
|
2020-02-28 08:39:56 +00:00
|
|
|
code --install-extension jebbs.plantuml
|
2020-05-23 20:30:37 +00:00
|
|
|
code --install-extension mechatroner.rainbow-csv
|
|
|
|
code --install-extension grapecity.gc-excelviewer
|
2019-10-14 07:18:29 +00:00
|
|
|
|
|
|
|
# VS Code - C/C++ Development Tools
|
|
|
|
- name: vscode - C/C++
|
2022-02-13 19:52:22 +00:00
|
|
|
when: user_vscode == true and user_lang_cpp == true
|
2019-10-14 07:18:29 +00:00
|
|
|
block:
|
|
|
|
- name: vscode - C/C++ - Configure VS Code
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.shell: |
|
2019-10-14 07:18:29 +00:00
|
|
|
PATH=/usr/local/bin:$PATH
|
|
|
|
code --install-extension ms-vscode.cpptools
|
2020-05-15 10:51:48 +00:00
|
|
|
code --install-extension ms-vscode.cmake-tools
|
|
|
|
code --install-extension twxs.cmake
|
2019-10-14 07:18:29 +00:00
|
|
|
|
|
|
|
# VS Code - Python Development Tools
|
2020-05-23 20:30:37 +00:00
|
|
|
- name: devel - Python - Install python dev packages
|
2022-02-13 19:52:22 +00:00
|
|
|
when: user_lang_python == true
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.pip:
|
2019-10-17 08:25:49 +00:00
|
|
|
name:
|
|
|
|
- autopep8
|
2020-04-06 09:15:32 +00:00
|
|
|
# - pylint # must be installed in each venv individually!
|
2020-06-25 10:04:14 +00:00
|
|
|
executable: "{{ override_pip_exe | default(default_pip3_exe) }}"
|
2019-10-17 07:44:52 +00:00
|
|
|
- name: vscode - Python
|
2022-02-13 19:52:22 +00:00
|
|
|
when: user_vscode == true and user_lang_python == true
|
2019-10-17 07:44:52 +00:00
|
|
|
block:
|
2019-10-14 07:18:29 +00:00
|
|
|
- name: vscode - Python - Configure VS Code
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.shell: |
|
2019-10-14 07:18:29 +00:00
|
|
|
PATH=/usr/local/bin:$PATH
|
|
|
|
code --install-extension ms-python.python
|
2019-10-17 08:25:49 +00:00
|
|
|
|
|
|
|
# VC Code - Golang Development Tools
|
|
|
|
# https://golang.org/doc/install
|
2020-01-16 12:40:01 +00:00
|
|
|
- name: devel - Golang - Setup Environment
|
2022-02-13 19:52:22 +00:00
|
|
|
when: user_lang_golang == true
|
2019-10-17 08:25:49 +00:00
|
|
|
block:
|
2020-01-16 12:40:01 +00:00
|
|
|
- name: devel - Golang - Create workspace directory
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.file:
|
2019-10-17 08:25:49 +00:00
|
|
|
path: "{{ user_lang_golang_gopath }}"
|
|
|
|
state: directory
|
2020-01-16 12:40:01 +00:00
|
|
|
- name: devel - Golang - Create zshrc-host
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.file:
|
2022-06-16 09:07:42 +00:00
|
|
|
path: "{{ ansible_user_dir }}/.zshrc-host"
|
2019-10-17 08:25:49 +00:00
|
|
|
state: touch
|
2020-01-16 12:40:01 +00:00
|
|
|
- name: devel - Golang - Add GOPATH
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.lineinfile:
|
2022-06-16 09:07:42 +00:00
|
|
|
path: "{{ ansible_user_dir }}/.zshrc-host"
|
2019-10-17 08:25:49 +00:00
|
|
|
line: "export GOPATH={{ user_lang_golang_gopath }}"
|
|
|
|
state: present
|
|
|
|
backup: yes
|
2020-01-16 12:40:01 +00:00
|
|
|
- name: devel - Golang - Add go bin to PATH
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.lineinfile:
|
2022-06-16 09:07:42 +00:00
|
|
|
path: "{{ ansible_user_dir }}/.zshrc-host"
|
2019-10-17 08:25:49 +00:00
|
|
|
line: "export PATH=$PATH:{{ user_lang_golang_gopath }}/bin"
|
|
|
|
state: present
|
|
|
|
backup: yes
|
2020-05-23 20:30:37 +00:00
|
|
|
# TODO: make this resilient against changes
|
2019-10-17 08:25:49 +00:00
|
|
|
# and group all golang stuff in one section inside zshrc-host
|
|
|
|
|
|
|
|
- name: vscode - Golang
|
2022-02-13 19:52:22 +00:00
|
|
|
when: user_vscode == true and user_lang_golang == true
|
2019-10-17 08:25:49 +00:00
|
|
|
block:
|
|
|
|
- name: vscode - Golang - Configure VS Code
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.shell: |
|
2019-10-17 08:25:49 +00:00
|
|
|
PATH=/usr/local/bin:$PATH
|
2020-06-25 10:02:33 +00:00
|
|
|
code --install-extension golang.go
|
2020-05-23 20:30:37 +00:00
|
|
|
|
|
|
|
# VS Code - LaTeX Distribution
|
|
|
|
- name: devel - LaTeX - Install TeX packages
|
2022-02-13 19:52:22 +00:00
|
|
|
when: user_lang_latex == true
|
2020-05-23 20:30:37 +00:00
|
|
|
become: yes
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.shell: |
|
2020-07-18 12:31:13 +00:00
|
|
|
PATH=/Library/TeX/texbin:$PATH
|
2022-02-17 15:00:33 +00:00
|
|
|
tlmgr update --self
|
2020-05-23 20:30:37 +00:00
|
|
|
tlmgr install latexmk latexindent biblatex logreq xstring biber
|
|
|
|
tlmgr install collection-fontsextra collection-fontsrecommended collection-fontutils collection-langgerman collection-langenglish collection-mathscience
|
2022-02-17 15:00:33 +00:00
|
|
|
tlmgr install todonotes textpos lipsum pgfopts xpatch enumitem nomencl glossaries glossaries-german glossaries-english datatool mfirstuc xfor substr tracklang placeins placeins-plain csquotes appendixnumberbeamer fontaxes hyphenat
|
2020-05-23 20:30:37 +00:00
|
|
|
- name: vscode - LaTeX
|
2022-02-13 19:52:22 +00:00
|
|
|
when: user_vscode == true and user_lang_latex == true
|
2020-05-23 20:30:37 +00:00
|
|
|
block:
|
|
|
|
- name: vscode - Basics - Configure
|
2021-08-28 14:58:03 +00:00
|
|
|
ansible.builtin.shell: |
|
2020-05-23 20:30:37 +00:00
|
|
|
PATH=/usr/local/bin:$PATH
|
|
|
|
code --install-extension james-yu.latex-workshop
|