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 macOSjava: installs Temurin/OpenJDK-based Java runtimesjetbrains: installs JetBrains Toolboxk9s: installs the Kubernetes terminal UIkind: installs Kubernetes in Docker (kind)kubectl: installs the Kubernetes CLIkubelogin: installs the Kubernetes/OpenID login helperopenssh: configures OpenSSH support for Windows targetspython: installs Python toolingspotify: installs Spotify where supported
Repository structure
Section titled “Repository structure”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.ymlunless 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.
Customization
Section titled “Customization”Run only selected tagged tasks:
ansible-playbook playbooks/setup.yml -i inventory/localhost.yaml --tags "dotfiles,python"Pass variables to enable or tune behavior:
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/.