Find a file
2024-07-18 14:40:35 +02:00
defaults Usersettings: Add variable to disable vim plugings 2023-01-07 17:41:41 +01:00
files vscode: More settings 2024-07-18 14:40:35 +02:00
handlers [GIT] refactor submodules: add all to own repo 2019-10-06 22:41:31 +02:00
meta change license, add license file 2020-04-08 19:35:34 +02:00
tasks [TIDY] Refactor apt commands 2023-07-03 10:17:52 +02:00
templates zshrc: Add shortcut to compress with ffmpeg 2023-11-20 10:01:21 +01:00
.gitmodules [GIT] dotfiles: don't use a submodule any more (fixes #10) 2020-03-27 23:13:20 +01:00
LICENSE change license, add license file 2020-04-08 19:35:34 +02:00
README.md Usersettings: Add variable to disable vim plugings 2023-01-07 17:41:41 +01:00

Common

Common user settings and tools used by Jannik Beyerstedt. This role is compatible with Debian based systems, macOS, CentOS (no development toolchains) and ArchLinux (no updates).

Requirements

Have a user set up on the machine, to which you can connecto via a ssh key. This user must also have sudo right without asking for a password! (e.g. using %sudo ALL=(ALL) NOPASSWD:ALL when editing the sudoers file with sudo visudo)

Role Variables

This role uses the apt package manager on Debian based hosts. But for some operating systems the ansible_os_family variable is not set to "Debian" by the fact gathering even if it is Debian based (like Mendel GNU/Linux on the Google Coral Dev Board).

  • override_os_family: Set to "Debian" in the host inventory, if ansible_os_family is not set correctly

On macOS, it might be needed to specify the full path to the pip3 executable:

  • override_pip_exe: Set a custom pip executable (default: n.a.)

The User Setup will change the user shell and global gitconfig. This can be disabled:

  • usersetup_chsh: Boolean to enable changing the user shell to zsh (default: true)
  • usersetup_gitconfig: Boolean to disable overriding the global gitconfig (default: true)
    • gitconfig_name: User's name in .gitconfig file (default: n.a.)
    • gitconfig_email: User's email in .gitconfig file (default: n.a.)
  • usersetup_virtualenvwrapper: Boolean to enable the virtualenvwrapper plugin in oh-my-zsh (default: false)
  • usersetup_vimplugins: Boolean to enable installing my VIM plugins (default: true)

The development environment for different programming languages can be setup automatically. To enable, that Visual Studio Code will be installed and configured, set user_vscode to true, otherwise only the bare development toolchain will be installed. 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 (default: false)
  • user_lang_cpp: Boolean to install C/C++ dev tools and configure VS Code (default: false)
  • user_lang_python: Boolean to install Python dev tools and configure VS Code (default: false)
  • user_lang_golang: Boolean to install Golang dev tools and configure VS Code (default: false)
    • user_lang_golang_gopath: Install path for golang (default: "{{ ansible_user_dir }}/Development/go")
  • user_lang_latex: Boolean to install a LaTeX distribution and configure VS Code (default: false)

By default, this role will run updates, install some essential tools, set up the user's shell and copy the dotfiles. If you just want to have the dotfiles managed by ansible, set common_settingsonly to true! This can be useful, if you have no sudo rights, because tool installation will need these.

Dependencies

none

Example Playbook

You can simply run the whole role:

- name: Basic User Shell Setup
  hosts: all
  tasks:
  - ansible.builtin.import_role:
      name: common

Or call the different tasks individually:

- name: Basic User Shell Setup
  hosts: all
  tasks:
  - name: Basics - Update first
    when: common_settingsonly | default(false) == false
    ansible.builtin.import_role:
      name: common
      tasks_from: update
  
  ## Run rasks from the role's main.yml
  - name: Basics - Install essential tools
    when: common_settingsonly | default(false) == false
    ansible.builtin.import_role:
      name: common
      tasks_from: essentials
  - name: Basics - Install basic tools
    when: common_settingsonly | default(false) == false
    ansible.builtin.import_role:
      name: common
      tasks_from: tools
  - name: Basics - Setup user shell
    when: common_settingsonly | default(false) == false
    ansible.builtin.import_role:
      name: common
      tasks_from: usersetup
  - name: Basics - Install dotfiles
    ansible.builtin.import_role:
      name: common
      tasks_from: usersettings

  ## Additionall tasks for a work station machine
  - name: Basics - Install user's working utilities
    ansible.builtin.import_role:
      name: common
      tasks_from: usertools
  - name: Basics - Install and configure development env (and VS Code)
    ansible.builtin.import_role:
      name: common
      tasks_from: devel

License

GPLv3