ATIX AG
  • Services
    • Consulting
      • Linux Platform Operations​
      • Infrastructure Automation
      • Container Platforms and Cloud
      • DevOps Processes, Tooling and Culture
      • Cloud Native Software Development
    • Products
      • orcharhino
        • About orcharhino
        • Support
        • orcharhino operation
    • Technologies
      • Ansible
      • AWX and Ansible Automation Platform
      • Docker
      • Foreman
      • GitLab
      • Istio
      • Kubernetes
      • Linux Distributions
      • OpenShift
      • Puppet
      • OpenVox
      • Rancher
      • Rundeck
      • SaltStack
      • SUSE Manager
      • Terraform
  • Trainings
    • Ansible Training
    • AWX Training
    • Docker & Container Training
    • Git Training
    • Kubernetes Training
    • OpenShift Training
    • orcharhino Training
    • OpenVox/Puppet Trainings
    • Terraform Training
  • Events
    • Webinars
  • Blog
  • Company
    • About Us
    • References
    • Corporate values
    • Social engagement
    • Newsroom
    • Newsletter
    • Contact us
  • Career
  • German
  • Click to open the search input field Click to open the search input field Search
  • Menu Menu

Ansible Collections – More clarity and easier sharing in Ansible

Ansible is the fastest-growing configuration management tool these days. This has also created a steadily growing community. Due to the simple architecture and the resulting easy extensibility, more and more companies and private persons provide their roles, modules and playbooks for their products and projects.

ebook Infrastucture Automation

Free E-Book

Infrastructure Automation with Linux and Open Source Tools

This free e-book provides practical examples of how you can use Linux and open-source tools to simplify recurring tasks, reduce errors, and establish scalable IT processes.
Discover it now.

Download now for free

The Ansible Core project now has a four-digit number of open pull requests and issues on Github. This has become confusing, not only from Red Hat’s perspective.

For more common uses of Ansible – for example, installing the Docker Daemons or the apache web server – Red Hat created Ansible Galaxy some time ago: A place where members of the community provide generic roles for free use. Thus the wheel does not have to be reinvented every time. The community develops not only roles but also modules and other plugins for sometimes very special cases. To provide more structure and better community participation in the Ansible Project, Red Hat has created Ansible Collections: These are product or project-specific collections of playbooks, roles, modules, and plug-ins. As before, these roles are provided via the Ansible Galaxy. The introduction of collections gives companies or projects more control over the Ansible Code they provide themselves. This allows you to bring your own modules or plugins upstream faster: the pull requests are less likely to slip down the list or be forgotten. Once merged, you no longer have to wait for the next release of Ansible, but can simply include the latest version of your collection. At the same time, the Ansible Galaxy maintains the visibility of the collection. Red Hat has taken the first step in this direction by creating collections of projects. These are also maintained by official bodies. These include Ansible Tower, Amazon AWS, and Red Hat Satellite. The Ansible Modules, which we use and actively develop for our orcharhino are now also available as a collection.

Application

The handling is similar to that of the roles in the Ansible Galaxy. A collection is installed either via command line:

ansible-galaxy collection install my_namespace.my_collection:1.0.0

or, if you want to install several at once, via a requirements file:

---
collections:
# With just the collection name
- my_namespace.my_collection

# With the collection name, version, and source options
- name: my_namespace.my_other_collection
 version: 1.0.3 # version range identifiers (default: ``*``)
 source: https://galaxy.ansible.com # The Galaxy URL to pull the collection from (default: ``--api-server`` from cmdline)
...

Once the collection is installed, the modules, roles and plugins it contains can be easily integrated:

---
- hosts: all
 tasks:
 - import_role:
 name: my_namespace.my_collection.role1

 - my_namespace.mycollection.mymodule:
 option1: value

 - debug:
 msg: '{{ lookup("my_namespace.my_collection.lookup1", 'param1')| my_namespace.my_collection.filter1 }}'
...

To avoid getting your fingers sore, you can import the collection completely at the beginning of the game and then use all modules and roles (but not filters and lookup plugins!):

---
- hosts: all
 collections:
 - my_namespace.my_collection
 tasks:
 - import_role:
 name: role1

 - mymodule:
 option1: value

 - debug:
 msg: '{{ lookup("my_namespace.my_collection.lookup1", 'param1')| my_namespace.my_collection.filter1 }}'
...

Source of the code examples

