Find a file
2020-01-16 13:40:01 +01:00
defaults [FIX] add common_settingsonly flag to role as well 2019-10-31 18:29:35 +01:00
files [GIT] dotfiles: add python venv 2020-01-13 10:44:45 +01:00
handlers [GIT] refactor submodules: add all to own repo 2019-10-06 22:41:31 +02:00
meta [TIDY] yaml auto-format 2019-11-12 21:42:58 +01:00
tasks [BREAKING] rename VS Code tasks to Devel 2020-01-16 13:40:01 +01:00
templates [BREAKING] use configureable gitconfig file 2020-01-16 10:46:42 +01:00
.gitmodules [TIDY] use http submodule url (fixes #4) 2019-11-11 22:35:53 +01:00
README.md [BREAKING] rename VS Code tasks to Devel 2020-01-16 13:40:01 +01:00

Common

Common user settings and tools used by Jannik Beyerstedt. This role is compatible with Debian based systems and macOS.

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

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.)

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")

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:
  - name: Basics - Update first
    import_role:
      name: common
      tasks_from: update
    when: common_settingsonly | default(false) == false
  - name: Basics - Install essential tools
    import_role:
      name: common
      tasks_from: essentials
    when: common_settingsonly | default(false) == false
  - name: Basics - Install more tools
    import_role:
      name: common
      tasks_from: tools
    when: common_settingsonly | default(false) == false

  - name: Basics - Setup user shell
    import_role:
      name: common
      tasks_from: usersetup
    when: common_settingsonly | default(false) == false
  - name: Basics - Install dotfiles
    import_role:
      name: common
      tasks_from: usersettings

  # Additional Tasks for Specific Host Types (not included in the role's main.yml)

  # more tools for your main machine
  - name: Basics - Install user's working utilities
    import_role:
      name: common
      tasks_from: usertools

  # install programming languages and optionally VS Code
  - name: Basics - Install and configure development env (and VS Code)
    import_role:
      name: common
      tasks_from: devel

Or call the different tasks individually:

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

License

GPLv3