Skip to content

Example Ansible Roles

This project contains a growing set of example Ansible roles. Use this page as the lightweight catalog and starting point, and use roles/ for the implementation details.

Current example roles in the repository:

  • brew: installs and bootstraps Homebrew on macOS
  • java: installs Temurin/OpenJDK-based Java runtimes
  • jetbrains: installs JetBrains Toolbox
  • k9s: installs the Kubernetes terminal UI
  • kind: installs Kubernetes in Docker (kind)
  • kubectl: installs the Kubernetes CLI
  • kubelogin: installs the Kubernetes/OpenID login helper
  • openssh: configures OpenSSH support for Windows targets
  • python: installs Python tooling
  • spotify: installs Spotify where supported

The role-oriented parts of the repository are organized like this:

sailwright/
├── roles/
│ ├── brew/
│ ├── java/
│ └── python/
├── inventory/
│ ├── localhost.yaml
│ └── ...
├── playbooks/
│ ├── setup.yml
│ └── ...
└── docs/
└── example-roles.md
  • Add or adjust role logic under roles/.
  • Use inventories under inventory/ for localhost, remote hosts, or Windows access methods.
  • Run the shared entrypoint from playbooks/setup.yml unless a role-specific playbook is a better fit.
  • Configure extra local or Git-backed role roots with Ansible Role Sources when you want to develop roles outside the bundled roles/ tree.

Run only selected tagged tasks:

Terminal window
ansible-playbook playbooks/setup.yml -i inventory/localhost.yaml --tags "dotfiles,python"

Pass variables to enable or tune behavior:

Terminal window
ansible-playbook playbooks/setup.yml -i inventory/localhost.yaml -e "install_docker=true"

For broader localhost, remote-host, VM, and Windows command examples, see Running Playbooks.

For role-source layering tests, see roles_test_1/, roles_test_2/, and playbooks/role-sources-test.yml.

The exact role set can evolve over time. For the source of truth, inspect the directories under roles/.