├── roles ├── git │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── packer │ ├── defaults │ │ └── main.yml │ └── tasks │ │ ├── main.yml │ │ └── linux.yml ├── vagrant │ ├── defaults │ │ └── main.yml │ └── tasks │ │ ├── main.yml │ │ ├── ubuntu.yml │ │ └── arch.yml ├── docker │ ├── defaults │ │ └── main.yml │ └── tasks │ │ ├── main.yml │ │ ├── ubuntu.yml │ │ └── linux.yml ├── zsh │ ├── defaults │ │ └── main.yml │ └── tasks │ │ ├── font_osx.yml │ │ ├── pywal.yml │ │ ├── font_linux.yml │ │ └── main.yml ├── hid_apple │ ├── files │ │ └── hid_apple.conf │ └── tasks │ │ ├── main.yml │ │ └── ubuntu.yml ├── trivy │ └── tasks │ │ ├── main.yml │ │ └── ubuntu.yml ├── k8s │ ├── defaults │ │ └── main.yml │ └── tasks │ │ ├── kube-cleaner.yml │ │ ├── osx.yml │ │ ├── helm_ubuntu.yml │ │ ├── main.yml │ │ ├── gcloud_ubuntu.yml │ │ ├── helm_arch.yml │ │ ├── gcloud_arch.yml │ │ ├── draft.yml │ │ ├── kubectx.yml │ │ ├── linux.yml │ │ └── velero.yml ├── recording │ └── tasks │ │ ├── osx.yml │ │ ├── ubuntu.yml │ │ ├── main.yml │ │ └── arch.yml ├── backup │ └── tasks │ │ └── main.yml ├── cli-tools │ ├── tasks │ │ ├── ctop.yml │ │ ├── gotop.yml │ │ ├── vegeta.yml │ │ ├── keepass.yml │ │ ├── gopass.yml │ │ ├── cfssl.yml │ │ ├── aliases.yml │ │ ├── bat.yml │ │ ├── topgrade.yml │ │ ├── bin.yml │ │ ├── python-based.yml │ │ └── main.yml │ └── defaults │ │ └── main.yml ├── terraform │ └── tasks │ │ └── main.yml ├── idea │ └── tasks │ │ ├── main.yml │ │ └── linux.yml ├── virtualbox │ └── tasks │ │ ├── main.yml │ │ └── ubuntu.yml ├── vscode │ └── tasks │ │ ├── ubuntu.yml │ │ └── main.yml ├── snap │ └── tasks │ │ └── main.yml ├── mercurial │ └── tasks │ │ └── main.yml ├── dotfiles │ └── tasks │ │ └── main.yml ├── tmux │ └── tasks │ │ └── main.yml ├── java │ └── tasks │ │ └── main.yml ├── node │ └── tasks │ │ └── main.yml ├── vim │ └── tasks │ │ └── main.yml ├── gpg │ └── tasks │ │ └── main.yml ├── brew │ └── tasks │ │ └── main.yml └── golang │ └── tasks │ └── main.yml ├── config ├── bat-config ├── gorc ├── bin-config.json.j2 ├── 90-idea.conf ├── README.md ├── gpg-agent.conf.j2 ├── topgrade.toml ├── oh-my-zsh-plugins │ ├── scm.plugin.zsh │ ├── editorconfig.plugin.zsh │ └── vegeta.plugin.zsh ├── gitconfig.j2 ├── gpgrc ├── gpg.conf.j2 └── hgrc.j2 ├── requirements.yml ├── .editorconfig ├── Dockerfile ├── .gitignore ├── devbox ├── playbook.yml ├── .github └── workflows │ └── Build.yaml └── README.md /roles/git/defaults/main.yml: -------------------------------------------------------------------------------- 1 | gh_version: 1.7.0 2 | -------------------------------------------------------------------------------- /config/bat-config: -------------------------------------------------------------------------------- 1 | # Set Nord theme 2 | --theme="Nord" 3 | -------------------------------------------------------------------------------- /roles/packer/defaults/main.yml: -------------------------------------------------------------------------------- 1 | packer_version: 1.7.0 2 | -------------------------------------------------------------------------------- /roles/vagrant/defaults/main.yml: -------------------------------------------------------------------------------- 1 | vagrant_version: 2.2.14 2 | -------------------------------------------------------------------------------- /config/gorc: -------------------------------------------------------------------------------- 1 | export GOPATH=~/Projects/go 2 | export PATH=$PATH:${GOPATH}/bin 3 | -------------------------------------------------------------------------------- /roles/docker/defaults/main.yml: -------------------------------------------------------------------------------- 1 | compose_version: 1.28.6 2 | machine_version: 0.16.2 3 | -------------------------------------------------------------------------------- /roles/zsh/defaults/main.yml: -------------------------------------------------------------------------------- 1 | custom_omz_plugins: 2 | - editorconfig 3 | - vegeta 4 | - scm 5 | -------------------------------------------------------------------------------- /roles/hid_apple/files/hid_apple.conf: -------------------------------------------------------------------------------- 1 | options hid_apple iso_layout=0 2 | options hid_apple fnmode=2 3 | -------------------------------------------------------------------------------- /config/bin-config.json.j2: -------------------------------------------------------------------------------- 1 | { 2 | "default_path" : "{{ lookup('env', 'HOME') }}/.local/bin", 3 | "bins": {} 4 | } 5 | -------------------------------------------------------------------------------- /roles/trivy/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install trivy (Ubuntu) 2 | include: ubuntu.yml 3 | when: ansible_distribution == "Ubuntu" 4 | -------------------------------------------------------------------------------- /roles/hid_apple/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Configure apple keyboard (Ubuntu) 2 | include: ubuntu.yml 3 | when: ansible_distribution == "Ubuntu" 4 | -------------------------------------------------------------------------------- /roles/k8s/defaults/main.yml: -------------------------------------------------------------------------------- 1 | helm_version: 3.5.2 2 | draft_version: 0.16.0 3 | kustomize_version: 4.0.5 4 | k9s_version: 0.24.5 5 | velero_version: 1.5.3 6 | -------------------------------------------------------------------------------- /roles/recording/tasks/osx.yml: -------------------------------------------------------------------------------- 1 | - name: Install kap 2 | homebrew_cask: 3 | name: kap 4 | 5 | - name: Install gifsicle 6 | homebrew: 7 | name: gifsicle 8 | -------------------------------------------------------------------------------- /roles/backup/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install restic 2 | become: yes 3 | apt: 4 | name: 5 | - restic 6 | - nfs-common 7 | when: ansible_distribution == "Ubuntu" 8 | -------------------------------------------------------------------------------- /config/90-idea.conf: -------------------------------------------------------------------------------- 1 | # increase inotify watch limit for intellij 2 | # https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit 3 | fs.inotify.max_user_watches = 524288 4 | -------------------------------------------------------------------------------- /roles/cli-tools/tasks/ctop.yml: -------------------------------------------------------------------------------- 1 | - name: Install ctop 2 | shell: $HOME/.local/bin/bin list | grep {{ item }} || $HOME/.local/bin/bin install {{ item }} 3 | with_items: 4 | - github.com/bcicen/ctop 5 | -------------------------------------------------------------------------------- /roles/cli-tools/tasks/gotop.yml: -------------------------------------------------------------------------------- 1 | - name: Install gotop 2 | shell: $HOME/.local/bin/bin list | grep {{ item }} || $HOME/.local/bin/bin install {{ item }} 3 | with_items: 4 | - github.com/xxxserxxx/gotop 5 | -------------------------------------------------------------------------------- /roles/cli-tools/tasks/vegeta.yml: -------------------------------------------------------------------------------- 1 | - name: Install vegeta 2 | shell: $HOME/.local/bin/bin list | grep {{ item }} || $HOME/.local/bin/bin install {{ item }} 3 | with_items: 4 | - github.com/tsenart/vegeta 5 | -------------------------------------------------------------------------------- /roles/terraform/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install tfenv 2 | git: 3 | repo: https://github.com/tfutils/tfenv.git 4 | dest: ~/.tfenv 5 | update: no 6 | 7 | - name: Install latest terraform 8 | shell: ~/.tfenv/bin/tfenv install 9 | -------------------------------------------------------------------------------- /roles/packer/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install packer (Linux) 2 | include: linux.yml 3 | when: ansible_system == "Linux" 4 | 5 | - name: Install packer (MacOSX) 6 | homebrew: 7 | name: packer 8 | when: ansible_distribution == "MacOSX" 9 | -------------------------------------------------------------------------------- /roles/docker/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install docker (Linux) 2 | include: linux.yml 3 | when: ansible_system == "Linux" 4 | 5 | - name: Install docker (MacOSX) 6 | homebrew_cask: 7 | name: docker-edge 8 | when: ansible_distribution == "MacOSX" 9 | -------------------------------------------------------------------------------- /config/README.md: -------------------------------------------------------------------------------- 1 | # Configurations 2 | 3 | The most of the files in this directory are linked to your home directory. 4 | Changes to them should be visible immediately. 5 | Only changes to files which with the `.j2` are only applied after another run of `devbox`. 6 | -------------------------------------------------------------------------------- /config/gpg-agent.conf.j2: -------------------------------------------------------------------------------- 1 | enable-ssh-support 2 | {% if ansible_distribution == "MacOSX" %} 3 | pinentry-program /usr/local/bin/pinentry-mac 4 | {% else %} 5 | pinentry-program /usr/bin/pinentry-gnome3 6 | {% endif %} 7 | default-cache-ttl 60 8 | max-cache-ttl 120 9 | write-env-file 10 | -------------------------------------------------------------------------------- /config/topgrade.toml: -------------------------------------------------------------------------------- 1 | # Disable specific steps - same options as the command line flag 2 | # Gcloud fails to upgrade because it was installed via package manager 3 | disable = ["gcloud"] 4 | 5 | [git] 6 | # Additional git repositories to pull 7 | repos = [ 8 | "~/.tfenv", 9 | ] 10 | -------------------------------------------------------------------------------- /roles/cli-tools/defaults/main.yml: -------------------------------------------------------------------------------- 1 | docker_aliases_version: 0.4.0 2 | # Version here does not matter too much, because we later manage bin by itself 3 | bin_base_version: 0.7.0 4 | # Version here does not matter too much, because topgrade upgrades itself on each run 5 | topgrade_base_version: 6.9.1 6 | -------------------------------------------------------------------------------- /roles/idea/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install Intellij Idea Ultimate on Linux 2 | include: linux.yml 3 | become: yes 4 | when: ansible_system == "Linux" 5 | 6 | - name: Install Intellij Idea Ultimate (MacOSX) 7 | homebrew_cask: 8 | name: intellij-idea 9 | when: ansible_distribution == "MacOSX" 10 | -------------------------------------------------------------------------------- /roles/k8s/tasks/kube-cleaner.yml: -------------------------------------------------------------------------------- 1 | - name: Check if npm is installed 2 | shell: which npm 3 | register: npm 4 | failed_when: False 5 | changed_when: False 6 | 7 | - name: Install kube-cleaner npm packages 8 | become: yes 9 | npm: 10 | name: kube-cleaner 11 | global: yes 12 | when: npm.rc == 0 13 | -------------------------------------------------------------------------------- /requirements.yml: -------------------------------------------------------------------------------- 1 | # Do not use role from git here, because the roles are installed before git. 2 | # If roles from git should ever be required, they could be installed via an ansible task (executed after the git role!) 3 | # like so: 4 | # - shell: ansible-galaxy install git+https... 5 | - name: Comcast.sdkman 6 | version: 1.7.0 7 | -------------------------------------------------------------------------------- /roles/k8s/tasks/osx.yml: -------------------------------------------------------------------------------- 1 | - name: Install k8s tools 2 | homebrew: 3 | name: 4 | - kubernetes-helm 5 | - draft 6 | - kubectx 7 | - kustomize 8 | - kubectl 9 | - derailed/k9s/k9s 10 | - velero 11 | 12 | - name: Install google-cloud-sdk 13 | homebrew_cask: 14 | name: google-cloud-sdk 15 | -------------------------------------------------------------------------------- /roles/recording/tasks/ubuntu.yml: -------------------------------------------------------------------------------- 1 | - name: Install screen recording packages (Ubuntu) 2 | become: yes 3 | apt: 4 | name: 5 | # gif image optimization 6 | - gifsicle 7 | # gif screen recording 8 | - peek 9 | # video screen recording 10 | - kazam 11 | when: ansible_distribution == "Ubuntu" 12 | -------------------------------------------------------------------------------- /roles/cli-tools/tasks/keepass.yml: -------------------------------------------------------------------------------- 1 | - name: Install keepass apt repo (Ubuntu) 2 | become: yes 3 | apt_repository: 4 | repo: ppa:jtaylor/keepass 5 | when: ansible_distribution == "Ubuntu" 6 | 7 | - name: Install keepass (Ubuntu) 8 | become: yes 9 | apt: 10 | name: keepass2 11 | when: ansible_distribution == "Ubuntu" 12 | -------------------------------------------------------------------------------- /roles/vagrant/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install vagrant (Ubuntu) 2 | include: ubuntu.yml 3 | when: ansible_distribution == "Ubuntu" 4 | 5 | - name: Install vagrant (Arch) 6 | include: arch.yml 7 | when: ansible_distribution == "Archlinux" 8 | 9 | - name: Install vagrant (MacOSX) 10 | homebrew_cask: 11 | name: vagrant 12 | when: ansible_distribution == "MacOSX" 13 | -------------------------------------------------------------------------------- /roles/hid_apple/tasks/ubuntu.yml: -------------------------------------------------------------------------------- 1 | - name: Copy keyboard configuration 2 | become: yes 3 | copy: 4 | src: files/hid_apple.conf 5 | dest: /etc/modprobe.d/hid_apple.conf 6 | owner: root 7 | group: root 8 | mode: '0644' 9 | register: conf 10 | 11 | - name: Regenerate initramfs 12 | become: yes 13 | shell: update-initramfs -u -k all 14 | when: conf.changed 15 | 16 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: https://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | charset = utf-8 9 | end_of_line = lf 10 | insert_final_newline = true 11 | indent_style = space 12 | indent_size = 2 13 | 14 | # Tab indentation (no size specified) 15 | [Makefile] 16 | indent_style = tab 17 | -------------------------------------------------------------------------------- /roles/vagrant/tasks/ubuntu.yml: -------------------------------------------------------------------------------- 1 | - name: Get installed version 2 | shell: dpkg -s vagrant | grep Version | awk -F':' '{print $3}' 3 | register: vagrant 4 | changed_when: False 5 | 6 | - name: Install vagrant 7 | become: yes 8 | apt: 9 | deb: https://releases.hashicorp.com/vagrant/{{ vagrant_version }}/vagrant_{{ vagrant_version }}_x86_64.deb 10 | when: vagrant.stdout != vagrant_version 11 | -------------------------------------------------------------------------------- /roles/zsh/tasks/font_osx.yml: -------------------------------------------------------------------------------- 1 | - name: Create fonts directory 2 | file: 3 | path: ~/Library/Fonts 4 | state: directory 5 | 6 | - name: Install fira nerd-font 7 | unarchive: 8 | src: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.0.0/FiraCode.zip 9 | dest: ~/Library/Fonts 10 | remote_src: yes 11 | creates: ~/Library/Fonts/Fura Code Medium Nerd Font Complete.ttf 12 | -------------------------------------------------------------------------------- /roles/cli-tools/tasks/gopass.yml: -------------------------------------------------------------------------------- 1 | - name: Install gopass (Arch) 2 | become: yes 3 | pacman: 4 | name: gopass 5 | when: ansible_distribution == "Archlinux" 6 | 7 | - name: Install gopass (Ubuntu) 8 | shell: $HOME/.local/bin/bin list | grep {{ item }} || $HOME/.local/bin/bin install {{ item }} 9 | with_items: 10 | - github.com/gopasspw/gopass 11 | when: ansible_distribution == "Ubuntu" 12 | -------------------------------------------------------------------------------- /roles/k8s/tasks/helm_ubuntu.yml: -------------------------------------------------------------------------------- 1 | - name: Install helm gpg key (Ubuntu) 2 | become: yes 3 | apt_key: 4 | url: https://baltocdn.com/helm/signing.asc 5 | 6 | - name: Install helm apt repository (Ubuntu) 7 | become: yes 8 | apt_repository: 9 | repo: deb https://baltocdn.com/helm/stable/debian/ all main 10 | 11 | - name: Install helm package (Ubuntu) 12 | become: yes 13 | apt: 14 | name: helm 15 | -------------------------------------------------------------------------------- /roles/cli-tools/tasks/cfssl.yml: -------------------------------------------------------------------------------- 1 | - name: Install cfssl tools 2 | become: yes 3 | get_url: 4 | url: https://pkg.cfssl.org/R1.2/{{ item }}_linux-amd64 5 | dest: /usr/local/bin/{{ item }} 6 | mode: 0755 7 | owner: root 8 | group: root 9 | with_items: 10 | - cfssl-bundle 11 | - cfssl-certinfo 12 | - cfssl-newkey 13 | - cfssl-scan 14 | - cfssl 15 | - cfssljson 16 | - mkbundle 17 | - multirootca 18 | -------------------------------------------------------------------------------- /config/oh-my-zsh-plugins/scm.plugin.zsh: -------------------------------------------------------------------------------- 1 | scm-root () { 2 | ROOT=$(git rev-parse --show-toplevel 2>/dev/null) 3 | if [ "$?" != 0 ]; then 4 | ROOT=$(hg root 2>/dev/null) 5 | if [ "$?" != 0 ]; then 6 | ROOT=$(svn info . --show-item wc-root --no-newline 2>/dev/null) 7 | fi 8 | fi 9 | if [ -z "${ROOT}" ]; then 10 | echo "no repository root found" 11 | return 1 12 | else 13 | cd "${ROOT}" 14 | fi 15 | } 16 | -------------------------------------------------------------------------------- /config/gitconfig.j2: -------------------------------------------------------------------------------- 1 | [user] 2 | email = {{mail}} 3 | name = {{displayName}} 4 | signingkey = {{gpgKey}} 5 | [alias] 6 | outgoing = log --pretty=oneline --abbrev-commit --graph @{u}.. 7 | incoming = !git fetch && git log --pretty=oneline --abbrev-commit --graph ..@{u} 8 | ignore = "!gi() { curl -L -s https://www.gitignore.io/api/$@ ;}; gi" 9 | [credential] 10 | helper = cache 11 | [pull] 12 | rebase = true 13 | [init] 14 | defaultBranch = main 15 | -------------------------------------------------------------------------------- /roles/virtualbox/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install virtualbox (Ubuntu) 2 | include: ubuntu.yml 3 | when: ansible_distribution == "Ubuntu" 4 | 5 | - name: Install virtualbox (Arch) 6 | become: yes 7 | pacman: 8 | name: virtualbox 9 | when: ansible_distribution == "Archlinux" 10 | 11 | - name: Install virtualbox (MacOSX) 12 | homebrew_cask: 13 | name: 14 | - virtualbox 15 | - virtualbox-extension-pack 16 | when: ansible_distribution == "MacOSX" 17 | -------------------------------------------------------------------------------- /config/oh-my-zsh-plugins/editorconfig.plugin.zsh: -------------------------------------------------------------------------------- 1 | function editorconfig() { 2 | cat << EOF 3 | # EditorConfig is awesome: https://EditorConfig.org 4 | 5 | # top-most EditorConfig file 6 | root = true 7 | 8 | # Unix-style newlines with a newline ending every file 9 | [*] 10 | charset = utf-8 11 | end_of_line = lf 12 | insert_final_newline = true 13 | indent_style = space 14 | indent_size = 2 15 | 16 | # Tab indentation (no size specified) 17 | [Makefile] 18 | indent_style = tab 19 | EOF 20 | } 21 | -------------------------------------------------------------------------------- /roles/idea/tasks/linux.yml: -------------------------------------------------------------------------------- 1 | - name: Install Intellij Idea Ultimate 2 | snap: 3 | classic: yes 4 | name: intellij-idea-ultimate 5 | 6 | - name: Increase file descriptor limit 7 | copy: 8 | src: "{{ playbook_dir }}/config/90-idea.conf" 9 | dest: /etc/sysctl.d/90-idea.conf 10 | owner: root 11 | group: root 12 | mode: 0644 13 | register: inotifylimit 14 | 15 | - name: apply new file descriptor limit 16 | command: sysctl -p --system 17 | when: inotifylimit.changed 18 | 19 | -------------------------------------------------------------------------------- /roles/vscode/tasks/ubuntu.yml: -------------------------------------------------------------------------------- 1 | - name: Remove old snap installation (Ubuntu) 2 | snap: 3 | name: code 4 | state: absent 5 | 6 | - name: Install vscode gpg key (Ubuntu) 7 | apt_key: 8 | url: https://packages.microsoft.com/keys/microsoft.asc 9 | 10 | - name: Install vscode apt repository (Ubuntu) 11 | apt_repository: 12 | repo: deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main 13 | 14 | - name: Install vscode package (Ubuntu) 15 | apt: 16 | name: code 17 | 18 | -------------------------------------------------------------------------------- /config/gpgrc: -------------------------------------------------------------------------------- 1 | # ssh over gpg 2 | # Launch gpg-agent 3 | gpg-connect-agent /bye 4 | 5 | # When using SSH support, use the current TTY for passphrase prompts 6 | gpg-connect-agent updatestartuptty /bye > /dev/null 7 | 8 | # Point the SSH_AUTH_SOCK to the one handled by gpg-agent 9 | if [ -S $(gpgconf --list-dirs agent-ssh-socket) ]; then 10 | export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) 11 | else 12 | echo "$(gpgconf --list-dirs agent-ssh-socket) doesn't exist. Is gpg-agent running ?" 13 | fi 14 | -------------------------------------------------------------------------------- /roles/snap/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install snapd package 2 | become: yes 3 | pacman: 4 | name: snapd 5 | when: ansible_distribution == "Archlinux" 6 | 7 | - name: Start snapd 8 | become: yes 9 | systemd: 10 | name: snapd.socket 11 | enabled: yes 12 | state: started 13 | when: ansible_system == "Linux" 14 | 15 | - name: Enable support for classic snaps 16 | become: yes 17 | file: 18 | dest: /snap 19 | src: /var/lib/snapd/snap 20 | state: link 21 | when: ansible_distribution == "Archlinux" 22 | -------------------------------------------------------------------------------- /roles/k8s/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install k8s tools (Linux) 2 | include: linux.yml 3 | when: ansible_system == "Linux" 4 | 5 | - name: Install k8s tools (MacOSX) 6 | include: osx.yml 7 | when: ansible_distribution == "MacOSX" 8 | 9 | - name: Install kube-cleaner 10 | include: kube-cleaner.yml 11 | 12 | - name: Install k9s 13 | shell: $HOME/.local/bin/bin list | grep {{ item }} || $HOME/.local/bin/bin install {{ item }} 14 | with_items: 15 | - github.com/derailed/k9s 16 | - github.com/dty1er/kubecolor 17 | - github.com/rancher/k3d 18 | -------------------------------------------------------------------------------- /roles/cli-tools/tasks/aliases.yml: -------------------------------------------------------------------------------- 1 | - name: Download kubectl_aliases 2 | get_url: 3 | url: https://raw.githubusercontent.com/ahmetb/kubectl-alias/master/.kubectl_aliases 4 | dest: ~/.kubectl_aliases 5 | # Require owner write to allow idempotent calls of ansible 6 | mode: '0640' 7 | force : yes 8 | 9 | - name: Download docker_aliases 10 | get_url: 11 | url: "https://github.com/schnatterer/docker-aliases/releases/download/{{ docker_aliases_version }}/default.docker-aliases" 12 | dest: ~/.docker_aliases 13 | mode: '0640' 14 | force : yes 15 | -------------------------------------------------------------------------------- /roles/mercurial/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install mercurial (Arch) 2 | become: yes 3 | pacman: 4 | name: mercurial 5 | when: ansible_distribution == "Archlinux" 6 | 7 | - name: Install mercurial (Ubuntu) 8 | become: yes 9 | apt: 10 | name: mercurial 11 | when: ansible_distribution == "Ubuntu" 12 | 13 | - name: Install mercurial (MacOSX) 14 | homebrew: 15 | name: mercurial 16 | when: ansible_distribution == "MacOSX" 17 | 18 | - name: Render mercurial configuration 19 | template: 20 | src: "{{ playbook_dir }}/config/hgrc.j2" 21 | dest: ~/.hgrc 22 | mode: 0600 23 | -------------------------------------------------------------------------------- /roles/dotfiles/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install dotfiles loader 2 | git: 3 | repo: https://github.com/schnatterer/dotfiles-loader 4 | dest: ~/.dotfiles-loader 5 | update: no 6 | 7 | 8 | # This leads to dotfiles "bootstrap" script running non-interactively 9 | - name: Render git configuration 10 | template: 11 | src: "{{ playbook_dir }}/config/gitconfig.j2" 12 | dest: ~/.dotfiles-loader/git/gitconfig.local 13 | mode: 0600 14 | 15 | - name: Bootstrap dotfiles 16 | # B as in "Backup all" 17 | shell: echo B | dotfiles_repo="{{ dotfilesRepo }}" ~/.dotfiles-loader/script/bootstrap 18 | -------------------------------------------------------------------------------- /roles/trivy/tasks/ubuntu.yml: -------------------------------------------------------------------------------- 1 | - name: Install aquasecurity gpg key (Ubuntu) 2 | become: yes 3 | apt_key: 4 | url: https://aquasecurity.github.io/trivy-repo/deb/public.key 5 | 6 | - name: Capture lsb release (Ubuntu) 7 | shell: lsb_release -cs 8 | register: lsbrelease 9 | changed_when: False 10 | 11 | - name: Install aquasecurity trivy repository (Ubuntu) 12 | become: yes 13 | apt_repository: 14 | repo: deb [arch=amd64] https://aquasecurity.github.io/trivy-repo/deb {{ lsbrelease.stdout }} main 15 | 16 | - name: Install trivy package (Ubuntu) 17 | become: yes 18 | apt: 19 | name: trivy 20 | -------------------------------------------------------------------------------- /roles/tmux/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install tmux and required dependencies (Arch) 2 | become: yes 3 | pacman: 4 | name: tmux 5 | when: ansible_distribution == "Archlinux" 6 | 7 | - name: Install tmux and required dependencies (Ubuntu) 8 | become: yes 9 | apt: 10 | name: tmux 11 | when: ansible_distribution == "Ubuntu" 12 | 13 | - name: Install tmux and required dependencies (MacOSX) 14 | homebrew: 15 | name: tmux 16 | when: ansible_distribution == "MacOSX" 17 | 18 | - name: Install tmux plugin manager 19 | git: 20 | repo: https://github.com/tmux-plugins/tpm 21 | dest: ~/.tmux/plugins/tpm 22 | -------------------------------------------------------------------------------- /roles/java/tasks/main.yml: -------------------------------------------------------------------------------- 1 | # We could query latest java 8 or 11 if necessary, like this. 2 | # curl https://api.sdkman.io/2/candidates/java/linuxx64/versions/list?current=&installed= | grep hs-adpt | grep 11. | head -n1 | awk '{print $8}' 3 | # Or we just install latest. Which might be enough. We can still install more JDKs later, if necessary. 4 | - name: Install latest sdkman, java, groovy, gradle, maven 5 | include_role: 6 | name: Comcast.sdkman 7 | vars: 8 | sdkman_install_packages: 9 | - { candidate: maven } 10 | - { candidate: gradle } 11 | - { candidate: groovy } 12 | - { candidate: java } 13 | -------------------------------------------------------------------------------- /roles/k8s/tasks/gcloud_ubuntu.yml: -------------------------------------------------------------------------------- 1 | - name: Install gcloud gpg key (Ubuntu) 2 | become: yes 3 | apt_key: 4 | url: https://packages.cloud.google.com/apt/doc/apt-key.gpg 5 | keyring: /usr/share/keyrings/cloud.google.gpg 6 | 7 | - name: Capture lsb release (Ubuntu) 8 | shell: lsb_release -cs 9 | register: lsbrelease 10 | changed_when: False 11 | 12 | - name: Install docker apt repository (Ubuntu) 13 | become: yes 14 | apt_repository: 15 | repo: deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main 16 | 17 | - name: Install google-cloud-sdk package (Ubuntu) 18 | become: yes 19 | apt: 20 | name: google-cloud-sdk 21 | -------------------------------------------------------------------------------- /roles/cli-tools/tasks/bat.yml: -------------------------------------------------------------------------------- 1 | - name: Install bat (Ubuntu) 2 | become: yes 3 | apt: 4 | name: bat 5 | when: ansible_distribution == "Ubuntu" 6 | 7 | - name: Install bat (Arch) 8 | become: yes 9 | pacman: 10 | name: bat 11 | when: ansible_distribution == "Archlinux" 12 | 13 | - name: Install bat (MacOSX) 14 | homebrew: 15 | name: 16 | - bat 17 | when: ansible_distribution == "MacOSX" 18 | 19 | - name: Create bat configuration directory 20 | file: 21 | path: ~/.config/bat 22 | state: directory 23 | 24 | - name: Link bat configuration 25 | file: 26 | src: "{{ playbook_dir }}/config/bat-config" 27 | dest: ~/.config/bat/config 28 | state: link 29 | -------------------------------------------------------------------------------- /config/oh-my-zsh-plugins/vegeta.plugin.zsh: -------------------------------------------------------------------------------- 1 | # vegeta quick 2 | vq () { 3 | TARGET="${1}" 4 | DURATION="${2}" 5 | RATE="${3}" 6 | 7 | SHOW_HELP=false 8 | for arg in "$@"; do 9 | if [ "${arg}" = "-h" ] || [ "${arg}" = "--help" ]; then 10 | SHOW_HELP=true 11 | fi 12 | done 13 | 14 | if [ "${TARGET}" = "" ] || ${SHOW_HELP}; then 15 | echo "usage vq target [duration rate]" 16 | echo "for example:" 17 | echo " vq https://example.org 5s 10" 18 | echo "" 19 | else 20 | echo "start vegeta with a rate of ${RATE}/1s for ${DURATION}" 21 | echo "---" 22 | echo "GET ${TARGET}" | vegeta attack -duration=${DURATION} -rate=${RATE} | vegeta report 23 | fi 24 | } 25 | -------------------------------------------------------------------------------- /roles/packer/tasks/linux.yml: -------------------------------------------------------------------------------- 1 | - name: Register file 2 | stat: 3 | path: /usr/local/bin/packer 4 | register: packer 5 | changed_when: False 6 | 7 | - name: Download packer 8 | get_url: 9 | url: https://releases.hashicorp.com/packer/{{ packer_version }}/packer_{{ packer_version }}_linux_amd64.zip 10 | dest: /tmp/packer.zip 11 | when: packer.stat.exists == False 12 | 13 | - name: Unarchive packer 14 | become: yes 15 | unarchive: 16 | src: /tmp/packer.zip 17 | dest: /usr/local/bin 18 | remote_src: yes 19 | when: packer.stat.exists == False 20 | 21 | - name: Remove downloaded archive 22 | file: 23 | path: /tmp/packer.zip 24 | state: absent 25 | when: packer.stat.exists == False 26 | -------------------------------------------------------------------------------- /roles/recording/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Check if npm is installed 2 | shell: which npm 3 | register: npm 4 | failed_when: False 5 | changed_when: False 6 | 7 | # beautiful gif terminal recording 8 | - name: Install terminalizer 9 | become: yes 10 | npm: 11 | name: terminalizer 12 | global: yes 13 | unsafe_perm: yes 14 | when: npm.rc == 0 15 | 16 | - name: Install recording tools (Arch) 17 | include: arch.yml 18 | when: ansible_distribution == "Archlinux" 19 | 20 | - name: Install recording tools (Ubuntu) 21 | include: ubuntu.yml 22 | when: ansible_distribution == "Ubuntu" 23 | 24 | - name: Install recording tools (MacOSX) 25 | include: osx.yml 26 | when: ansible_distribution == "MacOSX" 27 | -------------------------------------------------------------------------------- /config/gpg.conf.j2: -------------------------------------------------------------------------------- 1 | auto-key-locate keyserver 2 | keyserver hkps://keys.openpgp.org 3 | keyserver-options no-honor-keyserver-url 4 | keyserver-options no-honor-keyserver-url 5 | personal-cipher-preferences AES256 AES192 AES CAST5 6 | personal-digest-preferences SHA512 SHA384 SHA256 SHA224 7 | default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed 8 | cert-digest-algo SHA512 9 | s2k-cipher-algo AES256 10 | s2k-digest-algo SHA512 11 | charset utf-8 12 | fixed-list-mode 13 | no-comments 14 | no-emit-version 15 | keyid-format 0xlong 16 | list-options show-uid-validity 17 | verify-options show-uid-validity 18 | with-fingerprint 19 | use-agent 20 | require-cross-certification 21 | ignore-time-conflict 22 | allow-freeform-uid 23 | default-key {{ gpgKey }} 24 | -------------------------------------------------------------------------------- /roles/k8s/tasks/helm_arch.yml: -------------------------------------------------------------------------------- 1 | - name: capture installed helm version 2 | shell: helm version -c --short | awk '{print $2}' | awk -F'+' '{print $1}' | sed 's/v//g' 3 | register: helm 4 | changed_when: False 5 | 6 | - name: download and unarchive 7 | unarchive: 8 | src: https://get.helm.sh/helm-v{{ helm_version }}-linux-amd64.tar.gz 9 | dest: /tmp 10 | remote_src: yes 11 | when: helm.stdout != helm_version 12 | 13 | - name: install helm 14 | become: yes 15 | copy: 16 | src: /tmp/linux-amd64/helm 17 | dest: /usr/local/bin/helm 18 | owner: root 19 | group: root 20 | mode: 0755 21 | when: helm.stdout != helm_version 22 | 23 | - name: remove temporary files 24 | file: 25 | path: /tmp/linux-amd64 26 | state: absent 27 | when: helm.stdout != helm_version 28 | -------------------------------------------------------------------------------- /roles/k8s/tasks/gcloud_arch.yml: -------------------------------------------------------------------------------- 1 | - name: Check directory (Arch) 2 | stat: 3 | path: /usr/local/google-cloud-sdk 4 | register: gcloud 5 | changed_when: False 6 | 7 | - name: Download gcloud package (Arch) 8 | get_url: 9 | url: https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-249.0.0-linux-x86_64.tar.gz 10 | dest: /tmp/google-cloud-sdk.tar.gz 11 | when: gcloud.stat.exists == False 12 | 13 | - name: Unarchive gcloud package (Arch) 14 | become: yes 15 | unarchive: 16 | src: /tmp/google-cloud-sdk.tar.gz 17 | dest: /usr/local 18 | remote_src: yes 19 | when: gcloud.stat.exists == False 20 | 21 | - name: Remove downloaded package (Arch) 22 | file: 23 | path: /tmp/google-cloud-sdk.tar.gz 24 | state: absent 25 | when: gcloud.stat.exists == False 26 | -------------------------------------------------------------------------------- /roles/k8s/tasks/draft.yml: -------------------------------------------------------------------------------- 1 | - name: capture installed draft version 2 | shell: draft version --short | awk -F'+' '{print $1}' | sed 's/v//g' 3 | register: draft 4 | changed_when: False 5 | 6 | - name: download and unarchive 7 | unarchive: 8 | src: https://azuredraft.blob.core.windows.net/draft/draft-v{{ draft_version }}-linux-amd64.tar.gz 9 | dest: /tmp 10 | remote_src: yes 11 | when: draft.stdout != draft_version 12 | 13 | - name: install draft 14 | become: yes 15 | copy: 16 | src: /tmp/linux-amd64/draft 17 | dest: /usr/local/bin/draft 18 | owner: root 19 | group: root 20 | mode: 0755 21 | when: draft.stdout != draft_version 22 | 23 | - name: remove temporary files 24 | file: 25 | path: /tmp/linux-amd64 26 | state: absent 27 | when: draft.stdout != draft_version 28 | -------------------------------------------------------------------------------- /roles/docker/tasks/ubuntu.yml: -------------------------------------------------------------------------------- 1 | - name: Install docker gpg key (Ubuntu) 2 | become: yes 3 | apt_key: 4 | url: https://download.docker.com/linux/ubuntu/gpg 5 | 6 | - name: Capture lsb release (Ubuntu) 7 | shell: lsb_release -cs 8 | register: lsbrelease 9 | changed_when: False 10 | 11 | - name: Remove docker test apt repository (Ubuntu) 12 | become: yes 13 | apt_repository: 14 | repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ lsbrelease.stdout }} test 15 | state: absent 16 | 17 | - name: Install docker stable apt repository (Ubuntu) 18 | become: yes 19 | apt_repository: 20 | repo: deb [arch=amd64] https://download.docker.com/linux/ubuntu {{ lsbrelease.stdout }} stable 21 | 22 | - name: Install docker-ce package (Ubuntu) 23 | become: yes 24 | apt: 25 | name: docker-ce 26 | -------------------------------------------------------------------------------- /roles/k8s/tasks/kubectx.yml: -------------------------------------------------------------------------------- 1 | # Does not work well with bin 0.7.0 because it would only install kubectx, not kubens 2 | - name: Clone kubectx repository 3 | become: yes 4 | git: 5 | repo: https://github.com/ahmetb/kubectx 6 | dest: /opt/kubectx 7 | 8 | - name: Link kubectx scripts 9 | become: yes 10 | file: 11 | src: /opt/kubectx/{{ item }} 12 | dest: /usr/local/bin/{{ item }} 13 | state: link 14 | with_items: 15 | - kubectx 16 | - kubens 17 | 18 | - name: Create completions directory 19 | file: 20 | path: ~/.oh-my-zsh/completions 21 | state: directory 22 | 23 | - name: Link kubectx completions 24 | file: 25 | src: /opt/kubectx/completion/{{ item }}.zsh 26 | dest: ~/.oh-my-zsh/completions/_{{ item }}.zsh 27 | state: link 28 | with_items: 29 | - kubectx 30 | - kubens 31 | -------------------------------------------------------------------------------- /roles/node/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install node (Linux) 2 | become: yes 3 | snap: 4 | name: node 5 | classic: yes 6 | channel: 14/stable 7 | when: ansible_system == "Linux" 8 | 9 | - name: Remove node 10 (MacOSX) 10 | homebrew: 11 | name: node@10 12 | state: absent 13 | when: ansible_distribution == "MacOSX" 14 | 15 | - name: Install node and yarn (MacOSX) 16 | homebrew: 17 | name: 18 | - node 19 | - yarn 20 | when: ansible_distribution == "MacOSX" 21 | 22 | - name: Install yarn 23 | become: yes 24 | npm: 25 | name: yarn 26 | global: yes 27 | when: ansible_system == "Linux" 28 | 29 | - name: Install global npm packages 30 | become: yes 31 | npm: 32 | name: "{{ item }}" 33 | global: yes 34 | with_items: 35 | - colortest 36 | - prettier 37 | - create-react-app 38 | - tldr 39 | - doctoc 40 | -------------------------------------------------------------------------------- /roles/zsh/tasks/pywal.yml: -------------------------------------------------------------------------------- 1 | 2 | - name: Install pywal (Linux) 3 | become: yes 4 | pip: 5 | name: pywal 6 | executable: pip3 7 | when: ansible_distribution == "Ubuntu" or ansible_distribution == "Archlinux" 8 | 9 | # pywal requires imagemagick as backend 10 | - name: Install imagemagick (Linux) 11 | become: yes 12 | apt: 13 | name: imagemagick 14 | when: ansible_distribution == "Ubuntu" 15 | 16 | # we need to use the version from master for MacOSX, because of a bug in pywal 3.3.0 17 | # https://github.com/dylanaraps/pywal/issues/382 18 | 19 | - name: Capture if pywal is installed (MacOSX) 20 | stat: 21 | path: /usr/local/bin/wal 22 | register: wal 23 | 24 | - name: Install pywal (MacOSX) 25 | pip: 26 | name: https://github.com/dylanaraps/pywal/archive/master.zip 27 | executable: pip3 28 | when: not wal.stat.exists and ansible_distribution == "MacOSX" 29 | -------------------------------------------------------------------------------- /roles/vim/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install vim (Arch) 2 | become: yes 3 | pacman: 4 | name: vim 5 | when: ansible_distribution == "Archlinux" 6 | 7 | - name: Install vim (Ubuntu) 8 | become: yes 9 | apt: 10 | name: vim 11 | when: ansible_distribution == "Ubuntu" 12 | 13 | - name: Install vim (MacOSX) 14 | homebrew: 15 | name: vim 16 | when: ansible_distribution == "MacOSX" 17 | 18 | - name: install vim runtime 19 | git: 20 | repo: https://github.com/amix/vimrc 21 | dest: ~/.vim_runtime 22 | update: no 23 | 24 | - name: install wal theme for vim 25 | git: 26 | repo: https://github.com/dylanaraps/wal.vim 27 | dest: ~/.vim_runtime/my_plugins/wal.vim 28 | update: no 29 | 30 | - name: install nord theme for vim 31 | git: 32 | repo: https://github.com/arcticicestudio/nord-vim 33 | dest: ~/.vim_runtime/my_plugins/nord-vim 34 | update: no 35 | -------------------------------------------------------------------------------- /roles/cli-tools/tasks/topgrade.yml: -------------------------------------------------------------------------------- 1 | - name: Install topgrade (Arch) 2 | become: yes 3 | pacman: 4 | name: topgrade 5 | when: ansible_distribution == "Archlinux" 6 | 7 | - name: Capture topgrade version (Ubuntu) 8 | shell: topgrade --version | awk '{print $2}' 9 | register: actual_topgrade_version 10 | changed_when: False 11 | when: ansible_distribution == "Ubuntu" 12 | 13 | - name: Install topgrade (Ubuntu) 14 | become: yes 15 | unarchive: 16 | src: https://github.com/r-darwish/topgrade/releases/download/v{{ topgrade_base_version }}/topgrade-v{{ topgrade_base_version }}-x86_64-unknown-linux-gnu.tar.gz 17 | dest: /usr/local/bin 18 | remote_src: yes 19 | when: ansible_distribution == "Ubuntu" and (not actual_topgrade_version.stdout or actual_topgrade_version.stdout is version(topgrade_base_version, '<')) 20 | 21 | - name: Configure topgrade 22 | copy: 23 | src: "{{ playbook_dir }}/config/topgrade.toml" 24 | dest: $HOME/.config/ 25 | mode: 0644 26 | -------------------------------------------------------------------------------- /roles/gpg/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install gpg (Arch) 2 | become: yes 3 | pacman: 4 | name: gnupg 5 | when: ansible_distribution == "Archlinux" 6 | 7 | - name: Install gpg (Ubuntu) 8 | become: yes 9 | apt: 10 | name: 11 | - gnupg 12 | - pcscd 13 | - scdaemon 14 | when: ansible_distribution == "Ubuntu" 15 | 16 | - name: Install gpg (MacOSX) 17 | homebrew: 18 | name: 19 | - gnupg 20 | - pinentry-mac 21 | when: ansible_distribution == "MacOSX" 22 | 23 | - name: Create gpg configuration directory 24 | file: 25 | path: ~/.gnupg 26 | mode: 0700 27 | state: directory 28 | 29 | - name: Link gpgrc script 30 | file: 31 | src: "{{ playbook_dir }}/config/gpgrc" 32 | dest: ~/.gnupg/gpgrc 33 | state: link 34 | 35 | - name: Render gpg configurations 36 | template: 37 | src: "{{ playbook_dir }}/config/{{item}}.j2" 38 | dest: ~/.gnupg/{{item}} 39 | mode: 0600 40 | with_items: 41 | - gpg.conf 42 | - gpg-agent.conf 43 | -------------------------------------------------------------------------------- /roles/vagrant/tasks/arch.yml: -------------------------------------------------------------------------------- 1 | - name: Get installed version 2 | shell: pacman -Q --info hashicorp-vagrant | grep Version | awk -F':' '{print $NF}' | awk -F'-' '{print $1}' 3 | register: vagrant 4 | changed_when: False 5 | 6 | - name: Download vagrant package 7 | get_url: 8 | url: https://releases.hashicorp.com/vagrant/{{ vagrant_version }}/vagrant_{{ vagrant_version }}_x86_64.tar.xz 9 | dest: /tmp/vagrant_{{ vagrant_version }}_x86_64.tar.xz 10 | when: vagrant.stdout | trim != vagrant_version 11 | 12 | - name: Install vagrant 13 | become: yes 14 | # code below should work, but it does not 15 | # pacman: 16 | # name: /tmp/vagrant_{{ vagrant_version }}_x86_64.tar.xz 17 | # state: present 18 | shell: pacman -U --noconfirm /tmp/vagrant_{{ vagrant_version }}_x86_64.tar.xz 19 | when: vagrant.stdout | trim != vagrant_version 20 | 21 | - name: Remove downloaded package 22 | file: 23 | path: /tmp/vagrant_{{ vagrant_version }}_x86_64.tar.xz 24 | state: absent 25 | -------------------------------------------------------------------------------- /roles/virtualbox/tasks/ubuntu.yml: -------------------------------------------------------------------------------- 1 | - name: Install virtualbox gpg key (Ubuntu) 2 | become: yes 3 | apt_key: 4 | url: "{{ item }}" 5 | with_items: 6 | - https://www.virtualbox.org/download/oracle_vbox.asc 7 | - https://www.virtualbox.org/download/oracle_vbox_2016.asc 8 | 9 | - name: Capture lsb release (Ubuntu) 10 | shell: lsb_release -cs 11 | register: lsbrelease 12 | changed_when: False 13 | 14 | - name: Remove wrong configured virtualbox apt repository (Ubuntu) 15 | become: yes 16 | apt_repository: 17 | repo: deb https://download.virtualbox.org/virtualbox/debian {{ lsbrelease.stdout }} contrib 18 | state: absent 19 | 20 | - name: Install virtualbox apt repository (Ubuntu) 21 | become: yes 22 | apt_repository: 23 | repo: deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian {{ lsbrelease.stdout }} contrib 24 | state: present 25 | 26 | - name: Install virtualbox package (Ubuntu) 27 | become: yes 28 | apt: 29 | name: virtualbox-6.1 30 | -------------------------------------------------------------------------------- /roles/k8s/tasks/linux.yml: -------------------------------------------------------------------------------- 1 | - name: Install gcloud (Ubuntu) 2 | include: gcloud_ubuntu.yml 3 | when: ansible_distribution == "Ubuntu" 4 | 5 | - name: Install gcloud (Arch) 6 | include: gcloud_arch.yml 7 | when: ansible_distribution == "Archlinux" 8 | 9 | - name: Install kubectl 10 | become: yes 11 | shell: gcloud components install kubectl --quiet 12 | args: 13 | creates: /usr/local/google-cloud-sdk/bin/kubectl 14 | when: ansible_distribution != "Ubuntu" 15 | 16 | - name: Install kubectl 17 | become: yes 18 | snap: 19 | classic: yes 20 | name: kubectl 21 | when: ansible_distribution == "Ubuntu" 22 | 23 | - name: Install kubectx 24 | include: kubectx.yml 25 | 26 | - name: Install helm (Arch) 27 | include: helm_arch.yml 28 | when: ansible_distribution == "Archlinux" 29 | 30 | - name: Install helm (Ubuntu) 31 | include: helm_ubuntu.yml 32 | when: ansible_distribution == "Ubuntu" 33 | 34 | - name: Install draft 35 | include: draft.yml 36 | 37 | - name: Install velero 38 | include: velero.yml 39 | -------------------------------------------------------------------------------- /roles/k8s/tasks/velero.yml: -------------------------------------------------------------------------------- 1 | # Does not work well with bin 0.7.0 because you'll have to choose interactively which file from the tar to install 2 | - name: capture installed velero version 3 | shell: velero version --client-only | grep 'Version' | awk -F':' '{print $NF}' | sed -e 's/^\s*v//g' 4 | register: velero 5 | changed_when: False 6 | 7 | - name: download and unarchive velero 8 | unarchive: 9 | src: https://github.com/vmware-tanzu/velero/releases/download/v{{ velero_version }}/velero-v{{ velero_version }}-linux-amd64.tar.gz 10 | dest: /tmp 11 | remote_src: yes 12 | when: velero.stdout != velero_version 13 | 14 | - name: install velero 15 | become: yes 16 | copy: 17 | src: /tmp/velero-v{{ velero_version }}-linux-amd64/velero 18 | dest: /usr/local/bin/velero 19 | owner: root 20 | group: root 21 | mode: 0755 22 | when: velero.stdout != velero_version 23 | 24 | - name: remove temporary files 25 | file: 26 | path: /tmp/velero-v{{ velero_version }}-linux-amd64 27 | state: absent 28 | when: velero.stdout != velero_version 29 | -------------------------------------------------------------------------------- /roles/vscode/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install vscode (Arch) 2 | become: yes 3 | snap: 4 | name: code 5 | classic: yes 6 | state: present 7 | when: ansible_distribution == "Archlinux" 8 | 9 | - name: Install vscode (Ubuntu) 10 | become: yes 11 | include: ubuntu.yml 12 | when: ansible_distribution == "Ubuntu" 13 | 14 | - name: Install vscode (MacOSX) 15 | homebrew_cask: 16 | name: visual-studio-code 17 | when: ansible_distribution == "MacOSX" 18 | 19 | - name: install vscode extensions 20 | command: "code --install-extension '{{ item }}'" 21 | with_items: 22 | - ms-kubernetes-tools.vscode-kubernetes-tools 23 | - ms-azuretools.vscode-docker 24 | - EditorConfig.EditorConfig 25 | - dbaeumer.vscode-eslint 26 | - esbenp.prettier-vscode 27 | - zbr.vscode-ansible 28 | - k--kato.intellij-idea-keybindings 29 | - marcostazi.vs-code-vagrantfile 30 | - jebbs.plantuml 31 | - msjsdiag.debugger-for-chrome 32 | - ms-vsliveshare.vsliveshare 33 | - arcticicestudio.nord-visual-studio-code 34 | register: vscode_result 35 | changed_when: "'already installed' not in vscode_result.stdout" 36 | -------------------------------------------------------------------------------- /roles/brew/tasks/main.yml: -------------------------------------------------------------------------------- 1 | # Only linux. For Mac brew is a prerequisite 2 | # Check existence, in case linuxbrew has been installed manually (not via git clone) 3 | - name: Check Brew exists 4 | stat: 5 | path: /home/linuxbrew/.linuxbrew 6 | register: linuxbrew_folder 7 | 8 | - name: Install brew 9 | become: yes 10 | git: 11 | repo: https://github.com/Homebrew/brew 12 | dest: /home/linuxbrew/.linuxbrew 13 | update: no 14 | when: (not linuxbrew_folder.stat.exists) and (ansible_distribution == "Ubuntu" or ansible_distribution == "Archlinux") 15 | 16 | - name: Change brew folder permissions 17 | become: yes 18 | file: 19 | path: /home/linuxbrew/.linuxbrew 20 | owner: "{{ ansible_effective_user_id }}" 21 | group: "{{ ansible_effective_group_id }}" 22 | recurse: yes 23 | when: (not linuxbrew_folder.stat.exists) and (ansible_distribution == "Ubuntu" or ansible_distribution == "Archlinux") 24 | 25 | - name: Brew update 26 | shell: /home/linuxbrew/.linuxbrew/bin/brew update 27 | when: (not linuxbrew_folder.stat.exists) and (ansible_distribution == "Ubuntu" or ansible_distribution == "Archlinux") 28 | -------------------------------------------------------------------------------- /config/hgrc.j2: -------------------------------------------------------------------------------- 1 | [ui] 2 | username = {{displayName}} <{{mail}}> 3 | editor = vim 4 | merge = internal:merge3 5 | 6 | [pager] 7 | pager = LESS='FRX' less 8 | 9 | [extensions] 10 | mq = 11 | shelve = 12 | transplant = 13 | pager = 14 | # enable color extension 15 | color = 16 | # enable extdiff extension (Extended Diff) 17 | hgext.extdiff = 18 | purge = 19 | graphlog = 20 | 21 | [extdiff] 22 | # configure extended diff to use colordiff (requires colordiff installed in your system) 23 | cmd.cdiff = colordiff 24 | opts.cdiff = -uprN 25 | 26 | [color] 27 | # configure colors for each possible hg status 28 | status.modified = blue bold 29 | status.added = green bold 30 | status.removed = red bold 31 | status.deleted = cyan bold 32 | status.unknown = magenta bold 33 | status.ignored = white bold 34 | # and for hg diff output also 35 | diff.diffline = bold 36 | diff.extended = cyan bold 37 | diff.file_a = red bold 38 | diff.file_b = green bold 39 | diff.hunk = magenta 40 | diff.deleted = red 41 | diff.inserted = green 42 | diff.changed = white 43 | diff.trailingwhitespace = bold red_background 44 | 45 | [defaults] 46 | # suppress noisy extdiff header message 47 | cdiff = -q 48 | -------------------------------------------------------------------------------- /roles/git/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install git (Arch) 2 | become: yes 3 | pacman: 4 | name: 5 | - git 6 | - git-crypt 7 | when: ansible_distribution == "Archlinux" 8 | 9 | - name: Install git related tools (Ubuntu) 10 | become: yes 11 | apt: 12 | name: 13 | - git 14 | - git-crypt 15 | when: ansible_distribution == "Ubuntu" 16 | 17 | - name: Install git (MacOSX) 18 | homebrew: 19 | name: 20 | - git 21 | - git-crypt 22 | - gh 23 | when: ansible_distribution == "MacOSX" 24 | 25 | - name: Check gh client version (Ubuntu) 26 | shell: gh --version | head -1 | awk '{print $3}' 27 | register: gh 28 | changed_when: False 29 | when: ansible_distribution == "Ubuntu" 30 | 31 | - name: Install GitHub Client (Ubuntu) 32 | become: yes 33 | apt: 34 | deb: https://github.com/cli/cli/releases/download/v{{ gh_version }}/gh_{{ gh_version }}_linux_amd64.deb 35 | when: ansible_distribution == "Ubuntu" and gh.stdout != gh_version 36 | 37 | - name: Check if diff-so-fancy is installed 38 | stat: 39 | path: /usr/local/bin/diff-so-fancy 40 | register: diffsofancy 41 | 42 | # Note that gitconfig is written in dotfiles 43 | 44 | -------------------------------------------------------------------------------- /roles/golang/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install go 1.16 (Linux) 2 | become: yes 3 | snap: 4 | classic: yes 5 | channel: 1.16/stable 6 | name: go 7 | when: ansible_distribution == "Ubuntu" or ansible_distribution == "Archlinux" 8 | 9 | - name: Install go and required tools (MacOSX) 10 | homebrew: 11 | name: 12 | - go 13 | - dep 14 | - glide 15 | when: ansible_distribution == "MacOSX" 16 | 17 | - name: Create go path related directories 18 | file: 19 | path: "{{ item }}" 20 | state: directory 21 | with_items: 22 | - ~/Projects 23 | - ~/Projects/go 24 | - ~/Projects/go/bin 25 | - ~/Projects/go/pkg 26 | - ~/Projects/go/src 27 | 28 | - name: Link git configuration 29 | file: 30 | src: "{{ playbook_dir }}/config/gorc" 31 | dest: ~/.gorc 32 | state: link 33 | 34 | - name: Install required go tools (Arch) 35 | become: yes 36 | pacman: 37 | name: 38 | - dep 39 | - glide 40 | when: ansible_distribution == "Archlinux" 41 | 42 | - name: Install required go tools (Ubuntu) 43 | become: yes 44 | apt: 45 | name: 46 | - go-dep 47 | - golang-glide 48 | when: ansible_distribution == "Ubuntu" 49 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:focal-20210416 2 | 3 | # Install binaries needed by devboxes 4 | RUN apt-get update && \ 5 | apt-get install -y \ 6 | sudo \ 7 | ansible \ 8 | unzip \ 9 | fontconfig # fc-cache 10 | 11 | # Enable snap inside container 🙈 12 | # See https://github.com/ogra1/snapd-docker/blob/3a38d17a30d8295f6099b4e5769f54763e92ad4a/build.sh#L84 13 | RUN apt-get install -y fuse snapd snap-confine squashfuse init && \ 14 | apt-get clean && \ 15 | dpkg-divert --local --rename --add /sbin/udevadm && \ 16 | ln -s /bin/true /sbin/udevadm 17 | RUN systemctl enable snapd 18 | VOLUME ["/sys/fs/cgroup"] 19 | ENV container docker 20 | 21 | # Use a mock instead of installing Gnome (1,6GB) inside the container 22 | RUN echo 'echo gsettings mock' > /usr/bin/gsettings && chmod +x /usr/bin/gsettings 23 | 24 | # This sets the password 'box'. 25 | # Its a hashed value and was generated via "useradd dev" in an interactive shell and extracted from /etc/shadow 26 | RUN useradd -m -p '$6$dcac3osTmIrBAB7p$o6iwk3hirHgS3lQdS2yrFDMmeZRe5JS9vJlra6Cam.AVedpUMtJWFiQNoE2eePeuIM4yzz5cbkBtnutDxY.7D/' -s /bin/bash dev && \ 27 | usermod -aG sudo dev 28 | 29 | CMD [ "/sbin/init" ] 30 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.gitignore.io/api/ansible,linux,osx 3 | # Edit at https://www.gitignore.io/?templates=ansible,linux,osx 4 | 5 | ### Ansible ### 6 | *.retry 7 | 8 | ### Linux ### 9 | *~ 10 | 11 | # temporary files which can be created if a process still has a handle open of a deleted file 12 | .fuse_hidden* 13 | 14 | # KDE directory preferences 15 | .directory 16 | 17 | # Linux trash folder which might appear on any partition or disk 18 | .Trash-* 19 | 20 | # .nfs files are created when an open file is removed but is still being accessed 21 | .nfs* 22 | 23 | ### OSX ### 24 | # General 25 | .DS_Store 26 | .AppleDouble 27 | .LSOverride 28 | 29 | # Icon must end with two \r 30 | Icon 31 | 32 | # Thumbnails 33 | ._* 34 | 35 | # Files that might appear in the root of a volume 36 | .DocumentRevisions-V100 37 | .fseventsd 38 | .Spotlight-V100 39 | .TemporaryItems 40 | .Trashes 41 | .VolumeIcon.icns 42 | .com.apple.timemachine.donotpresent 43 | 44 | # Directories potentially created on remote AFP share 45 | .AppleDB 46 | .AppleDesktop 47 | Network Trash Folder 48 | Temporary Items 49 | .apdisk 50 | 51 | # End of https://www.gitignore.io/api/ansible,linux,osx 52 | 53 | vars.yml 54 | -------------------------------------------------------------------------------- /roles/zsh/tasks/font_linux.yml: -------------------------------------------------------------------------------- 1 | - name: Create fonts directory 2 | file: 3 | path: ~/.fonts 4 | state: directory 5 | 6 | - name: Install fira nerd-font 7 | unarchive: 8 | src: https://github.com/ryanoasis/nerd-fonts/releases/download/v2.0.0/FiraCode.zip 9 | dest: ~/.fonts 10 | remote_src: yes 11 | creates: ~/.fonts/Fura Code Medium Nerd Font Complete.ttf 12 | register: font 13 | 14 | - name: Rebuild font cache 15 | shell: fc-cache -f -v 16 | when: font.changed 17 | 18 | - name: Capture default terminal profile 19 | shell: gsettings get org.gnome.Terminal.ProfilesList default | sed "s/'//g" 20 | register: profile 21 | when: font.changed 22 | changed_when: False 23 | 24 | - name: Set nerd-font for current terminal profile 25 | shell: gsettings set "org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:{{ profile.stdout }}/" font "FuraCode Nerd Font Medium 11" 26 | when: font.changed 27 | 28 | - name: Install powerline font (Ubuntu) 29 | become: yes 30 | apt: 31 | name: 32 | - powerline 33 | - fonts-powerline 34 | when: ansible_distribution == "Ubuntu" 35 | 36 | - name: Install powerline font (Arch) 37 | become: yes 38 | pacman: 39 | name: 40 | - powerline 41 | - powerline-fonts 42 | when: ansible_distribution == "Archlinux" 43 | -------------------------------------------------------------------------------- /roles/cli-tools/tasks/bin.yml: -------------------------------------------------------------------------------- 1 | - name: Capture bin version 2 | shell: bin -v | grep bin | awk '{print $3}' 3 | register: actual_bin_version 4 | changed_when: False 5 | 6 | - name: Download bin 7 | get_url: 8 | url: https://github.com/marcosnils/bin/releases/download/v{{ bin_base_version }}/bin_{{ bin_base_version }}_Linux_x86_64 9 | dest: /tmp/bin 10 | mode: 0770 11 | when: not actual_bin_version.stdout or actual_bin_version.stdout is version(bin_base_version, '<') 12 | 13 | - name: Check bin config exists 14 | stat: 15 | path: $HOME/.config/bin/config.json 16 | register: bin_config_file 17 | 18 | - name: Create bin config folder 19 | file: 20 | path: "{{ item }}" 21 | state: directory 22 | with_items: 23 | - $HOME/.config/bin/ 24 | - $HOME/.local/bin/ 25 | 26 | - name: Create bin config file 27 | template: 28 | src: "{{ playbook_dir }}/config/bin-config.json.j2" 29 | dest: $HOME/.config/bin/config.json 30 | mode: 0660 31 | when: not bin_config_file.stat.exists 32 | 33 | - name: Self manage bin 34 | shell: /tmp/bin list | grep github.com/marcosnils/bin || /tmp/bin install github.com/marcosnils/bin 35 | when: not actual_bin_version.stdout or actual_bin_version.stdout is version(bin_base_version, '<') 36 | 37 | - name: Update all binaries managed by bin 38 | shell: yes | $HOME/.local/bin/bin update 39 | -------------------------------------------------------------------------------- /devbox: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -euo pipefail 3 | IFS=$'\n\t' 4 | 5 | if ! which ansible-playbook > /dev/null 2>&1; then 6 | echo "Could not find ansible. Please install ansible first" 7 | exit 1 8 | fi 9 | 10 | BASEDIR=$(dirname "$0") 11 | 12 | if [ ! -f "${BASEDIR}/vars.yml" ]; then 13 | echo -n "mail: " 14 | read MAIL 15 | 16 | echo -n "displayName: " 17 | read DISPLAY_NAME 18 | 19 | echo -n "gpg key: " 20 | read GPG_KEY 21 | 22 | echo -n "dotfiles repo (e.g. https://github.com/schnatterer/dotfiles/):" 23 | read DOTFILES_REPO 24 | 25 | cat > "${BASEDIR}/vars.yml" < /dev/null 2>&1; then 34 | PYTHON=$(which python3) 35 | else 36 | PYTHON=$(which python) 37 | fi 38 | 39 | echo "starting ansible ..." 40 | echo "====================" 41 | 42 | ansible-galaxy install -r "${BASEDIR}/requirements.yml" 43 | 44 | # If you pass "-e ansible_become_pass= vars.yml 38 | mail: some@o.ne 39 | displayName: Some one 40 | gpgKey: "abcdef" 41 | dotfilesRepo: https://github.com/schnatterer/dotfiles/ 42 | EOF 43 | 44 | - name: Initial smoke test 45 | env: 46 | # Avoid hitting rate limit for bin 47 | # https://github.com/marcosnils/bin/tree/74bf#i-used-bin-and-i-got-rate-limited-by-github-what-can-i-do 48 | GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 49 | run: ./devbox -e ansible_become_pass='' 50 | 51 | # Make sure the playbook also succeeds on incremental run 52 | - name: Incremental smoke test 53 | env: 54 | GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 55 | run: ./devbox -e ansible_become_pass='' 56 | 57 | - name: Log in to the Container registry 58 | uses: docker/login-action@v1 59 | with: 60 | registry: ${{ env.REGISTRY }} 61 | username: ${{ github.actor }} 62 | password: ${{ secrets.GITHUB_TOKEN }} 63 | 64 | - name: Extract metadata (tags, labels) for Docker 65 | id: meta 66 | uses: docker/metadata-action@v3 67 | with: 68 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 69 | # defaults: schedule and ref types 70 | # Additional: Set sha tag for each image 71 | # And: Main branch is latest for now 72 | tags: | 73 | type=schedule 74 | type=ref,event=branch 75 | type=ref,event=tag 76 | type=ref,event=pr 77 | type=sha,prefix=,format=short 78 | type=raw,enable=${{ github.ref == 'refs/heads/main' }},value=latest 79 | 80 | - name: Build and push Docker image 81 | uses: docker/build-push-action@v2 82 | with: 83 | context: . 84 | push: true 85 | tags: ${{ steps.meta.outputs.tags }} 86 | labels: ${{ steps.meta.outputs.labels }} 87 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Devboxes 2 | 3 | This repository contains ansible roles to setup my development machines and helps to keep them in sync. 4 | The ansible playbook will install software which i need for my day to day work as developer. 5 | It will also install my set of configuration for those tools. 6 | The playbook will install and configure the following tools: 7 | 8 | * zsh (configured with [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)) 9 | * modularized zshrc config via a dotfiles repo (e.g. [schnatterer/dotfiles](https://github.com/schnatterer/dotfiles/), inspired by [holman](https://github.com/holman/dotfiles)) 10 | * tmux (inspired from [.tmux](https://github.com/gpakosz/.tmux)) 11 | * vim (configured with [vimrc](https://github.com/amix/vimrc)) 12 | * docker 13 | * vagrant 14 | * virtual box 15 | * packer 16 | * terraform via [tfenv](https://github.com/tfutils/tfenv) 17 | * gcloud, kubectl and kubectx 18 | * gpg 19 | * git 20 | * mercurial 21 | * java, groovy, maven, gradle via [sdkman](https://sdkman.io/) 22 | * node.js via [nvm](https://github.com/nvm-sh/nvm) 23 | * golang 24 | * vscode 25 | * Intellij 26 | * bin, pipx and topgrade for installing and upgrading everything. 27 | Hints: 28 | * Run `topgrade` to upgrade everything regularly. 29 | * Use `pipx` to install python-base apps. Other than `pip`, apps installed using `pipx` are also upgraded using topgrade. 30 | * and many more 31 | 32 | ## Supported Operating Systems 33 | 34 | * Ubuntu (tested on 20.04) 35 | * Manjaro Linux 36 | * Mac OS X 37 | 38 | ## Prerequisites 39 | 40 | * Ansible >= 2.6 41 | 42 | ### MacOSX 43 | 44 | * Install [homebrew](https://brew.sh/) 45 | * Install ansible `brew install ansible` 46 | 47 | ### Ubuntu 48 | 49 | Install ansible 50 | 51 | ```bash 52 | sudo add-apt-repository ppa:ansible/ansible 53 | sudo apt-get update 54 | sudo apt-get install ansible 55 | ``` 56 | 57 | ### Manjaro 58 | 59 | Install ansible `sudo pacman -S ansible` 60 | 61 | ## Getting started 62 | 63 | Just run the `devbox` script, on the first run it will ask some question to personalize the installed configurations. 64 | After that it will ask for your sudo password and then apply the ansible playbook. 65 | 66 | You can also test the whole bunch in an ephemeral docker container. 67 | 68 | ```shell 69 | docker build -t devboxes . 70 | docker run -v $(pwd):/home/dev/devboxes \ 71 | -it \ 72 | --tmpfs /run \ 73 | --tmpfs /run/lock \ 74 | --privileged \ 75 | -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ 76 | -v /lib/modules:/lib/modules:ro \ 77 | --name devbox \ 78 | ghcr.io/schnatterer/devboxes 79 | 80 | #login with: dev / box 81 | devboxes/devbox -e ansible_become_pass='box' 82 | 83 | # Once ansible is done, explore the container as you like. 84 | # After you're done, you'll have to kill it from another terminal: 85 | docker stop devbox 86 | 87 | # If you need the container again later just 88 | docker start devbox 89 | #login with: dev / box 90 | docker attach devbox 91 | 92 | # If you want to get rid of it for good 93 | docker rm -f devbox 94 | ``` 95 | 96 | Please be aware that the `devbox` scripts loads several GB worth of data from the internet and that as a result the 97 | container will have take several GB on your harddrive (7GB at the time of writing). 98 | 99 | Note that it's not a sandboxed container, because devboxes relies on snap, which relies on systemd, which both are not 100 | made for containers. 101 | In general, less privileges than `--privileged` flag would suffice (see [snpad-docker](https://github.com/ogra1/snapd-docker/blob/3a38d17a30d8295f6099b4e5769f54763e92ad4a/build.sh#L110-L113)). 102 | But, devboxes installs and runs docker (in this case in docker), which is what `--privileged` was made for, so its an obvious choice here. 103 | Use it only for testing and development! 104 | 105 | ## Tags 106 | 107 | Its also possible to only apply certain tags, e.g. 108 | 109 | ```shell 110 | # exclusive tag 111 | devbox --tags zsh 112 | # excluded tag 113 | devbox --skip-tags zsh 114 | ``` 115 | 116 | See [playbook](playbook.yml) for existing tags. 117 | 118 | ## Todo 119 | 120 | - [ ] Automatically Git Updates 121 | - [ ] Role chooser 122 | -------------------------------------------------------------------------------- /roles/zsh/tasks/main.yml: -------------------------------------------------------------------------------- 1 | - name: Install zsh and required dependencies (Arch) 2 | become: yes 3 | pacman: 4 | name: 5 | - zsh 6 | - python3 7 | - python3-venv # for pipx 8 | - python-pip 9 | - fzf 10 | when: ansible_distribution == "Archlinux" 11 | 12 | - name: Install zsh and required dependencies (Ubuntu) 13 | become: yes 14 | apt: 15 | name: 16 | - zsh 17 | - python3 18 | - python3-venv # for pipx 19 | - python3-pip 20 | when: ansible_distribution == "Ubuntu" 21 | 22 | - name: Install zsh and required dependencies (MacOSX) 23 | homebrew: 24 | name: 25 | - zsh 26 | - python3 27 | - python3-venv # for pipx 28 | # - python3-pip is installed with python3 29 | - fzf 30 | when: ansible_distribution == "MacOSX" 31 | 32 | - name: Clone fzf repository (Ubuntu) 33 | git: 34 | repo: https://github.com/junegunn/fzf 35 | dest: ~/.fzf 36 | update: no 37 | when: ansible_distribution == "Ubuntu" 38 | 39 | - name: Install fzf (Ubuntu) 40 | shell: ~/.fzf/install --no-update-rc 41 | args: 42 | creates: ~/.fzf.zsh 43 | when: ansible_distribution == "Ubuntu" 44 | 45 | - name: Find path of zsh 46 | shell: which zsh 47 | register: whichzsh 48 | changed_when: False 49 | 50 | - name: Change default shell to zsh 51 | become: yes 52 | user: 53 | name: "{{ lookup('env','USER') }}" 54 | shell: "{{ whichzsh.stdout }}" 55 | when: not ansible_check_mode 56 | 57 | - name: Install terminal font (Linux) 58 | include: font_linux.yml 59 | when: ansible_distribution == "Ubuntu" or ansible_distribution == "Archlinux" 60 | 61 | - name: Install terminal font (MacOSX) 62 | include: font_osx.yml 63 | when: ansible_distribution == "MacOSX" 64 | 65 | - name: Install oh-my-zsh 66 | git: 67 | repo: https://github.com/robbyrussell/oh-my-zsh 68 | dest: ~/.oh-my-zsh 69 | update: no 70 | 71 | - name: Install zsh-autosuggestions 72 | git: 73 | repo: https://github.com/zsh-users/zsh-autosuggestions.git 74 | dest: ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions 75 | update: no 76 | 77 | - name: Install zsh-you-should-use 78 | git: 79 | repo: https://github.com/MichaelAquilina/zsh-you-should-use 80 | dest: ~/.oh-my-zsh/custom/plugins/you-should-use 81 | update: no 82 | 83 | - name: Install zsh-fast-syntax-highlighting 84 | git: 85 | repo: https://github.com/zdharma/fast-syntax-highlighting 86 | dest: ~/.oh-my-zsh/custom/plugins/fast-syntax-highlighting 87 | update: no 88 | 89 | - name: Install powerlevel10k theme 90 | git: 91 | repo: https://github.com/romkatv/powerlevel10k 92 | dest: ~/.oh-my-zsh/custom/themes/powerlevel10k 93 | update: no 94 | 95 | - name: Install spaceship prompt/theme 96 | git: 97 | repo: https://github.com/denysdovhan/spaceship-prompt 98 | dest: ~/.oh-my-zsh/custom/themes/spaceship-prompt 99 | update: no 100 | 101 | - name: Create symlink for spaceship prompt 102 | file: 103 | src: ~/.oh-my-zsh/custom/themes/spaceship-prompt/spaceship.zsh-theme 104 | dest: ~/.oh-my-zsh/custom/themes/spaceship.zsh-theme 105 | state: link 106 | 107 | - name: create custom oh-my-zsh plugin directories 108 | file: 109 | path: "~/.oh-my-zsh/custom/plugins/{{ item }}" 110 | state: directory 111 | with_items: "{{ custom_omz_plugins }}" 112 | 113 | - name: Install custom oh-my-zsh plugins 114 | file: 115 | src: "{{ playbook_dir }}/config/oh-my-zsh-plugins/{{item}}.plugin.zsh" 116 | dest: "~/.oh-my-zsh/custom/plugins/{{ item }}/{{item}}.plugin.zsh" 117 | state: link 118 | with_items: "{{ custom_omz_plugins }}" 119 | 120 | - name: Install pywal (Linux) 121 | become: yes 122 | pip: 123 | name: pywal 124 | executable: pip3 125 | when: ansible_distribution == "Ubuntu" or ansible_distribution == "Archlinux" 126 | 127 | # we need to use the version from master for MacOSX, because of a bug in pywal 3.3.0 128 | # https://github.com/dylanaraps/pywal/issues/382 129 | 130 | - name: Capture if pywal is installed (MacOSX) 131 | stat: 132 | path: /usr/local/bin/wal 133 | register: wal 134 | 135 | - name: Install pywal (MacOSX) 136 | pip: 137 | name: https://github.com/dylanaraps/pywal/archive/master.zip 138 | executable: pip3 139 | when: not wal.stat.exists and ansible_distribution == "MacOSX" 140 | --------------------------------------------------------------------------------