Run particular code
To run only particular parts of the code you can run ansible with --tags switch(es)
To include/exclude whole roles:
- config
- software
ansible-playbook -i inventory.yml setup-ubuntu.yml --tags "config" -K
Above will run only configuration part of the automation, it won't install/update any software
You can run multiple multiple tags at once:
ansible-playbook -i inventory.yml setup-ubuntu.yml --tags "neovim,neovim-config,tmux" -K
ansible-playbook -i inventory.yml setup-ubuntu.yml --tags "zsh" --skip-tags "config" -K
Above will run only software role for ZSH, and will not run configuration for it.
For particular functionality (software + config) below tags are available:
- ansible
- argocd
- argonaut
- awscli
- az-account-switcher
- azurecli
- bottom
- ccmux
- crane
- curlie
- diff-so-fancy
- docker
- dry
- dyff
- eks-node-viewer
- eksctl
- eza
- fd
- fx
- fzf
- git
- git-fuzzy
- gita
- granted
- gvm
- helm
- helm-unittest
- hunk
- k9s
- kind
- kubecolor
- kubeconform
- kubectl
- kubeswitch
- lazygit
- lsg
- neovim
- neovim-config
- nvm
- opencode
- opencode-config
- p10k
- pay-respects
- puppet
- revdiff
- ripgrep
- rust
- rvm
- sdkman
- session-manager-plugin
- shellcheck
- software_packages
- spacectl
- steampipe
- stern
- taws
- tenv
- terraform
- terraform-docs
- terragrunt
- tflint
- tmux
- tofu
- uv
- w32yank
- wsl-notify-send
- yq
- zoxide
- zsh
Bundles
A bundle tag selects all the tools for one purpose. Combine it with
--skip-tags to leave single tools out:
ansible-playbook -i inventory.yml setup-ubuntu.yml --tags "aws-tools,terraform-tools" --skip-tags "tofu" -K
| Bundle | Tools |
|---|---|
aws-tools | awscli, granted, session-manager-plugin, taws, eksctl, eks-node-viewer, steampipe |
azure-tools | azurecli, az-account-switcher |
kubernetes-tools | kubectl, kubecolor, kubeswitch, k9s, helm, helm-unittest, kubeconform, dyff, kind, stern, crane |
terraform-tools | tenv, terraform, tofu, terragrunt, tflint, terraform-docs |
argocd-tools | argocd, argonaut |
spacelift-tools | spacectl |
Bundle names also work in software_tasks_exclude, see
Excluding code.
There is also versions, which re-resolves every tool version and prunes old
installation directories.
Skip-only tags
A few tags exist purely so you can exclude things with --skip-tags. They
cannot be used with --tags, because the tasks they mark depend on version
resolution that happens earlier in the same task file:
cleanup— the removal of old versions from~/.local/opt. Use--skip-tags cleanupto keep old versions around. To run the cleanup, use--tags versions.sdkman_privilege— the SDKMAN tasks that needsudo(fixing permissions onSDKMAN_DIRand updating alternatives). Use--skip-tags sdkman_privilegeto run the SDKMAN part unprivileged.
The list above can always be regenerated from the playbook:
ansible-playbook -i inventory.yml setup-ubuntu.yml --list-tags
setup-windows.yml has no tags at all. To run only parts of it, use the
bundle_include variables instead — see Windows automation.