Roles vs Collections on Galaxy
What you can pull from the hub.
Roles vs Collections on Galaxy is a free Ansible Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Ansible Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
You Are Not the First
Someone has almost certainly already automated the thing you need. Ansible Galaxy is the public hub where the community shares that work.
Galaxy in One Line
Galaxy is a website and registry at galaxy.ansible.com that hosts ready-made roles and collections you can install and reuse.
What a Role Bundles
A role packages tasks, handlers, templates, and default variables for one job, like setting up nginx or PostgreSQL, into a reusable unit.
What a Collection Bundles
A collection is bigger: it can ship many roles, modules, and plugins together under one versioned, distributable package.
Collections Are the Modern Unit
Since Ansible 2.10, even core modules ship inside collections. They are now the primary way content is packaged and distributed.
Naming Tells You Which
Collections use a namespace.collection name like community.general, while a standalone role is named author.rolename.
community.general
geerlingguy.nginxWhere Each One Goes
Installed roles land in your roles path, while collections install into a collections path. Both keep your project tidy.
Two Install Commands
You fetch content with ansible-galaxy: use the role subcommand for roles and the collection subcommand for collections.
ansible-galaxy role install geerlingguy.nginx
ansible-galaxy collection install community.generalVetting What You Pull
Galaxy shows download counts and a community score. Prefer well-used content and always skim the source before trusting a role on your servers.
Built-In vs Galaxy
The huge community.general collection bundles with many installs, but Galaxy is where you reach for anything beyond that baseline.
Rule of Thumb
Need one focused job? Grab a role. Need a whole toolkit of modules and plugins for a platform? Grab a collection.
Quick Check
Tell apart the two kinds of content Galaxy distributes.
Recap
Galaxy shares community automation: roles bundle one job, collections bundle many. Pull either with ansible-galaxy and vet it first. 🌌
Frequently asked questions
Is the “Roles vs Collections on Galaxy” lesson free?
Yes — the full text of “Roles vs Collections on Galaxy” is free to read here on the web, and the Ansible Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Ansible Academy course, upgrade to CoddyKit PRO.
What will I learn in “Roles vs Collections on Galaxy”?
What you can pull from the hub. You practise Ansible Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Ansible Academy?
No prior experience is required. Ansible Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Roles vs Collections on Galaxy” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Ansible Academy lesson?
Yes. Every Ansible Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Roles vs Collections on Galaxy
- Install Roles with requirements.yml
- Using FQCN: namespace.collection.module
- Publishing Your Own Role to Galaxy