In addition to the modules and plug-ins officially supported and maintained by Red Hat, the previous Ansible versions (≤2.9) also contain a large number of plug-ins and modules maintained by the community. With Ansible 2.10 all the community maintained content is separated into a community.general Collection. Ansible’s premise has always been “batteries included”, i.e. nothing needs to be installed after installing Ansible. The default installation of Ansible 2.10 still contains the > 3000 modules and plugins, so most playbooks with the upgrade to 2.10 probably require only minor changes. So this premise is still correct. The big changes happen with 2.10 under the hood. Therefore they will appear gradually as the community provides more and more collections.

To learn more about the use and creation of Ansible Collections, attend our Ansible Trainings. There will also be an Advanced Ansible Workshop at our OSAD, where we will go into collections in more detail.

Ansible Training

The Ansible Training – “Fast Track” teaches participants how to manage infrastructures with Ansible as well as the basic concepts and best practices of Ansible. The “Ansible Extended Training” also offers an additional day where the trainer can specifically address individual questions and needs of the participants.

Find out more
You might also like
Ansible Automation Platform Ansible Automation Platform
ansible blog atix Ansible Best Practices
cnfgcamp meet atix Configuring Hosts using Ansible
deploying kubernetes cluster Deploying a Kubernetes Cluster with orcharhino
Ansible automation with AWX Ansible automation with AWX: an overview and how to get started
The Future Ansible The Future of Ansible
ATIX-Crew
+ postsBio

Der ATIX-Crew besteht aus Leuten, die in unterschiedlichen Bereichen tätig sind: Consulting, Development/Engineering, Support, Vertrieb und Marketing.

  • ATIX-Crew
    Foreman Birthday Party 2024
  • ATIX-Crew
    CrewDay 2024
  • ATIX-Crew
    Navigating the XZ Security Vulnerability: A Comprehensive Guide
  • ATIX-Crew
    Automating Kafka with Ansible
  • ATIX-Crew
    Managing Large Debian Repositories with Pulp
  • ATIX-Crew
    Configuration Management across Different Networks with AWX
  • ATIX-Crew
    pulp_deb past, present, and future – tell us what pulp_deb development should focus on next
  • ATIX-Crew
    DevOps Culture “without Bullshit”
  • ATIX-Crew
    ATIX @ CfgMgmt Camp 2020
  • ATIX-Crew
    The Future of Ansible
  • ATIX-Crew
    A somewhat different OSAD
  • ATIX-Crew
    Save The Rhino
  • ATIX-Crew
    SBOL: Open Source based exchange for biotech enthusiasts
  • ATIX-Crew
    Test Ansible roles with Molecule
  • ATIX-Crew
    Workshops in the Cloud – What Ansible, Docker and the GitLab CI/CD offer for this
  • ATIX-Crew
    ATIX Crew on Tour: Geocaching and pasta salad by the water
  • ATIX-Crew
    ATIX’s Debian/Ubuntu Erratum Service is now open source!
  • ATIX-Crew
    The ATIX crew @ Config Management Camp 2019
  • ATIX-Crew
    From the starting block into the fire!
  • ATIX-Crew
    orcharhino-installer Plugin Selection
  • ATIX-Crew
    fpm – the fast track to the parcel
  • ATIX-Crew
    ATIX #CrewDay: Rhino learns to speak!
  • ATIX-Crew
    SaltStack: Salty alternative to the puppet player
  • ATIX-Crew
    Snapshots for everyone!
  • ATIX-Crew
    Configuration management with Ansible
  • ATIX-Crew
    Creation of Foreman RPM packages with Docker containers
  • ATIX-Crew
    Rancher: New containers for the (server) farm – quick and easy
  • ATIX-Crew
    Rancher: Conducting a container pack
  • ATIX-Crew
    Docker Swarm: A herd of containers
  • ATIX-Crew
    ATIX at the Chemnitz Linux Days 2017 – A story from the perspective of our learners
  • ATIX-Crew
    Software-defined storage
  • ATIX-Crew
    Docker containers – a lightweight alternative to virtualization
  • ATIX-Crew
    Selenium IDE – Automated testing of web applications with a browser

On this page

ISO 27001 Certified Download ISO 27001 Certificate
ISO 9001 Certified Download ISO 9001 Certificate
Newsletter
Never miss anything again. Sign up for the ATIX newsletter!
Sign up now
Blog
  • Blog Start Page
  • ATIX Insights
  • Cloud Native
  • Container Plattformen und Cloud
  • DevOps
  • Infrastructure Automation
  • Linux Platform Operations
  • orcharhino
Privacy & Legal

Privacy Policy

Imprint

Terms and Conditions

B2B

Twitter     Facebook    LinkedIn    Youtube     mastodon=

© Copyright – ATIX AG

Scroll to top Scroll to top Scroll to top